summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_vrf.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-20 12:39:42 +0200
committerChristian Poessinger <christian@poessinger.com>2021-06-20 12:39:42 +0200
commit63a094b339296d97ecf3b87eac8d1d3ce8fadd3a (patch)
treefa2d262b8e5754a4f55d2a7c1c0d87992da60073 /smoketest/scripts/cli/test_vrf.py
parent96bc3a088c32bb26a3eeb3c4f246cbecc97fbc98 (diff)
downloadvyos-1x-63a094b339296d97ecf3b87eac8d1d3ce8fadd3a.tar.gz
vyos-1x-63a094b339296d97ecf3b87eac8d1d3ce8fadd3a.zip
smoketest: T3637: add testcase for vrf bind-to-all option
Diffstat (limited to 'smoketest/scripts/cli/test_vrf.py')
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index 591630c46..f36d16344 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -119,6 +119,24 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
self.assertTrue(is_intf_addr_assigned(vrf, '127.0.0.1'))
self.assertTrue(is_intf_addr_assigned(vrf, '::1'))
+ def test_vrf_bind_all(self):
+ table = '2000'
+ for vrf in vrfs:
+ base = base_path + ['name', vrf]
+ self.cli_set(base + ['table', str(table)])
+ table = str(int(table) + 1)
+
+ self.cli_set(base_path + ['bind-to-all'])
+
+ # commit changes
+ self.cli_commit()
+
+ # Verify VRF configuration
+ tmp = read_file('/proc/sys/net/ipv4/tcp_l3mdev_accept')
+ self.assertIn(tmp, '1')
+ tmp = read_file('/proc/sys/net/ipv4/udp_l3mdev_accept')
+ self.assertIn(tmp, '1')
+
def test_vrf_table_id_is_unalterable(self):
# Linux Kernel prohibits the change of a VRF table on the fly.
# VRF must be deleted and recreated!