summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2025-10-11 20:59:14 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2025-10-17 01:03:10 +0200
commitdd3918ae34a2fb60893874a9141016ee5b5f32c0 (patch)
tree6c9f421277365cf742c194cde7ea4b52627cb4e6 /smoketest/scripts/cli
parent69a9b93f71c818bf134ea06ad73d86a513628f06 (diff)
downloadvyos-1x-dd3918ae34a2fb60893874a9141016ee5b5f32c0.tar.gz
vyos-1x-dd3918ae34a2fb60893874a9141016ee5b5f32c0.zip
kea: T7925: Improve error handling, validate IPv6 PD prefix length
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_service_dhcpv6-server.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_service_dhcpv6-server.py b/smoketest/scripts/cli/test_service_dhcpv6-server.py
index 5e0dd7cc2..769c799b2 100755
--- a/smoketest/scripts/cli/test_service_dhcpv6-server.py
+++ b/smoketest/scripts/cli/test_service_dhcpv6-server.py
@@ -221,6 +221,7 @@ class TestServiceDHCPv6Server(VyOSUnitTestSHIM.TestCase):
range_stop = inc_ip(subnet, 65535) # ::ffff
delegate_start = '2001:db8:ee::'
delegate_len = '64'
+ bad_prefix_len = '32'
prefix_len = '56'
exclude_len = '66'
@@ -229,11 +230,15 @@ class TestServiceDHCPv6Server(VyOSUnitTestSHIM.TestCase):
self.cli_set(pool + ['range', '1', 'start', range_start])
self.cli_set(pool + ['range', '1', 'stop', range_stop])
self.cli_set(pool + ['prefix-delegation', 'prefix', delegate_start, 'delegated-length', delegate_len])
- self.cli_set(pool + ['prefix-delegation', 'prefix', delegate_start, 'prefix-length', prefix_len])
+ self.cli_set(pool + ['prefix-delegation', 'prefix', delegate_start, 'prefix-length', bad_prefix_len])
self.cli_set(pool + ['prefix-delegation', 'prefix', delegate_start, 'excluded-prefix', delegate_start])
self.cli_set(pool + ['prefix-delegation', 'prefix', delegate_start, 'excluded-prefix-length', exclude_len])
# commit changes
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+
+ self.cli_set(pool + ['prefix-delegation', 'prefix', delegate_start, 'prefix-length', prefix_len])
self.cli_commit()
config = read_file(KEA6_CONF)