summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-06-26 18:39:52 +0000
committerChristian Breunig <christian@breunig.cc>2024-06-26 21:47:09 +0200
commit6890cd7b0f2419d6b1a720d892f9a7d07b7cfd05 (patch)
treea720ba9c5ca30326d2f6d37fb805bce16ff1b54a
parent85c8399b6f8cf0d999076bddaba09c1cc9088917 (diff)
downloadvyos-1x-6890cd7b0f2419d6b1a720d892f9a7d07b7cfd05.tar.gz
vyos-1x-6890cd7b0f2419d6b1a720d892f9a7d07b7cfd05.zip
smoketest: T6510: make test_configd_inspect.py a build time test
Rather then waiting for a fully assembled ISO image to validate if there is no incompatibility with vyos-configd - like more then one instance of Config(), make this a build time test case for "make test"
-rw-r--r--debian/control6
-rw-r--r--[-rwxr-xr-x]src/tests/test_configd_inspect.py (renamed from smoketest/scripts/cli/test_configd_inspect.py)21
2 files changed, 14 insertions, 13 deletions
diff --git a/debian/control b/debian/control
index 2e99bdc28..883e08649 100644
--- a/debian/control
+++ b/debian/control
@@ -19,12 +19,18 @@ Build-Depends:
python3-xmltodict,
# For running tests
python3-coverage,
+ python3-hurry.filesize,
+ python3-netaddr,
python3-netifaces,
python3-nose,
python3-jinja2,
+ python3-paramiko,
+ python3-passlib,
python3-psutil,
python3-requests,
python3-setuptools,
+ python3-tabulate,
+ python3-zmq,
quilt,
whois
Standards-Version: 3.9.6
diff --git a/smoketest/scripts/cli/test_configd_inspect.py b/src/tests/test_configd_inspect.py
index af46c6148..98552c8f3 100755..100644
--- a/smoketest/scripts/cli/test_configd_inspect.py
+++ b/src/tests/test_configd_inspect.py
@@ -1,6 +1,4 @@
-#!/usr/bin/env python3
-#
-# Copyright (C) 2020 VyOS maintainers and contributors
+# Copyright (C) 2020-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -17,16 +15,16 @@
import os
import re
import json
-import unittest
+
import warnings
import importlib.util
-from inspect import signature, getsource
+from inspect import signature
+from inspect import getsource
from functools import wraps
+from unittest import TestCase
-from vyos.defaults import directories
-
-INC_FILE = '/usr/share/vyos/configd-include.json'
-CONF_DIR = directories['conf_mode']
+INC_FILE = 'data/configd-include.json'
+CONF_DIR = 'src/conf_mode'
f_list = ['get_config', 'verify', 'generate', 'apply']
@@ -47,7 +45,7 @@ def ignore_deprecation_warning(f):
f(*args, **kwargs)
return decorated_function
-class TestConfigdInclude(unittest.TestCase):
+class TestConfigdInspect(TestCase):
def setUp(self):
with open(INC_FILE) as f:
self.inc_list = json.load(f)
@@ -105,6 +103,3 @@ class TestConfigdInclude(unittest.TestCase):
str_m = getsource(m)
n = str_m.count('my_set')
self.assertEqual(n, 0, f"'{s}' modifies config")
-
-if __name__ == '__main__':
- unittest.main(verbosity=2)