diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-20 08:45:31 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-09-21 08:51:28 +0200 |
commit | 90ab441a55b2ec769e7a6fea1dd57bef89b8857c (patch) | |
tree | 8a2fbc7682728a4205af088e471f1111a5cc02d9 /smoketest | |
parent | a5a6e57b3f7ba7d76bffcfb8dcb086d79f51202a (diff) | |
download | vyos-1x-90ab441a55b2ec769e7a6fea1dd57bef89b8857c.tar.gz vyos-1x-90ab441a55b2ec769e7a6fea1dd57bef89b8857c.zip |
T6630: ntp: rename ptp-transport to ptp and use defaultValue for port
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_service_ntp.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_service_ntp.py b/smoketest/scripts/cli/test_service_ntp.py index a39431c1b..02435bbfb 100755 --- a/smoketest/scripts/cli/test_service_ntp.py +++ b/smoketest/scripts/cli/test_service_ntp.py @@ -21,6 +21,7 @@ from base_vyostest_shim import VyOSUnitTestSHIM from vyos.configsession import ConfigSessionError from vyos.utils.process import cmd from vyos.utils.process import process_named_running +from vyos.xml_ref import default_value PROCESS_NAME = 'chronyd' NTP_CONF = '/run/chrony/chrony.conf' @@ -229,17 +230,19 @@ class TestSystemNTP(VyOSUnitTestSHIM.TestCase): servers = ['192.0.2.1', '192.0.2.2'] options = ['prefer'] + default_ptp_port = default_value(base_path + ['ptp', 'port']) + for server in servers: for option in options: self.cli_set(base_path + ['server', server, option]) - self.cli_set(base_path + ['server', server, 'ptp-transport']) + self.cli_set(base_path + ['server', server, 'ptp']) # commit changes (expected to fail) with self.assertRaises(ConfigSessionError): self.cli_commit() # add the required top-level option and commit - self.cli_set(base_path + ['ptp-transport']) + self.cli_set(base_path + ['ptp']) self.cli_commit() # Check generated configuration @@ -254,9 +257,9 @@ class TestSystemNTP(VyOSUnitTestSHIM.TestCase): self.assertIn('leapsectz right/UTC', config) for server in servers: - self.assertIn(f'server {server} iburst ' + ' '.join(options) + ' port 319', config) + self.assertIn(f'server {server} iburst ' + ' '.join(options) + f' port {default_ptp_port}', config) - self.assertIn('ptpport 319', config) + self.assertIn(f'ptpport {default_ptp_port}', config) if __name__ == '__main__': unittest.main(verbosity=2) |