Skip to content

Commit

Permalink
selftests: mptcp: ip_mptcp option for more scripts
Browse files Browse the repository at this point in the history
This patch adds '-i' option for mptcp_sockopt.sh, pm_netlink.sh, and
simult_flows.sh, to use 'ip mptcp' command in the tests instead of
'pm_nl_ctl'. Update usage() correspondingly.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Mar 17, 2024
1 parent 3ca7285 commit 692bacf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
22 changes: 22 additions & 0 deletions tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ ns1=""
ns2=""
ns_sbox=""

usage() {
echo "Usage: $0 [ -i ] [ -h ]"
echo -e "\t-i: use 'ip mptcp' instead of 'pm_nl_ctl'"
echo -e "\t-h: help"
}

while getopts "hi" option;do
case "$option" in
"h")
usage "$0"
exit ${KSFT_PASS}
;;
"i")
mptcp_lib_set_ip_mptcp
;;
"?")
usage "$0"
exit ${KSFT_FAIL}
;;
esac
done

add_mark_rules()
{
local ns=$1
Expand Down
9 changes: 7 additions & 2 deletions tools/testing/selftests/net/mptcp/pm_netlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@
ret=0

usage() {
echo "Usage: $0 [ -h ]"
echo "Usage: $0 [ -i ] [ -h ]"
echo -e "\t-i: use 'ip mptcp' instead of 'pm_nl_ctl'"
echo -e "\t-h: help"
}

optstring=h
optstring=hi
while getopts "$optstring" option;do
case "$option" in
"h")
usage $0
exit ${KSFT_PASS}
;;
"i")
mptcp_lib_set_ip_mptcp
;;
"?")
usage $0
exit ${KSFT_FAIL}
Expand Down
8 changes: 6 additions & 2 deletions tools/testing/selftests/net/mptcp/simult_flows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ capout=""
size=0

usage() {
echo "Usage: $0 [ -b ] [ -c ] [ -d ]"
echo "Usage: $0 [ -b ] [ -c ] [ -d ] [ -i]"
echo -e "\t-b: bail out after first error, otherwise runs al testcases"
echo -e "\t-c: capture packets for each test using tcpdump (default: no capture)"
echo -e "\t-d: debug this script"
echo -e "\t-i: use 'ip mptcp' instead of 'pm_nl_ctl'"
}

# This function is used in the cleanup trap
Expand Down Expand Up @@ -259,7 +260,7 @@ run_test()
fi
}

while getopts "bcdh" option;do
while getopts "bcdhi" option;do
case "$option" in
"h")
usage $0
Expand All @@ -274,6 +275,9 @@ while getopts "bcdh" option;do
"d")
set -x
;;
"i")
mptcp_lib_set_ip_mptcp
;;
"?")
usage $0
exit ${KSFT_FAIL}
Expand Down

0 comments on commit 692bacf

Please sign in to comment.