summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_system_conntrack.py
diff options
context:
space:
mode:
authorerkin <e.altunbas@vyos.io>2021-08-15 14:50:50 +0300
committererkin <e.altunbas@vyos.io>2021-08-15 14:50:50 +0300
commit841360a84660974f9b8d97d08780a6a3d9faf3b7 (patch)
tree2a1f6e94cefa123656cf875305f61f4668c1bacc /smoketest/scripts/cli/test_system_conntrack.py
parent6f87d8c910964fd0ebe9724183baa12861caa419 (diff)
downloadvyos-1x-841360a84660974f9b8d97d08780a6a3d9faf3b7.tar.gz
vyos-1x-841360a84660974f9b8d97d08780a6a3d9faf3b7.zip
smoketest: conntrack: Update smoketests for new conntrack modules syntax
Diffstat (limited to 'smoketest/scripts/cli/test_system_conntrack.py')
-rwxr-xr-xsmoketest/scripts/cli/test_system_conntrack.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/smoketest/scripts/cli/test_system_conntrack.py b/smoketest/scripts/cli/test_system_conntrack.py
index 21d626d2f..d659bfb65 100755
--- a/smoketest/scripts/cli/test_system_conntrack.py
+++ b/smoketest/scripts/cli/test_system_conntrack.py
@@ -148,7 +148,7 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase):
def test_conntrack_module_disable(self):
- # Some features are disabled by onloading the kernel helper module(s)
+ # conntrack helper modules are disabled by default
modules = {
'ftp' : {
'driver' : ['nf_nat_ftp', 'nf_conntrack_ftp'],
@@ -176,38 +176,39 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase):
},
}
+ # load modules
for module in modules:
- self.cli_set(base_path + ['modules', module, 'disable'])
+ self.cli_set(base_path + ['modules', module])
# commit changes
self.cli_commit()
- # verify modules are no longer loaded on the system
+ # verify modules are loaded on the system
for module, module_options in modules.items():
if 'driver' in module_options:
for driver in module_options['driver']:
- self.assertFalse(os.path.isdir(f'/sys/module/{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.assertNotIn(ruleset, rules)
+ self.assertIn(ruleset, rules)
- # reload modules
+ # unload modules
for module in modules:
- self.cli_delete(base_path + ['modules', module, 'disable'])
+ self.cli_delete(base_path + ['modules', module])
# commit changes
self.cli_commit()
- # verify modules are again loaded on the system
+ # verify modules are not loaded on the system
for module, module_options in modules.items():
if 'driver' in module_options:
for driver in module_options['driver']:
- self.assertTrue(os.path.isdir(f'/sys/module/{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.assertIn(ruleset, rules)
+ self.assertNotIn(ruleset, rules)
def test_conntrack_hash_size(self):
hash_size = '65536'