Skip to content

Commit

Permalink
selftests: tc-testing: prefix iproute2 functions with "ipr2"
Browse files Browse the repository at this point in the history
As suggested by Simon, prefix the functions that operate on iproute2
commands in contrast with the "nl" netlink prefix.

Cc: Simon Horman <horms@kernel.org>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20231124154248.315470-4-pctammela@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Pedro Tammela authored and Jakub Kicinski committed Nov 28, 2023
1 parent 8059e68 commit 56e16bc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def prepare_test(self, test):
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
Expand Down Expand Up @@ -71,7 +71,7 @@ def post_case(self):
if netlink == True:
self._nl_ns_destroy()
else:
self._ns_destroy()
self._ipr2_ns_destroy()

def post_suite(self, index):
if self.args.verbose:
Expand Down Expand Up @@ -161,7 +161,7 @@ def _nl_ns_create(self):
ticks -= 1
continue

def _ns_create_cmds(self):
def _ipr2_ns_create_cmds(self):
cmds = []

ns = self.args.NAMES['NS']
Expand All @@ -181,26 +181,26 @@ def _ns_create_cmds(self):

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):
Expand Down

0 comments on commit 56e16bc

Please sign in to comment.