summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_system_ipv6.py
diff options
context:
space:
mode:
authorgoodNETnick <33053932+goodNETnick@users.noreply.github.com>2022-04-01 12:09:56 +1000
committergoodNETnick <pknet@ya.ru>2022-04-09 01:33:25 -0400
commit1da9cc02d7c83898c267070618e2cc91e16eb1cf (patch)
treebfe672212ef22b525420428d3f36ff02d6cd5aa0 /smoketest/scripts/cli/test_system_ipv6.py
parentaa5b35b68c1170bfd0b9661bafa72bb10fe6ca95 (diff)
parent53e20097d227ebf4bdb4dc6c85427ec9c5ec3982 (diff)
downloadvyos-1x-1da9cc02d7c83898c267070618e2cc91e16eb1cf.tar.gz
vyos-1x-1da9cc02d7c83898c267070618e2cc91e16eb1cf.zip
ocserv: T4231: Added OTP support for Openconnect 2FA
Diffstat (limited to 'smoketest/scripts/cli/test_system_ipv6.py')
-rwxr-xr-xsmoketest/scripts/cli/test_system_ipv6.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_system_ipv6.py b/smoketest/scripts/cli/test_system_ipv6.py
index 3112d2e46..837d1dc12 100755
--- a/smoketest/scripts/cli/test_system_ipv6.py
+++ b/smoketest/scripts/cli/test_system_ipv6.py
@@ -17,7 +17,12 @@
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.util import get_interface_config
+from vyos.validate import is_intf_addr_assigned
base_path = ['system', 'ipv6']
@@ -42,6 +47,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 +62,24 @@ 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))
+
+ # T4330: Verify MTU can be changed with IPv6 disabled
+ mtu = '1600'
+ eth_if = 'eth0'
+ self.cli_set(['interfaces', 'ethernet', eth_if, 'mtu', mtu])
+ self.cli_commit()
+
+ tmp = get_interface_config(eth_if)
+ self.assertEqual(tmp['mtu'], int(mtu))
+
+ self.cli_delete(['interfaces', 'ethernet', eth_if, 'mtu'])
def test_system_ipv6_strict_dad(self):
# This defaults to 1