[PATCH mptcp-next] Squash to "selftests: mptcp: add more arguments for chk_join_nr v8"

Geliang Tang posted 1 patch 2 years, 2 months ago
Failed in applying to current master (apply log)
.../testing/selftests/net/mptcp/mptcp_join.sh | 38 +++++--------------
1 file changed, 10 insertions(+), 28 deletions(-)
[PATCH mptcp-next] Squash to "selftests: mptcp: add more arguments for chk_join_nr v8"
Posted by Geliang Tang 2 years, 2 months ago
Reflect the if conditions.

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

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index ec8d750c19eb..52628038af9c 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -769,40 +769,22 @@ chk_csum_nr()
 	printf " %-36s %s" "$msg" "sum"
 	count=`ip netns exec $ns1 nstat -as | grep MPTcpExtDataCsumErr | awk '{print $2}'`
 	[ -z "$count" ] && count=0
-	if [ "$count" != $csum_ns1 ]; then
-		if [ $allow_multi_errors_ns1 -eq 1 ]; then
-			# allow multiple checksum errors
-			if [ "$count" -lt $csum_ns1 ]; then
-				ret=1
-			fi
-		else
-			ret=1
-		fi
-
-		if [ $ret -eq 1 ]; then
-			echo "[fail] got $count data checksum error[s] expected $csum_ns1"
-			dump_stats=1
-		fi
+	if [ "$count" != $csum_ns1 -a $allow_multi_errors_ns1 -eq 0 ] ||
+	   [ "$count" -lt $csum_ns1 -a $allow_multi_errors_ns1 -eq 1 ]; then
+		echo "[fail] got $count data checksum error[s] expected $csum_ns1"
+		ret=1
+		dump_stats=1
 	else
 		echo -n "[ ok ]"
 	fi
 	echo -n " - csum  "
 	count=`ip netns exec $ns2 nstat -as | grep MPTcpExtDataCsumErr | awk '{print $2}'`
 	[ -z "$count" ] && count=0
-	if [ "$count" != $csum_ns2 ]; then
-		if [ $allow_multi_errors_ns2 -eq 1 ]; then
-			# allow multiple checksum errors
-			if [ "$count" -lt $csum_ns2 ]; then
-				ret=1
-			fi
-		else
-			ret=1
-		fi
-
-		if [ $ret -eq 1 ]; then
-			echo "[fail] got $count data checksum error[s] expected $csum_ns2"
-			dump_stats=1
-		fi
+	if [ "$count" != $csum_ns2 -a $allow_multi_errors_ns2 -eq 0 ] ||
+	   [ "$count" -lt $csum_ns2 -a $allow_multi_errors_ns2 -eq 1 ]; then
+		echo "[fail] got $count data checksum error[s] expected $csum_ns2"
+		ret=1
+		dump_stats=1
 	else
 		echo "[ ok ]"
 	fi
-- 
2.34.1