diff options
author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2024-01-09 22:48:55 +0100 |
---|---|---|
committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2024-01-10 00:42:22 +0100 |
commit | 41913f4d1d63ddd39d9125b0140b8a33449c2cfb (patch) | |
tree | 1fb7ff1b452f13cc2af4c6c48d738729dc71e4ef /smoketest/scripts/cli/test_service_dhcp-server.py | |
parent | 39bf15289ca10ff5b61eb4070292ffb13f53e94e (diff) | |
download | vyos-1x-41913f4d1d63ddd39d9125b0140b8a33449c2cfb.tar.gz vyos-1x-41913f4d1d63ddd39d9125b0140b8a33449c2cfb.zip |
dhcp: T5787: Prevent duplicate IP addresses on static mappings
Diffstat (limited to 'smoketest/scripts/cli/test_service_dhcp-server.py')
-rwxr-xr-x | smoketest/scripts/cli/test_service_dhcp-server.py | 7 |
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 ef6191fb1..6f24d40ec 100755 --- a/smoketest/scripts/cli/test_service_dhcp-server.py +++ b/smoketest/scripts/cli/test_service_dhcp-server.py @@ -375,6 +375,13 @@ class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase): self.cli_commit() self.cli_delete(pool + ['static-mapping', 'client1', 'duid']) + # 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() |