Commit a673321a authored by Mat Martineau's avatar Mat Martineau Committed by David S. Miller

selftests: mptcp: Restore packet capture option in join tests

The join self tests previously used the '-c' command line option to
enable creation of pcap files for the tests that run, but the change to
allow running a subset of the join tests made overlapping use of that
option.

Restore the capture functionality with '-c' and move the syncookie test
option to '-k'.

Fixes: 1002b89f ("selftests: mptcp: add command line arguments for mptcp_join.sh")
Acked-and-tested-by: default avatarGeliang Tang <geliangtang@gmail.com>
Co-developed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c3b8e079
...@@ -11,6 +11,7 @@ ksft_skip=4 ...@@ -11,6 +11,7 @@ ksft_skip=4
timeout=30 timeout=30
mptcp_connect="" mptcp_connect=""
capture=0 capture=0
do_all_tests=1
TEST_COUNT=0 TEST_COUNT=0
...@@ -121,12 +122,6 @@ reset_with_add_addr_timeout() ...@@ -121,12 +122,6 @@ reset_with_add_addr_timeout()
-j DROP -j DROP
} }
for arg in "$@"; do
if [ "$arg" = "-c" ]; then
capture=1
fi
done
ip -Version > /dev/null 2>&1 ip -Version > /dev/null 2>&1
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
echo "SKIP: Could not run test without ip tool" echo "SKIP: Could not run test without ip tool"
...@@ -1221,7 +1216,8 @@ usage() ...@@ -1221,7 +1216,8 @@ usage()
echo " -4 v4mapped_tests" echo " -4 v4mapped_tests"
echo " -b backup_tests" echo " -b backup_tests"
echo " -p add_addr_ports_tests" echo " -p add_addr_ports_tests"
echo " -c syncookies_tests" echo " -k syncookies_tests"
echo " -c capture pcap files"
echo " -h help" echo " -h help"
} }
...@@ -1235,12 +1231,24 @@ make_file "$cin" "client" 1 ...@@ -1235,12 +1231,24 @@ make_file "$cin" "client" 1
make_file "$sin" "server" 1 make_file "$sin" "server" 1
trap cleanup EXIT trap cleanup EXIT
if [ -z $1 ]; then for arg in "$@"; do
# check for "capture" arg before launching tests
if [[ "${arg}" =~ ^"-"[0-9a-zA-Z]*"c"[0-9a-zA-Z]*$ ]]; then
capture=1
fi
# exception for the capture option, the rest means: a part of the tests
if [ "${arg}" != "-c" ]; then
do_all_tests=0
fi
done
if [ $do_all_tests -eq 1 ]; then
all_tests all_tests
exit $ret exit $ret
fi fi
while getopts 'fsltra64bpch' opt; do while getopts 'fsltra64bpkch' opt; do
case $opt in case $opt in
f) f)
subflows_tests subflows_tests
...@@ -1272,9 +1280,11 @@ while getopts 'fsltra64bpch' opt; do ...@@ -1272,9 +1280,11 @@ while getopts 'fsltra64bpch' opt; do
p) p)
add_addr_ports_tests add_addr_ports_tests
;; ;;
c) k)
syncookies_tests syncookies_tests
;; ;;
c)
;;
h | *) h | *)
usage usage
;; ;;
......
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