Commit 0cef6fca authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

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: default avatarGeliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c99d57d0
...@@ -22,6 +22,28 @@ ns1="" ...@@ -22,6 +22,28 @@ ns1=""
ns2="" ns2=""
ns_sbox="" 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() add_mark_rules()
{ {
local ns=$1 local ns=$1
......
...@@ -11,16 +11,21 @@ ...@@ -11,16 +11,21 @@
ret=0 ret=0
usage() { 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 while getopts "$optstring" option;do
case "$option" in case "$option" in
"h") "h")
usage $0 usage $0
exit ${KSFT_PASS} exit ${KSFT_PASS}
;; ;;
"i")
mptcp_lib_set_ip_mptcp
;;
"?") "?")
usage $0 usage $0
exit ${KSFT_FAIL} exit ${KSFT_FAIL}
......
...@@ -27,10 +27,11 @@ capout="" ...@@ -27,10 +27,11 @@ capout=""
size=0 size=0
usage() { 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-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-c: capture packets for each test using tcpdump (default: no capture)"
echo -e "\t-d: debug this script" 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 # This function is used in the cleanup trap
...@@ -259,7 +260,7 @@ run_test() ...@@ -259,7 +260,7 @@ run_test()
fi fi
} }
while getopts "bcdh" option;do while getopts "bcdhi" option;do
case "$option" in case "$option" in
"h") "h")
usage $0 usage $0
...@@ -274,6 +275,9 @@ while getopts "bcdh" option;do ...@@ -274,6 +275,9 @@ while getopts "bcdh" option;do
"d") "d")
set -x set -x
;; ;;
"i")
mptcp_lib_set_ip_mptcp
;;
"?") "?")
usage $0 usage $0
exit ${KSFT_FAIL} exit ${KSFT_FAIL}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment