diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2023-11-27 18:15:44 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2023-11-27 18:15:45 -0800 |
| commit | 2df6bde352be531b6cde442500899d89fc990c65 (patch) | |
| tree | 69d2b8279d982a681275055421b07c82d363cb1d /tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py | |
| parent | cae0de45c8fd62612e1ee429134fd82c2c0e335e (diff) | |
| parent | ed346fccfc40364888601a2ec75dd94f4dca23bd (diff) | |
Merge branch 'selftests-tc-testing-updates-and-cleanups-for-tdc'
Pedro Tammela says:
====================
selftests: tc-testing: updates and cleanups for tdc
Address the recommendations from the previous series and cleanup some
leftovers.
====================
Link: https://lore.kernel.org/r/20231124154248.315470-1-pctammela@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py')
| -rw-r--r-- | tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py b/tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py index 65c8f3f983b9..bb19b8b76d3b 100644 --- a/tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py +++ b/tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py @@ -23,8 +23,6 @@ class SubPlugin(TdcPlugin): super().__init__() def pre_suite(self, testcount, testlist): - from itertools import cycle - super().pre_suite(testcount, testlist) def prepare_test(self, test): @@ -37,7 +35,7 @@ class SubPlugin(TdcPlugin): if netlink == True: self._nl_ns_create() else: - self._ns_create() + self._ipr2_ns_create() # Make sure the netns is visible in the fs ticks = 20 @@ -71,14 +69,14 @@ class SubPlugin(TdcPlugin): if netlink == True: self._nl_ns_destroy() else: - self._ns_destroy() + self._ipr2_ns_destroy() def post_suite(self, index): if self.args.verbose: print('{}.post_suite'.format(self.sub_class)) # Make sure we don't leak resources - cmd = "$IP -a netns del" + cmd = self._replace_keywords("$IP -a netns del") if self.args.verbose > 3: print('_exec_cmd: command "{}"'.format(cmd)) @@ -161,7 +159,7 @@ class SubPlugin(TdcPlugin): ticks -= 1 continue - def _ns_create_cmds(self): + def _ipr2_ns_create_cmds(self): cmds = [] ns = self.args.NAMES['NS'] @@ -181,26 +179,26 @@ class SubPlugin(TdcPlugin): return cmds - def _ns_create(self): + def _ipr2_ns_create(self): ''' Create the network namespace in which the tests will be run and set up the required network devices for it. ''' - self._exec_cmd_batched('pre', self._ns_create_cmds()) + self._exec_cmd_batched('pre', self._ipr2_ns_create_cmds()) def _nl_ns_destroy(self): ns = self.args.NAMES['NS'] netns.remove(ns) - def _ns_destroy_cmd(self): + def _ipr2_ns_destroy_cmd(self): return self._replace_keywords('netns delete {}'.format(self.args.NAMES['NS'])) - def _ns_destroy(self): + def _ipr2_ns_destroy(self): ''' Destroy the network namespace for testing (and any associated network devices as well) ''' - self._exec_cmd('post', self._ns_destroy_cmd()) + self._exec_cmd('post', self._ipr2_ns_destroy_cmd()) @cached_property def _proc(self): |
