diff options
author | Christian Breunig <christian@breunig.cc> | 2023-12-15 18:37:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-15 18:37:04 +0100 |
commit | af2668c4479377063c2e65e2383648155fb1e8f4 (patch) | |
tree | 1a0d5907bd585da4000b37bd7026a84fc073c356 /smoketest | |
parent | 5f11abd7b80c03390e7d60fa887b64a8d84e2283 (diff) | |
parent | 87d78c75ce2c4c69f0c4086e76119628fcf8ddc6 (diff) | |
download | vyos-1x-af2668c4479377063c2e65e2383648155fb1e8f4.tar.gz vyos-1x-af2668c4479377063c2e65e2383648155fb1e8f4.zip |
Merge pull request #2641 from GurliGebis/T4502-sagitta-backport
firewall: T4502: add offload to firewall table actions (backport #2638)
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_firewall.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_firewall.py b/smoketest/scripts/cli/test_firewall.py index 18940c04d..85b2fbbc7 100755 --- a/smoketest/scripts/cli/test_firewall.py +++ b/smoketest/scripts/cli/test_firewall.py @@ -691,5 +691,41 @@ class TestFirewall(VyOSUnitTestSHIM.TestCase): #self.verify_nftables_chain([['accept']], 'ip vyos_conntrack', 'FW_CONNTRACK') #self.verify_nftables_chain([['accept']], 'ip6 vyos_conntrack', 'FW_CONNTRACK') + def test_zone_flow_offload(self): + self.cli_set(['firewall', 'flowtable', 'smoketest', 'interface', 'eth0']) + self.cli_set(['firewall', 'flowtable', 'smoketest', 'offload', 'hardware']) + + # QEMU virtual NIC does not support hw-tc-offload + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + self.cli_set(['firewall', 'flowtable', 'smoketest', 'offload', 'software']) + + self.cli_set(['firewall', 'ipv4', 'name', 'smoketest', 'rule', '1', 'action', 'offload']) + self.cli_set(['firewall', 'ipv4', 'name', 'smoketest', 'rule', '1', 'offload-target', 'smoketest']) + + self.cli_set(['firewall', 'ipv6', 'name', 'smoketest', 'rule', '1', 'action', 'offload']) + self.cli_set(['firewall', 'ipv6', 'name', 'smoketest', 'rule', '1', 'offload-target', 'smoketest']) + + self.cli_commit() + + nftables_search = [ + ['chain NAME_smoketest'], + ['flow add @VYOS_FLOWTABLE_smoketest'] + ] + + self.verify_nftables(nftables_search, 'ip vyos_filter') + + nftables_search = [ + ['chain NAME6_smoketest'], + ['flow add @VYOS_FLOWTABLE_smoketest'] + ] + + self.verify_nftables(nftables_search, 'ip6 vyos_filter') + + # Check conntrack + #self.verify_nftables_chain([['accept']], 'ip vyos_conntrack', 'FW_CONNTRACK') + #self.verify_nftables_chain([['accept']], 'ip6 vyos_conntrack', 'FW_CONNTRACK') + if __name__ == '__main__': unittest.main(verbosity=2) |