summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_wireless.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-06 12:44:01 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-04-06 10:55:42 +0000
commitb9ee31f23b7258161eb9153ad3cdc719c8cd6120 (patch)
treed83a822e2242b9392a3b05dd1edcf2311dd10aa6 /smoketest/scripts/cli/test_interfaces_wireless.py
parente8168aa7171f48a8f7cd80f9419b1226c5a889e2 (diff)
downloadvyos-1x-b9ee31f23b7258161eb9153ad3cdc719c8cd6120.tar.gz
vyos-1x-b9ee31f23b7258161eb9153ad3cdc719c8cd6120.zip
T6199: start validating smoketests against real CLI defaultValues
Use vyos.xml_ref.default_value to query XML default values and take them into account when validating properly applied defaults in individual smoketests instead of using hardcoded values like 443 for https port. (cherry picked from commit d9d2e9c8ead29c173fefd1b565d191a85baaa071)
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_wireless.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_wireless.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_wireless.py b/smoketest/scripts/cli/test_interfaces_wireless.py
index 95246a7b9..83b00ac0c 100755
--- a/smoketest/scripts/cli/test_interfaces_wireless.py
+++ b/smoketest/scripts/cli/test_interfaces_wireless.py
@@ -25,6 +25,7 @@ from vyos.configsession import ConfigSessionError
from vyos.utils.process import process_named_running
from vyos.utils.kernel import check_kmod
from vyos.utils.file import read_file
+from vyos.xml_ref import default_value
def get_config_value(interface, key):
tmp = read_file(f'/run/hostapd/{interface}.conf')
@@ -127,7 +128,8 @@ class WirelessInterfaceTest(BasicInterfaceTest.TestCase):
# channel
tmp = get_config_value(interface, 'channel')
- self.assertEqual('0', tmp) # default is channel 0
+ cli_default = default_value(self._base_path + [interface, 'channel'])
+ self.assertEqual(cli_default, tmp)
# auto-powersave is special
tmp = get_config_value(interface, 'uapsd_advertisement_enabled')