summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-06-18 16:19:54 +0200
committerGitHub <noreply@github.com>2026-06-18 16:19:54 +0200
commit5566e3392db808839dd93a035b21b6f13a551da5 (patch)
tree7e5afb490c497034367c894e59749ef498a92e85 /smoketest/scripts/cli
parente64100195d16744db173d3217e6ec1e596c34ff1 (diff)
parent6525f3924cf7ee529e87597e0f48f4b89370a14d (diff)
downloadvyos-1x-5566e3392db808839dd93a035b21b6f13a551da5.tar.gz
vyos-1x-5566e3392db808839dd93a035b21b6f13a551da5.zip
Merge pull request #5279 from sarthurdev/T8546
firewall: T8546: Fix conntrack_required for global state-policy
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py31
1 files changed, 19 insertions, 12 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index 49496707f..62469a944 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -662,9 +662,6 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
for chain, rule in nftables_rules.items():
self.verify_nftables_chain(rule, 'inet vrf_zones', chain, inverse=True)
- # conntrack is only enabled once NAT, NAT66 or firewalling is enabled
- self.cli_set(['nat'])
-
for vrf in vrfs:
base = base_path + ['name', vrf]
self.cli_set(base + ['table', table])
@@ -672,17 +669,27 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
# We need the commit inside the loop to trigger the bug in T6603
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)
+ check_paths = [
+ ['nat'],
+ ['firewall', 'global-options', 'state-policy', 'established', 'action', 'accept']
+ ]
+
+ # conntrack is only enabled once NAT, NAT66 or firewalling is enabled
+ for path in check_paths:
+ self.cli_set(path)
+ 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)
- # T6603: there should be only ONE entry for the iifname/oifname in the chains
- tmp = loads(cmd('sudo nft -j list table inet vrf_zones'))
- num_rules = len(search("nftables[].rule[].chain", tmp))
- # ['vrf_zones_ct_in', 'vrf_zones_ct_out']
- self.assertEqual(num_rules, 2)
+ # T6603: there should be only ONE entry for the iifname/oifname in the chains
+ tmp = loads(cmd('sudo nft -j list table inet vrf_zones'))
+ num_rules = len(search("nftables[].rule[].chain", tmp))
+ # ['vrf_zones_ct_in', 'vrf_zones_ct_out']
+ self.assertEqual(num_rules, 2)
- self.cli_delete(['nat'])
+ self.cli_delete([path[0]])
def test_vrf_policy_based_route(self):
vrf_name = 'test-pbr_123'