summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_dhcp-server.py
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2024-01-09 22:48:55 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2024-01-10 22:16:21 +0100
commitb68def8d50688eb429328892437647860f9fc6c1 (patch)
treec5035a78c9f0a436b932c43e2ad3bd0df4191733 /smoketest/scripts/cli/test_service_dhcp-server.py
parent348892a97be2c2dfb810422fb94fe4eabe5d6a42 (diff)
downloadvyos-1x-b68def8d50688eb429328892437647860f9fc6c1.tar.gz
vyos-1x-b68def8d50688eb429328892437647860f9fc6c1.zip
dhcp: T5787: Prevent duplicate IP addresses on static mappings
Diffstat (limited to 'smoketest/scripts/cli/test_service_dhcp-server.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_dhcp-server.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_dhcp-server.py b/smoketest/scripts/cli/test_service_dhcp-server.py
index 093e43494..91ae901cd 100755
--- a/smoketest/scripts/cli/test_service_dhcp-server.py
+++ b/smoketest/scripts/cli/test_service_dhcp-server.py
@@ -202,6 +202,13 @@ class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase):
self.cli_set(pool + ['static-mapping', client, 'ip-address', inc_ip(subnet, client_base)])
client_base += 1
+ # cannot have mappings with duplicate IP addresses
+ with self.assertRaises(ConfigSessionError):
+ self.cli_set(pool + ['static-mapping', 'dupe1', 'mac', '00:50:00:00:00:01'])
+ self.cli_set(pool + ['static-mapping', 'dupe1', 'ip-address', inc_ip(subnet, 10)])
+ self.cli_commit()
+ self.cli_delete(pool + ['static-mapping', 'dupe1'])
+
# commit changes
self.cli_commit()