diff options
author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-01-04 01:04:54 +0100 |
---|---|---|
committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-01-04 01:05:13 +0100 |
commit | 9213d9cc7bcd731baaf606fcdc956764482f45e9 (patch) | |
tree | 1efe4920889649083438064c4c0fc889a86c542a /smoketest | |
parent | 84a83ecc4c78bf2e0954658ea539e42b4c015fa2 (diff) | |
download | vyos-1x-9213d9cc7bcd731baaf606fcdc956764482f45e9.tar.gz vyos-1x-9213d9cc7bcd731baaf606fcdc956764482f45e9.zip |
firewall: T4130: Add state-policy test to firewall smoketest
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_firewall.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_firewall.py b/smoketest/scripts/cli/test_firewall.py index 1520020fd..5f728f0cd 100755 --- a/smoketest/scripts/cli/test_firewall.py +++ b/smoketest/scripts/cli/test_firewall.py @@ -134,6 +134,23 @@ class TestFirewall(VyOSUnitTestSHIM.TestCase): break self.assertTrue(matched) + def test_state_policy(self): + self.cli_set(['firewall', 'state-policy', 'established', 'action', 'accept']) + self.cli_set(['firewall', 'state-policy', 'related', 'action', 'accept']) + self.cli_set(['firewall', 'state-policy', 'invalid', 'action', 'drop']) + + self.cli_commit() + + chains = { + 'ip filter': ['VYOS_FW_IN', 'VYOS_FW_OUTPUT', 'VYOS_FW_LOCAL'], + 'ip6 filter': ['VYOS_FW6_IN', 'VYOS_FW6_OUTPUT', 'VYOS_FW6_LOCAL'] + } + + for table in ['ip filter', 'ip6 filter']: + for chain in chains[table]: + nftables_output = cmd(f'sudo nft list chain {table} {chain}') + self.assertTrue('jump VYOS_STATE_POLICY' in nftables_output) + def test_sysfs(self): for name, conf in sysfs_config.items(): paths = glob(conf['sysfs']) |