diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-05-25 20:19:40 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-05-25 20:19:40 +0200 |
commit | d12f945d24fd9098e69620d84699b61bd7838c99 (patch) | |
tree | 1cf03f4b3ca5ee9630d6e3771277f9f3f94bc3be /smoketest | |
parent | 92dff8f3c724bf00cadd8004f0af9da3d0807aad (diff) | |
download | vyos-1x-d12f945d24fd9098e69620d84699b61bd7838c99.tar.gz vyos-1x-d12f945d24fd9098e69620d84699b61bd7838c99.zip |
smoketest: conntrack: extend tests by parsing iptables rules for nfs/sqlnet
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_system_conntrack.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_system_conntrack.py b/smoketest/scripts/cli/test_system_conntrack.py index 83861c96d..21d626d2f 100755 --- a/smoketest/scripts/cli/test_system_conntrack.py +++ b/smoketest/scripts/cli/test_system_conntrack.py @@ -20,6 +20,7 @@ import unittest from base_vyostest_shim import VyOSUnitTestSHIM from vyos.configsession import ConfigSession +from vyos.util import cmd from vyos.util import read_file base_path = ['system', 'conntrack'] @@ -156,6 +157,8 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase): 'driver' : ['nf_nat_h323', 'nf_conntrack_h323'], }, 'nfs' : { + 'iptables' : ['-A VYATTA_CT_HELPER -p udp -m udp --dport 111 -j CT --helper rpc', + '-A VYATTA_CT_HELPER -p tcp -m tcp --dport 111 -j CT --helper rpc'], }, 'pptp' : { 'driver' : ['nf_nat_pptp', 'nf_conntrack_pptp'], @@ -164,6 +167,9 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase): 'driver' : ['nf_nat_sip', 'nf_conntrack_sip'], }, 'sqlnet' : { + 'iptables' : ['-A VYATTA_CT_HELPER -p tcp -m tcp --dport 1536 -j CT --helper tns', + '-A VYATTA_CT_HELPER -p tcp -m tcp --dport 1525 -j CT --helper tns', + '-A VYATTA_CT_HELPER -p tcp -m tcp --dport 1521 -j CT --helper tns'], }, 'tftp' : { 'driver' : ['nf_nat_tftp', 'nf_conntrack_tftp'], @@ -181,6 +187,10 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase): if 'driver' in module_options: for driver in module_options['driver']: self.assertFalse(os.path.isdir(f'/sys/module/{driver}')) + if 'iptables' in module_options: + rules = cmd('sudo iptables-save -t raw') + for ruleset in module_options['iptables']: + self.assertNotIn(ruleset, rules) # reload modules for module in modules: @@ -194,6 +204,10 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase): if 'driver' in module_options: for driver in module_options['driver']: self.assertTrue(os.path.isdir(f'/sys/module/{driver}')) + if 'iptables' in module_options: + rules = cmd('sudo iptables-save -t raw') + for ruleset in module_options['iptables']: + self.assertIn(ruleset, rules) def test_conntrack_hash_size(self): hash_size = '65536' @@ -221,4 +235,4 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase): self.assertIn(hash_size_default, tmp) if __name__ == '__main__': - unittest.main(verbosity=2, failfast=True) + unittest.main(verbosity=2) |