summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_pppoe.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-06 12:44:01 +0200
committerChristian Breunig <christian@breunig.cc>2024-04-06 12:51:18 +0200
commitd9d2e9c8ead29c173fefd1b565d191a85baaa071 (patch)
tree3d9f16a071e0a7f3367952783ad47a5a7ff4e482 /smoketest/scripts/cli/test_interfaces_pppoe.py
parent71786307eed6a0ebb42755f24c19dfd46b1b9696 (diff)
downloadvyos-1x-d9d2e9c8ead29c173fefd1b565d191a85baaa071.tar.gz
vyos-1x-d9d2e9c8ead29c173fefd1b565d191a85baaa071.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.
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_pppoe.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_pppoe.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_pppoe.py b/smoketest/scripts/cli/test_interfaces_pppoe.py
index e99d8b3d1..2683a3122 100755
--- a/smoketest/scripts/cli/test_interfaces_pppoe.py
+++ b/smoketest/scripts/cli/test_interfaces_pppoe.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2023 VyOS maintainers and contributors
+# Copyright (C) 2019-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
@@ -20,6 +20,7 @@ from psutil import process_iter
from base_vyostest_shim import VyOSUnitTestSHIM
from vyos.configsession import ConfigSessionError
+from vyos.xml_ref import default_value
config_file = '/etc/ppp/peers/{}'
base_path = ['interfaces', 'pppoe']
@@ -169,10 +170,10 @@ class PPPoEInterfaceTest(VyOSUnitTestSHIM.TestCase):
for interface in self._interfaces:
user = f'VyOS-user-{interface}'
passwd = f'VyOS-passwd-{interface}'
+ mtu_default = default_value(base_path + [interface, 'mtu'])
- # verify "normal" PPPoE value - 1492 is default MTU
tmp = get_config_value(interface, 'mtu')[1]
- self.assertEqual(tmp, '1492')
+ self.assertEqual(tmp, mtu_default)
tmp = get_config_value(interface, 'user')[1].replace('"', '')
self.assertEqual(tmp, user)
tmp = get_config_value(interface, 'password')[1].replace('"', '')