diff options
| author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2026-06-17 11:04:18 +0200 |
|---|---|---|
| committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2026-06-17 13:28:38 +0200 |
| commit | 6525f3924cf7ee529e87597e0f48f4b89370a14d (patch) | |
| tree | 0ae4acf0fba9a92753cf64b7f350d5523d9c2c86 /smoketest/scripts/cli | |
| parent | 88dfc8cd43521ae489900fb9746c56545140df54 (diff) | |
| download | vyos-1x-6525f3924cf7ee529e87597e0f48f4b89370a14d.tar.gz vyos-1x-6525f3924cf7ee529e87597e0f48f4b89370a14d.zip | |
firewall: T8546: Fix conntrack_required for global state-policy
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_vrf.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py index 902308b9b..458c5f3dd 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' |
