diff options
author | sever-sever <v.gletenko@vyos.io> | 2021-03-02 08:34:13 +0000 |
---|---|---|
committer | sever-sever <v.gletenko@vyos.io> | 2021-03-02 22:48:14 +0000 |
commit | 117533482d29ce0bd1bc7f3a3f2536921c16565c (patch) | |
tree | d89a8b5f10dbba2e8823ac012957dd30e20c3f94 /smoketest/scripts/cli/test_service_dhcpv6-server.py | |
parent | ecd936a0189e7f785929a585cd190cbbf3bc4c1b (diff) | |
download | vyos-1x-117533482d29ce0bd1bc7f3a3f2536921c16565c.tar.gz vyos-1x-117533482d29ce0bd1bc7f3a3f2536921c16565c.zip |
dhcpv6-server: T3379: Add option global-parameters name-server
Diffstat (limited to 'smoketest/scripts/cli/test_service_dhcpv6-server.py')
-rwxr-xr-x | smoketest/scripts/cli/test_service_dhcpv6-server.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_dhcpv6-server.py b/smoketest/scripts/cli/test_service_dhcpv6-server.py index 319891a94..a364eee11 100755 --- a/smoketest/scripts/cli/test_service_dhcpv6-server.py +++ b/smoketest/scripts/cli/test_service_dhcpv6-server.py @@ -151,5 +151,26 @@ class TestServiceDHCPServer(unittest.TestCase): # Check for running process self.assertTrue(process_named_running(PROCESS_NAME)) + def test_global_nameserver(self): + shared_net_name = 'SMOKE-3' + ns_global_1 = '2001:db8::1111' + ns_global_2 = '2001:db8::2222' + + self.session.set(base_path + ['global-parameters', 'name-server', ns_global_1]) + self.session.set(base_path + ['global-parameters', 'name-server', ns_global_2]) + self.session.set(base_path + ['shared-network-name', shared_net_name, 'subnet', subnet]) + + # commit changes + self.session.commit() + + config = read_file(DHCPD_CONF) + self.assertIn(f'option dhcp6.name-servers {ns_global_1};', config) + self.assertIn(f'option dhcp6.name-servers {ns_global_2};', config) + self.assertIn(f'subnet6 {subnet}' + r' {', config) + self.assertIn(f'set shared-networkname = "{shared_net_name}";', config) + + # Check for running process + self.assertTrue(process_named_running(PROCESS_NAME)) + if __name__ == '__main__': unittest.main(verbosity=2) |