diff options
author | Christian Breunig <christian@breunig.cc> | 2024-05-26 14:01:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-26 14:01:52 +0200 |
commit | 4a9befb92550ae9abd5cf687208fdb09838ccc9d (patch) | |
tree | cd4c9f5546473a6868ecffa8fbee57606381c602 /smoketest/scripts | |
parent | 9301c507f91ea40fc0d4d86cf708a7ba6d3b0bb9 (diff) | |
parent | ccd564c2328a086b326957fdde8b07ca560bd6b2 (diff) | |
download | vyos-1x-4a9befb92550ae9abd5cf687208fdb09838ccc9d.tar.gz vyos-1x-4a9befb92550ae9abd5cf687208fdb09838ccc9d.zip |
Merge pull request #3519 from c-po/dhcpv6-T3493
T3493: dhcpv6-server does not have prefix range validation
Diffstat (limited to 'smoketest/scripts')
-rw-r--r-- | smoketest/scripts/cli/base_vyostest_shim.py | 4 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_service_dhcpv6-server.py | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/base_vyostest_shim.py b/smoketest/scripts/cli/base_vyostest_shim.py index c49d3e76c..efaa74fe0 100644 --- a/smoketest/scripts/cli/base_vyostest_shim.py +++ b/smoketest/scripts/cli/base_vyostest_shim.py @@ -1,4 +1,4 @@ -# Copyright (C) 2021-2023 VyOS maintainers and contributors +# Copyright (C) 2021-2024 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -47,6 +47,8 @@ class VyOSUnitTestSHIM: def setUpClass(cls): cls._session = ConfigSession(os.getpid()) cls._session.save_config(save_config) + if os.path.exists('/tmp/vyos.smoketest.debug'): + cls.debug = True pass @classmethod diff --git a/smoketest/scripts/cli/test_service_dhcpv6-server.py b/smoketest/scripts/cli/test_service_dhcpv6-server.py index cb6206632..c07d8509e 100755 --- a/smoketest/scripts/cli/test_service_dhcpv6-server.py +++ b/smoketest/scripts/cli/test_service_dhcpv6-server.py @@ -18,6 +18,7 @@ import unittest from base_vyostest_shim import VyOSUnitTestSHIM +from vyos.configsession import ConfigSessionError from vyos.template import inc_ip from vyos.utils.process import process_named_running from vyos.utils.file import read_file @@ -143,9 +144,14 @@ class TestServiceDHCPv6Server(VyOSUnitTestSHIM.TestCase): pool = base_path + ['shared-network-name', shared_net_name, 'subnet', subnet] self.cli_set(pool + ['address-range', 'start', range_start, 'stop', range_stop]) - self.cli_set(pool + ['prefix-delegation', 'start', delegate_start, 'stop', delegate_stop]) self.cli_set(pool + ['prefix-delegation', 'start', delegate_start, 'prefix-length', delegate_len]) + self.cli_set(pool + ['prefix-delegation', 'start', delegate_start, 'stop', delegate_start]) + # Prefix delegation stop address must be greater then start address + with self.assertRaises(ConfigSessionError): + self.cli_commit() + self.cli_set(pool + ['prefix-delegation', 'start', delegate_start, 'stop', delegate_stop]) + # commit changes self.cli_commit() |