summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-10 19:09:36 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-10 19:09:36 +0100
commitdf82e621e3daa3e545a5258418134303a3dd2f89 (patch)
treebb73553de0d1f9ee3a715fb5dbce8a5eacd2c358 /src
parent161c6573d0846e13989c53b2a4778b96bb583fe3 (diff)
downloadvyos-1x-df82e621e3daa3e545a5258418134303a3dd2f89.tar.gz
vyos-1x-df82e621e3daa3e545a5258418134303a3dd2f89.zip
test: vyos.validate: check is_addr_assigned()
Diffstat (limited to 'src')
-rw-r--r--src/tests/test_validate.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tests/test_validate.py b/src/tests/test_validate.py
index 226e856a3..b43dbd97e 100644
--- a/src/tests/test_validate.py
+++ b/src/tests/test_validate.py
@@ -21,6 +21,11 @@ class TestVyOSValidate(TestCase):
def setUp(self):
pass
+ def test_is_addr_assigned(self):
+ self.assertTrue(vyos.validate.is_addr_assigned('127.0.0.1'))
+ self.assertTrue(vyos.validate.is_addr_assigned('::1'))
+ self.assertFalse(vyos.validate.is_addr_assigned('127.251.255.123'))
+
def test_is_ipv6_link_local(self):
self.assertFalse(vyos.validate.is_ipv6_link_local('169.254.0.1'))
self.assertTrue(vyos.validate.is_ipv6_link_local('fe80::'))