Skip to content

Commit

Permalink
selftests: mptcp: add infinite map mibs check
Browse files Browse the repository at this point in the history
This patch adds a function chk_infi_nr() to check the mibs for the
infinite mapping. Invoke it in chk_join_nr() when validate_checksum
is set.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Geliang Tang authored and David S. Miller committed Apr 23, 2022
1 parent d9fdd02 commit 8bd03be
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,38 @@ chk_rst_nr()
echo "$extra_msg"
}

chk_infi_nr()
{
local infi_tx=$1
local infi_rx=$2
local count
local dump_stats

printf "%-${nr_blank}s %s" " " "itx"
count=$(ip netns exec $ns2 nstat -as | grep InfiniteMapTx | awk '{print $2}')
[ -z "$count" ] && count=0
if [ "$count" != "$infi_tx" ]; then
echo "[fail] got $count infinite map[s] TX expected $infi_tx"
fail_test
dump_stats=1
else
echo -n "[ ok ]"
fi

echo -n " - infirx"
count=$(ip netns exec $ns1 nstat -as | grep InfiniteMapRx | awk '{print $2}')
[ -z "$count" ] && count=0
if [ "$count" != "$infi_rx" ]; then
echo "[fail] got $count infinite map[s] RX expected $infi_rx"
fail_test
dump_stats=1
else
echo "[ ok ]"
fi

[ "${dump_stats}" = 1 ] && dump_stats
}

chk_join_nr()
{
local syn_nr=$1
Expand All @@ -1115,7 +1147,8 @@ chk_join_nr()
local csum_ns2=${5:-0}
local fail_nr=${6:-0}
local rst_nr=${7:-0}
local corrupted_pkts=${8:-0}
local infi_nr=${8:-0}
local corrupted_pkts=${9:-0}
local count
local dump_stats
local with_cookie
Expand Down Expand Up @@ -1170,6 +1203,7 @@ chk_join_nr()
chk_csum_nr $csum_ns1 $csum_ns2
chk_fail_nr $fail_nr $fail_nr
chk_rst_nr $rst_nr $rst_nr
chk_infi_nr $infi_nr $infi_nr
fi
}

Expand Down

0 comments on commit 8bd03be

Please sign in to comment.