Skip to content

Commit 0cef6fc

Browse files
Geliang Tangdavem330
authored andcommitted
selftests: mptcp: ip_mptcp option for more scripts
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]> Reviewed-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c99d57d commit 0cef6fc

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@ ns1=""
2222
ns2=""
2323
ns_sbox=""
2424

25+
usage() {
26+
echo "Usage: $0 [ -i ] [ -h ]"
27+
echo -e "\t-i: use 'ip mptcp' instead of 'pm_nl_ctl'"
28+
echo -e "\t-h: help"
29+
}
30+
31+
while getopts "hi" option;do
32+
case "$option" in
33+
"h")
34+
usage "$0"
35+
exit ${KSFT_PASS}
36+
;;
37+
"i")
38+
mptcp_lib_set_ip_mptcp
39+
;;
40+
"?")
41+
usage "$0"
42+
exit ${KSFT_FAIL}
43+
;;
44+
esac
45+
done
46+
2547
add_mark_rules()
2648
{
2749
local ns=$1

tools/testing/selftests/net/mptcp/pm_netlink.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@
1111
ret=0
1212

1313
usage() {
14-
echo "Usage: $0 [ -h ]"
14+
echo "Usage: $0 [ -i ] [ -h ]"
15+
echo -e "\t-i: use 'ip mptcp' instead of 'pm_nl_ctl'"
16+
echo -e "\t-h: help"
1517
}
1618

17-
optstring=h
19+
optstring=hi
1820
while getopts "$optstring" option;do
1921
case "$option" in
2022
"h")
2123
usage $0
2224
exit ${KSFT_PASS}
2325
;;
26+
"i")
27+
mptcp_lib_set_ip_mptcp
28+
;;
2429
"?")
2530
usage $0
2631
exit ${KSFT_FAIL}

tools/testing/selftests/net/mptcp/simult_flows.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ capout=""
2727
size=0
2828

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

3637
# This function is used in the cleanup trap
@@ -259,7 +260,7 @@ run_test()
259260
fi
260261
}
261262

262-
while getopts "bcdh" option;do
263+
while getopts "bcdhi" option;do
263264
case "$option" in
264265
"h")
265266
usage $0
@@ -274,6 +275,9 @@ while getopts "bcdh" option;do
274275
"d")
275276
set -x
276277
;;
278+
"i")
279+
mptcp_lib_set_ip_mptcp
280+
;;
277281
"?")
278282
usage $0
279283
exit ${KSFT_FAIL}

0 commit comments

Comments
 (0)