diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-12-06 15:52:44 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-12-06 15:52:44 +0100 |
commit | ed1a7a51af5da7b87b1073709ec2d10066c9329d (patch) | |
tree | 21ae5eab8dd2ef2fa6fc409c8c9938f2a53bb991 /smoketest/scripts/cli | |
parent | 0fb833ca2b355fb782fee7e808b9872fc3fcf5d7 (diff) | |
download | vyos-1x-ed1a7a51af5da7b87b1073709ec2d10066c9329d.tar.gz vyos-1x-ed1a7a51af5da7b87b1073709ec2d10066c9329d.zip |
smoketest: dhcpv6: T3100: verify prefix-delegation config
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-x | smoketest/scripts/cli/test_service_dhcpv6-server.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_service_dhcpv6-server.py b/smoketest/scripts/cli/test_service_dhcpv6-server.py index 278524585..56fc16d2b 100755 --- a/smoketest/scripts/cli/test_service_dhcpv6-server.py +++ b/smoketest/scripts/cli/test_service_dhcpv6-server.py @@ -48,7 +48,7 @@ class TestServiceDHCPServer(unittest.TestCase): self.session.commit() del self.session - def test_single_pool_range(self): + def test_single_pool(self): shared_net_name = 'SMOKE-1' search_domains = ['foo.vyos.net', 'bar.vyos.net'] lease_time = '1200' @@ -125,5 +125,31 @@ class TestServiceDHCPServer(unittest.TestCase): # Check for running process self.assertTrue(process_named_running(PROCESS_NAME)) + + def test_prefix_delegation(self): + shared_net_name = 'SMOKE-2' + range_start = inc_ip(subnet, 256) # ::100 + range_stop = inc_ip(subnet, 65535) # ::ffff + delegate_start = '2001:db8:ee::' + delegate_stop = '2001:db8:ee:ff00::' + delegate_len = '56' + + pool = base_path + ['shared-network-name', shared_net_name, 'subnet', subnet] + + self.session.set(pool + ['address-range', 'start', range_start, 'stop', range_stop]) + self.session.set(pool + ['prefix-delegation', 'start', delegate_start, 'stop', delegate_stop]) + self.session.set(pool + ['prefix-delegation', 'start', delegate_start, 'prefix-length', delegate_len]) + + # commit changes + self.session.commit() + + config = read_file(DHCPD_CONF) + self.assertIn(f'subnet6 {subnet}' + r' {', config) + self.assertIn(f'range6 {range_start} {range_stop};', config) + self.assertIn(f'prefix6 {delegate_start} {delegate_stop} /{delegate_len};', config) + + # Check for running process + self.assertTrue(process_named_running(PROCESS_NAME)) + if __name__ == '__main__': unittest.main() |