[PATCH mptcp-next] Squash to "selftests: mptcp: add fastclose testcases v2"

Geliang Tang posted 1 patch 2 years, 1 month ago
Failed in applying to current master (apply log)
.../testing/selftests/net/mptcp/mptcp_join.sh | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
[PATCH mptcp-next] Squash to "selftests: mptcp: add fastclose testcases v2"
Posted by Geliang Tang 2 years, 1 month ago
Reuse the argment addr_nr_ns2 for fastclose, instead of adding a new
one.

Please update the commit log:

'''
This patch added the self tests for MP_FASTCLOSE. Reused the argment
addr_nr_ns2 of do_transfer() to pass the extra argments '-I 2' or
'-I 3' to mptcp_connect commands. Then mptcp_connect disconnected the
connections to trigger the MP_FASTCLOSE sending and receiving. Used
chk_fclose_nr to check the MP_FASTCLOSE mibs and used chk_rst_nr to
check the MP_RST mibs.

The output looks like this:

001 fastclose test 1              syn[ ok ] - synack[ ok ] - ack[ ok ]
                                  sum[ ok ] - csum  [ ok ]
                                  ftx[ ok ] - frx   [ ok ]
                                  rtx[ ok ] - rstrx [ ok ]
                                  itx[ ok ] - irx   [ ok ]
                                  ctx[ ok ] - fclzrx[ ok ]
                                  rtx[ ok ] - rstrx [ ok ] - invert
'''

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 2fc26fe68a9d..00a35601f319 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -424,7 +424,6 @@ do_transfer()
 	addr_nr_ns2="$8"
 	speed="$9"
 	sflags="${10}"
-	fastclose="${11}"
 
 	port=$((10000+$TEST_COUNT))
 	TEST_COUNT=$((TEST_COUNT+1))
@@ -463,11 +462,10 @@ do_transfer()
 		extra_args="-r 10"
 	fi
 
-	if [ $fastclose -eq 2 ]; then
+	if [[ "${addr_nr_ns2}" = "fastclose_"* ]]; then
 		# disconnect
-		extra_args="$extra_args -I 2"
-	elif [ $fastclose -eq 3 ]; then
-		extra_args="$extra_args -I 3"
+		extra_args="$extra_args -I ${addr_nr_ns2:10}"
+		addr_nr_ns2=0
 	fi
 
 	local local_addr
@@ -615,7 +613,7 @@ do_transfer()
 		fi
 	fi
 
-	if [ $sflags != "null" ]; then
+	if [ ! -z $sflags ]; then
 		sleep 1
 		for netns in "$ns1" "$ns2"; do
 			pm_nl_show_endpoints $netns | while read line; do
@@ -706,8 +704,7 @@ run_tests()
 	addr_nr_ns1="${5:-0}"
 	addr_nr_ns2="${6:-0}"
 	speed="${7:-fast}"
-	sflags="${8:-null}"
-	fastclose="${9:-0}"
+	sflags="${8:-""}"
 
 	# create the input file for the failure test when
 	# the first failure test run
@@ -734,7 +731,7 @@ run_tests()
 	fi
 
 	do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP ${connect_addr} \
-		${test_linkfail} ${addr_nr_ns1} ${addr_nr_ns2} ${speed} ${sflags} ${fastclose}
+		${test_linkfail} ${addr_nr_ns1} ${addr_nr_ns2} ${speed} ${sflags}
 }
 
 dump_stats()
@@ -2297,13 +2294,13 @@ userspace_tests()
 fastclose_tests()
 {
 	reset
-	run_tests $ns1 $ns2 10.0.1.1 0 0 0 fast null 2
+	run_tests $ns1 $ns2 10.0.1.1 0 0 fastclose_2
 	chk_join_nr "fastclose test 1" 0 0 0
 	chk_fclose_nr 1 1
 	chk_rst_nr 1 1 invert
 
 	reset
-	run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow null 3
+	run_tests $ns1 $ns2 10.0.1.1 0 0 fastclose_3 slow
 	chk_join_nr "fastclose test 2" 0 0 0
 	chk_fclose_nr 2 2
 	chk_rst_nr 2 2 invert
-- 
2.34.1