diff options
author | Lucas Christian <lucas@lucasec.com> | 2024-08-08 23:36:09 -0700 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-09-21 08:51:28 +0200 |
commit | bf5805c52b7133ec76edeebac33f3c30b56b169f (patch) | |
tree | 23a9aebfa768dd604762c8e5ba16f8e72755190b /smoketest/scripts | |
parent | e504e0cac55725e93f21322877bb7d0c4f97c992 (diff) | |
download | vyos-1x-bf5805c52b7133ec76edeebac33f3c30b56b169f.tar.gz vyos-1x-bf5805c52b7133ec76edeebac33f3c30b56b169f.zip |
T6630: ntp: add hardware timestamp offload
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_service_ntp.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_ntp.py b/smoketest/scripts/cli/test_service_ntp.py index fe6b1a529..644894914 100755 --- a/smoketest/scripts/cli/test_service_ntp.py +++ b/smoketest/scripts/cli/test_service_ntp.py @@ -194,5 +194,35 @@ class TestSystemNTP(VyOSUnitTestSHIM.TestCase): for server in servers: self.assertIn(f'server {server} iburst ' + ' '.join(options) + ' xleave', config) + def test_offload_timestamp_default(self): + # Test offloading of NIC timestamp + servers = ['192.0.2.1', '192.0.2.2'] + options = ['prefer'] + + for server in servers: + for option in options: + self.cli_set(base_path + ['server', server, option]) + + self.cli_set(base_path + ['offload', 'timestamp', 'default-enable']) + + # commit changes + self.cli_commit() + + # Check generated configuration + # this file must be read with higher permissions + config = cmd(f'sudo cat {NTP_CONF}') + self.assertIn('driftfile /run/chrony/drift', config) + self.assertIn('dumpdir /run/chrony', config) + self.assertIn('ntsdumpdir /run/chrony', config) + self.assertIn('clientloglimit 1048576', config) + self.assertIn('rtcsync', config) + self.assertIn('makestep 1.0 3', config) + self.assertIn('leapsectz right/UTC', config) + + for server in servers: + self.assertIn(f'server {server} iburst ' + ' '.join(options), config) + + self.assertIn('hwtimestamp *', config) + if __name__ == '__main__': unittest.main(verbosity=2) |