Reflect the ns_invert.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
v3:
- add extra_msg
v2:
- update the output message from
rtx[ ok ] - rstrx [ ok ] - invert
to
rtx[ ok ] - rstrx [ ok ] invert
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 3252865352f3..93943cb5e4c9 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -809,13 +809,14 @@ chk_rst_nr()
local ns_invert=${3:-""}
local count
local dump_stats
+ local ns_tx=$ns1
+ local ns_rx=$ns2
+ local extra_msg=""
- if [ -z $ns_invert ]; then
- ns_tx=$ns1
- ns_rx=$ns2
- elif [ $ns_invert = "invert" ]; then
+ if [[ $ns_invert = "invert" ]]; then
ns_tx=$ns2
ns_rx=$ns1
+ extra_msg=" invert"
fi
printf "%-${nr_blank}s %s" " " "rtx"
@@ -837,16 +838,10 @@ chk_rst_nr()
ret=1
dump_stats=1
else
- if [ -z $ns_invert ]; then
- echo "[ ok ]"
- elif [ $ns_invert = "invert" ]; then
- echo -n "[ ok ]"
- fi
+ echo -n "[ ok ]"
fi
- if [ ! -z $ns_invert ] && [ $ns_invert = "invert" ]; then
- echo " - invert"
- fi
+ echo "$extra_msg"
[ "${dump_stats}" = 1 ] && dump_stats
}
--
2.34.1