Reflect the ns_invert.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 3252865352f3..5a9b351a5bdc 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -809,11 +809,10 @@ chk_rst_nr()
local ns_invert=${3:-""}
local count
local dump_stats
+ local ns_tx=$ns1
+ local ns_rx=$ns2
- 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
fi
@@ -837,15 +836,13 @@ 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
+ if [[ $ns_invert = "invert" ]]; then
echo " - invert"
+ else
+ echo ""
fi
[ "${dump_stats}" = 1 ] && dump_stats
--
2.34.1