summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_vrf.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-28 20:35:32 +0100
committerGitHub <noreply@github.com>2024-02-28 20:35:32 +0100
commitfc96c0150eb632e016d7f2ba8adf32a9940c1e8c (patch)
treee41c55228643fac1694d87d24183381d45ef4f38 /smoketest/scripts/cli/test_vrf.py
parente1644d96a613d02db8cc21ccac6226b53568c5b0 (diff)
parent6f7d1e15665655e37e8ca830e28d9650445c1217 (diff)
downloadvyos-1x-fc96c0150eb632e016d7f2ba8adf32a9940c1e8c.tar.gz
vyos-1x-fc96c0150eb632e016d7f2ba8adf32a9940c1e8c.zip
Merge pull request #3055 from sarthurdev/T6073
vrf: conntrack: T6073: Populate VRF zoning chains only while conntrack is required
Diffstat (limited to 'smoketest/scripts/cli/test_vrf.py')
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index 438387f2d..c96b8e374 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -529,5 +529,28 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
self.assertNotIn(f' no ip nht resolve-via-default', frrconfig)
self.assertNotIn(f' no ipv6 nht resolve-via-default', frrconfig)
+ def test_vrf_conntrack(self):
+ table = '1000'
+ nftables_rules = {
+ 'vrf_zones_ct_in': ['ct original zone set iifname map @ct_iface_map'],
+ 'vrf_zones_ct_out': ['ct original zone set oifname map @ct_iface_map']
+ }
+
+ self.cli_set(base_path + ['name', 'blue', 'table', table])
+ self.cli_commit()
+
+ # Conntrack rules should not be present
+ for chain, rule in nftables_rules.items():
+ self.verify_nftables_chain(rule, 'inet vrf_zones', chain, inverse=True)
+
+ self.cli_set(['nat'])
+ self.cli_commit()
+
+ # Conntrack rules should now be present
+ for chain, rule in nftables_rules.items():
+ self.verify_nftables_chain(rule, 'inet vrf_zones', chain, inverse=False)
+
+ self.cli_delete(['nat'])
+
if __name__ == '__main__':
unittest.main(verbosity=2)