Commit 6bb3ab49 authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

selftests: mptcp: add MP_FAIL mibs check

This patch added a function chk_fail_nr to check the mibs for MP_FAIL.
Signed-off-by: default avatarGeliang Tang <geliangtang@xiaomi.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb7f3365
...@@ -578,6 +578,43 @@ chk_csum_nr() ...@@ -578,6 +578,43 @@ chk_csum_nr()
fi fi
} }
chk_fail_nr()
{
local mp_fail_nr_tx=$1
local mp_fail_nr_rx=$2
local count
local dump_stats
printf "%-39s %s" " " "ftx"
count=`ip netns exec $ns1 nstat -as | grep MPTcpExtMPFailTx | awk '{print $2}'`
[ -z "$count" ] && count=0
if [ "$count" != "$mp_fail_nr_tx" ]; then
echo "[fail] got $count MP_FAIL[s] TX expected $mp_fail_nr_tx"
ret=1
dump_stats=1
else
echo -n "[ ok ]"
fi
echo -n " - frx "
count=`ip netns exec $ns2 nstat -as | grep MPTcpExtMPFailRx | awk '{print $2}'`
[ -z "$count" ] && count=0
if [ "$count" != "$mp_fail_nr_rx" ]; then
echo "[fail] got $count MP_FAIL[s] RX expected $mp_fail_nr_rx"
ret=1
dump_stats=1
else
echo "[ ok ]"
fi
if [ "${dump_stats}" = 1 ]; then
echo Server ns stats
ip netns exec $ns1 nstat -as | grep MPTcp
echo Client ns stats
ip netns exec $ns2 nstat -as | grep MPTcp
fi
}
chk_join_nr() chk_join_nr()
{ {
local msg="$1" local msg="$1"
...@@ -627,6 +664,7 @@ chk_join_nr() ...@@ -627,6 +664,7 @@ chk_join_nr()
fi fi
if [ $checksum -eq 1 ]; then if [ $checksum -eq 1 ]; then
chk_csum_nr chk_csum_nr
chk_fail_nr 0 0
fi fi
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment