Abort if one of the tc command fails.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index d33cb5ce0ff3..1a11ec690f79 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -253,7 +253,10 @@ checksum_failure()
while true; do
local pkt=$(tc -n $ns2 -j -s action show action csum index 100 |
jq '.[1].actions[0].stats.packets')
- if [ $pkt -gt 0 ]; then
+ if [ $pkt = "null" ]; then
+ echo "tc show action csum failed"
+ break
+ elif [ $pkt -gt 0 ]; then
tc -n $ns2 qdisc del dev ns2eth$i clsact
break
fi
--
2.26.2