summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_system_ipv6.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-03-31 21:21:39 +0200
committerGitHub <noreply@github.com>2022-03-31 21:21:39 +0200
commit86168af4b95c64452e3f049e4f4c15cbaf55caff (patch)
tree5309ccac8b067407b49e89499a3768580bb936b0 /smoketest/scripts/cli/test_system_ipv6.py
parent77f9fc8e9358d5e1d3bbf700b31865e4dc266491 (diff)
parenta33b737b753843501c86eee744aef75137d2b64e (diff)
downloadvyos-1x-86168af4b95c64452e3f049e4f4c15cbaf55caff.tar.gz
vyos-1x-86168af4b95c64452e3f049e4f4c15cbaf55caff.zip
Merge pull request #1258 from c-po/t4319-disable-ipv6
T4319: bugfixes for disabled IPv6 (current)
Diffstat (limited to 'smoketest/scripts/cli/test_system_ipv6.py')
-rwxr-xr-xsmoketest/scripts/cli/test_system_ipv6.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_system_ipv6.py b/smoketest/scripts/cli/test_system_ipv6.py
index 3112d2e46..6fe58701b 100755
--- a/smoketest/scripts/cli/test_system_ipv6.py
+++ b/smoketest/scripts/cli/test_system_ipv6.py
@@ -17,7 +17,11 @@
import unittest
from base_vyostest_shim import VyOSUnitTestSHIM
+
+from vyos.template import is_ipv4
from vyos.util import read_file
+from vyos.util import is_ipv6_enabled
+from vyos.validate import is_intf_addr_assigned
base_path = ['system', 'ipv6']
@@ -42,6 +46,14 @@ class TestSystemIPv6(VyOSUnitTestSHIM.TestCase):
self.assertEqual(read_file(file_forwarding), '0')
def test_system_ipv6_disable(self):
+ # Verify previous "enable" state
+ self.assertEqual(read_file(file_disable), '0')
+ self.assertTrue(is_ipv6_enabled())
+
+ loopbacks = ['127.0.0.1', '::1']
+ for addr in loopbacks:
+ self.assertTrue(is_intf_addr_assigned('lo', addr))
+
# Do not assign any IPv6 address on interfaces, this requires a reboot
# which can not be tested, but we can read the config file :)
self.cli_set(base_path + ['disable'])
@@ -49,6 +61,13 @@ class TestSystemIPv6(VyOSUnitTestSHIM.TestCase):
# Verify configuration file
self.assertEqual(read_file(file_disable), '1')
+ self.assertFalse(is_ipv6_enabled())
+
+ for addr in loopbacks:
+ if is_ipv4(addr):
+ self.assertTrue(is_intf_addr_assigned('lo', addr))
+ else:
+ self.assertFalse(is_intf_addr_assigned('lo', addr))
def test_system_ipv6_strict_dad(self):
# This defaults to 1