Pass fastclose flag to the sflags argument instead of addr_nr_ns2.
Then the fullmesh flag setting can be moved into pm_nl_set_endpoint()
from do_transfer().
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index c3c8471f9ad1..89379815b619 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -828,6 +828,12 @@ pm_nl_set_endpoint()
local connector_ns="$2"
local connect_addr="$3"
+ local flags="subflow"
+ if [[ "${addr_nr_ns2}" = "fullmesh_"* ]]; then
+ flags="${flags},fullmesh"
+ addr_nr_ns2=${addr_nr_ns2:9}
+ fi
+
# let the mptcp subflow be established in background before
# do endpoint manipulation
if [ $addr_nr_ns1 != "0" ] || [ $addr_nr_ns2 != "0" ]; then
@@ -1015,11 +1021,10 @@ do_transfer()
extra_args="-r ${speed:6}"
fi
- local flags="subflow"
local extra_cl_args=""
local extra_srv_args=""
local trunc_size=""
- if [[ "${addr_nr_ns2}" = "fastclose_"* ]]; then
+ if [[ "${sflags}" = "fastclose_"* ]]; then
if [ ${test_linkfail} -le 1 ]; then
echo "fastclose tests need test_linkfail argument"
fail_test
@@ -1028,7 +1033,7 @@ do_transfer()
# disconnect
trunc_size=${test_linkfail}
- local side=${addr_nr_ns2:10}
+ local side=${sflags:10}
if [ ${side} = "client" ]; then
extra_cl_args="-f ${test_linkfail}"
@@ -1041,10 +1046,6 @@ do_transfer()
fail_test
return 1
fi
- addr_nr_ns2=0
- elif [[ "${addr_nr_ns2}" = "fullmesh_"* ]]; then
- flags="${flags},fullmesh"
- addr_nr_ns2=${addr_nr_ns2:9}
fi
extra_srv_args="$extra_args $extra_srv_args"
@@ -3186,7 +3187,7 @@ fullmesh_tests()
fastclose_tests()
{
if reset_check_counter "fastclose test" "MPTcpExtMPFastcloseTx"; then
- test_linkfail=1024 addr_nr_ns2=fastclose_client \
+ test_linkfail=1024 sflags=fastclose_client \
run_tests $ns1 $ns2 10.0.1.1
chk_join_nr 0 0 0
chk_fclose_nr 1 1
@@ -3194,7 +3195,7 @@ fastclose_tests()
fi
if reset_check_counter "fastclose server test" "MPTcpExtMPFastcloseRx"; then
- test_linkfail=1024 addr_nr_ns2=fastclose_server \
+ test_linkfail=1024 sflags=fastclose_server \
run_tests $ns1 $ns2 10.0.1.1
chk_join_nr 0 0 0
chk_fclose_nr 1 1 invert
--
2.35.3