From 0bb7a7d32b6182064acf3203050464f22815ef5d Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 1 Nov 2020 13:44:55 +0100 Subject: test: extend validate testcases Test additional network combinations of address and prefixes. --- src/tests/test_validate.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/tests/test_validate.py') diff --git a/src/tests/test_validate.py b/src/tests/test_validate.py index 5e2c751ca..e9fe185ed 100644 --- a/src/tests/test_validate.py +++ b/src/tests/test_validate.py @@ -28,12 +28,20 @@ class TestVyOSValidate(TestCase): def test_is_ipv4(self): self.assertTrue(vyos.validate.is_ipv4('192.0.2.1')) + self.assertTrue(vyos.validate.is_ipv4('192.0.2.0/24')) + self.assertTrue(vyos.validate.is_ipv4('192.0.2.1/32')) + self.assertFalse(vyos.validate.is_ipv4('2001:db8::1')) + self.assertFalse(vyos.validate.is_ipv4('2001:db8::/64')) self.assertFalse(vyos.validate.is_ipv4('VyOS')) def test_is_ipv6(self): self.assertFalse(vyos.validate.is_ipv6('192.0.2.1')) + self.assertFalse(vyos.validate.is_ipv6('192.0.2.0/24')) + self.assertFalse(vyos.validate.is_ipv6('192.0.2.1/32')) self.assertTrue(vyos.validate.is_ipv6('2001:db8::1')) + self.assertTrue(vyos.validate.is_ipv6('2001:db8::/64')) + self.assertTrue(vyos.validate.is_ipv6('2001:db8::1/64')) self.assertFalse(vyos.validate.is_ipv6('VyOS')) def test_is_ipv6_link_local(self): -- cgit v1.2.3