Skip to content

Commit

Permalink
selftests: mptcp: export more vars into mptcp_lib
Browse files Browse the repository at this point in the history
Move the variables 'TEST_NAME' and 'TEST_COUNT', 'ret', 'capture' and
'checksum', 'timeout_poll' and 'timeout_test', 'iptables' and 'ip6tables'
into mptcp_lib.sh as public variables.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
geliangtang authored and intel-lab-lkp committed Nov 8, 2023
1 parent b17521b commit 738e6c4
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 33 deletions.
4 changes: 0 additions & 4 deletions tools/testing/selftests/net/mptcp/diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

mptcp_lib_init_ns
ksft_skip=4
TEST_COUNT=0
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
ret=0

flush_pids()
{
Expand Down
6 changes: 0 additions & 6 deletions tools/testing/selftests/net/mptcp/mptcp_connect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
time_start=$(date +%s)

optstring="S:R:d:e:l:r:h4cm:f:tC"
ret=0
final_ret=0
cin_disconnect=""
ksft_skip=4
capture=false
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
ipv6=true
ethtool_random_on=true
tc_delay="$((RANDOM%50))"
Expand All @@ -22,7 +18,6 @@ sndbuf=0
rcvbuf=0
options_log=true
do_tcp=0
checksum=false
filesize=0
connect_per_transfer=1

Expand Down Expand Up @@ -119,7 +114,6 @@ done

mptcp_lib_init_ns

TEST_COUNT=0
TEST_GROUP=""

cleanup()
Expand Down
9 changes: 0 additions & 9 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@

. "$(dirname "${0}")/mptcp_lib.sh"

ret=0
sinfail=""
cinfail=""
cinsent=""
tmpfile=""
capout=""
ksft_skip=4
iptables="iptables"
ip6tables="ip6tables"
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
capture=false
checksum=false
ip_mptcp=0
check_invert=0
validate_checksum=false
Expand All @@ -37,8 +30,6 @@ declare -A all_tests
declare -a only_tests_ids
declare -a only_tests_names
declare -A failed_tests
TEST_COUNT=0
TEST_NAME=""
nr_blank=6

# These var are used only in some tests, make sure they are not already set
Expand Down
14 changes: 14 additions & 0 deletions tools/testing/selftests/net/mptcp/mptcp_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ readonly AF_INET6=10

MPTCP_LIB_SUBTESTS=()

TEST_NAME=""
TEST_COUNT=0

ret=0

capture=false
checksum=false

readonly timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))

iptables="iptables"
ip6tables="ip6tables"

sin=$(mktemp)
sout=$(mktemp)
cin=$(mktemp)
Expand Down
5 changes: 0 additions & 5 deletions tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@

. "$(dirname "${0}")/mptcp_lib.sh"

ret=0
ksft_skip=4
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
iptables="iptables"
ip6tables="ip6tables"

mptcp_lib_init_ns

Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/net/mptcp/pm_netlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
. "$(dirname "${0}")/mptcp_lib.sh"

ksft_skip=4
ret=0

usage() {
echo "Usage: $0 [ -h ]"
Expand Down
5 changes: 0 additions & 5 deletions tools/testing/selftests/net/mptcp/simult_flows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
. "$(dirname "${0}")/mptcp_lib.sh"

mptcp_lib_init_ns
capture=false
ksft_skip=4
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
TEST_COUNT=0
ret=0
bail=0
slack=50

Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/net/mptcp/userspace_pm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ client_addr_id=${RANDOM:0:2}
server_addr_id=${RANDOM:0:2}

mptcp_lib_init_ns
ret=0
TEST_NAME=""
TEST_COUNT=0

_printf() {
stdbuf -o0 -e0 printf "${@}"
Expand Down

0 comments on commit 738e6c4

Please sign in to comment.