[RFC mptcp-next v2 3/6] selftests: mptcp: add MP_FAIL echo mibs check

Geliang Tang posted 6 patches 3 years, 11 months ago
There is a newer version of this series
[RFC mptcp-next v2 3/6] selftests: mptcp: add MP_FAIL echo mibs check
Posted by Geliang Tang 3 years, 11 months ago
This patch added the MP_FAIL echo mibs check.

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

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 8708be740334..9a1d8a1d3447 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -947,6 +947,8 @@ chk_infi_nr()
 {
 	local infi_tx=$1
 	local infi_rx=$2
+	local echo_tx=${3:-$infi_tx}
+	local echo_rx=${4:-$infi_rx}
 	local count
 	local dump_stats
 
@@ -972,6 +974,28 @@ chk_infi_nr()
 		echo "[ ok ]"
 	fi
 
+	printf "%-${nr_blank}s %s" " " "etx"
+	count=`ip netns exec $ns2 nstat -as | grep MPTcpExtMPFailEchoTx | awk '{print $2}'`
+	[ -z "$count" ] && count=0
+	if [ "$count" != "$echo_tx" ]; then
+		echo "[fail] got $count MP_FAIL echo[s] RX expected $echo_tx"
+		ret=1
+		dump_stats=1
+	else
+		echo -n "[ ok ]"
+	fi
+
+	echo -n " - echorx"
+	count=`ip netns exec $ns1 nstat -as | grep MPTcpExtMPFailEchoRx | awk '{print $2}'`
+	[ -z "$count" ] && count=0
+	if [ "$count" != "$echo_rx" ]; then
+		echo "[fail] got $count MP_FAIL echo[s] RX expected $echo_rx"
+		ret=1
+		dump_stats=1
+	else
+		echo "[ ok ]"
+	fi
+
 	[ "${dump_stats}" = 1 ] && dump_stats
 }
 
-- 
2.34.1