diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-15 15:29:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-15 15:29:14 +0200 |
commit | c244c2e99519f9b453adf9a61d03488b09cb3ca2 (patch) | |
tree | e3bfc253a6cd89b2cd7b98b26098e0bd239ea0cb /smoketest/scripts/cli | |
parent | 555513691f79db537a8c7430e87e846e8607ef5e (diff) | |
parent | 841360a84660974f9b8d97d08780a6a3d9faf3b7 (diff) | |
download | vyos-1x-c244c2e99519f9b453adf9a61d03488b09cb3ca2.tar.gz vyos-1x-c244c2e99519f9b453adf9a61d03488b09cb3ca2.zip |
Merge pull request #972 from erkin/current
smoketest: conntrack: Update smoketests for new conntrack modules syntax
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-x | smoketest/scripts/cli/test_system_conntrack.py | 21 |
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' |