Skip to content

Commit

Permalink
selftests: mptcp: uniform 'rndh' variable
Browse files Browse the repository at this point in the history
The definition of 'rndh' was probably copied from one script to another
but some times, 'sec' was not defined, not used and/or not spelled
properly.

Here all the 'rndh' are now defined the same way.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Matthieu Baerts authored and Jakub Kicinski committed Dec 2, 2022
1 parent b71dd70 commit 787eb1e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/net/mptcp/diag.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

sec=$(date +%s)
rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
ns="ns1-$rndh"
ksft_skip=4
Expand Down
3 changes: 1 addition & 2 deletions tools/testing/selftests/net/mptcp/mptcp_connect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ check_transfer()

check_mptcp_disabled()
{
local disabled_ns
disabled_ns="ns_disabled-$sech-$(mktemp -u XXXXXX)"
local disabled_ns="ns_disabled-$rndh"
ip netns add ${disabled_ns} || exit $ksft_skip

# net.mptcp.enabled should be enabled by default
Expand Down
5 changes: 3 additions & 2 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ init_partial()
{
capout=$(mktemp)

local rndh
rndh=$(mktemp -u XXXXXX)
local sec rndh
sec=$(date +%s)
rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)

ns1="ns1-$rndh"
ns2="ns2-$rndh"
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ add_mark_rules()

init()
{
local sec rndh
sec=$(date +%s)
rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)

ns1="ns1-$rndh"
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/net/mptcp/simult_flows.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

sec=$(date +%s)
rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
ns1="ns1-$rndh"
ns2="ns2-$rndh"
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/mptcp/userspace_pm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ client_addr_id=${RANDOM:0:2}
server_addr_id=${RANDOM:0:2}

sec=$(date +%s)
rndh=$(stdbuf -o0 -e0 printf %x "$sec")-$(mktemp -u XXXXXX)
rndh=$(printf %x "$sec")-$(mktemp -u XXXXXX)
ns1="ns1-$rndh"
ns2="ns2-$rndh"

Expand Down

0 comments on commit 787eb1e

Please sign in to comment.