Commit 81ab7728 authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

selftests: mptcp: diag: check CURRESTAB counters

This patch adds a new helper chk_msk_cestab() to check the current
established connections counter MIB_CURRESTAB in diag.sh. Invoke it
to check the counter during the connection after every chk_msk_inuse().
Signed-off-by: default avatarGeliang Tang <geliang.tang@linux.dev>
Reviewed-by: default avatarMatthieu Baerts <matttbe@kernel.org>
Signed-off-by: default avatarMatthieu Baerts <matttbe@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0bd962dd
...@@ -56,7 +56,7 @@ __chk_nr() ...@@ -56,7 +56,7 @@ __chk_nr()
local command="$1" local command="$1"
local expected=$2 local expected=$2
local msg="$3" local msg="$3"
local skip="${4:-SKIP}" local skip="${4-SKIP}"
local nr local nr
nr=$(eval $command) nr=$(eval $command)
...@@ -182,6 +182,15 @@ chk_msk_inuse() ...@@ -182,6 +182,15 @@ chk_msk_inuse()
__chk_nr get_msk_inuse $expected "$msg" 0 __chk_nr get_msk_inuse $expected "$msg" 0
} }
# $1: cestab nr
chk_msk_cestab()
{
local cestab=$1
__chk_nr "mptcp_lib_get_counter ${ns} MPTcpExtMPCurrEstab" \
"${cestab}" "....chk ${cestab} cestab" ""
}
wait_connected() wait_connected()
{ {
local listener_ns="${1}" local listener_ns="${1}"
...@@ -219,9 +228,11 @@ chk_msk_nr 2 "after MPC handshake " ...@@ -219,9 +228,11 @@ chk_msk_nr 2 "after MPC handshake "
chk_msk_remote_key_nr 2 "....chk remote_key" chk_msk_remote_key_nr 2 "....chk remote_key"
chk_msk_fallback_nr 0 "....chk no fallback" chk_msk_fallback_nr 0 "....chk no fallback"
chk_msk_inuse 2 "....chk 2 msk in use" chk_msk_inuse 2 "....chk 2 msk in use"
chk_msk_cestab 2
flush_pids flush_pids
chk_msk_inuse 0 "....chk 0 msk in use after flush" chk_msk_inuse 0 "....chk 0 msk in use after flush"
chk_msk_cestab 0
echo "a" | \ echo "a" | \
timeout ${timeout_test} \ timeout ${timeout_test} \
...@@ -237,9 +248,11 @@ echo "b" | \ ...@@ -237,9 +248,11 @@ echo "b" | \
wait_connected $ns 10001 wait_connected $ns 10001
chk_msk_fallback_nr 1 "check fallback" chk_msk_fallback_nr 1 "check fallback"
chk_msk_inuse 1 "....chk 1 msk in use" chk_msk_inuse 1 "....chk 1 msk in use"
chk_msk_cestab 1
flush_pids flush_pids
chk_msk_inuse 0 "....chk 0 msk in use after flush" chk_msk_inuse 0 "....chk 0 msk in use after flush"
chk_msk_cestab 0
NR_CLIENTS=100 NR_CLIENTS=100
for I in `seq 1 $NR_CLIENTS`; do for I in `seq 1 $NR_CLIENTS`; do
...@@ -261,9 +274,11 @@ done ...@@ -261,9 +274,11 @@ done
wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present" wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present"
chk_msk_inuse $((NR_CLIENTS*2)) "....chk many msk in use" chk_msk_inuse $((NR_CLIENTS*2)) "....chk many msk in use"
chk_msk_cestab $((NR_CLIENTS*2))
flush_pids flush_pids
chk_msk_inuse 0 "....chk 0 msk in use after flush" chk_msk_inuse 0 "....chk 0 msk in use after flush"
chk_msk_cestab 0
mptcp_lib_result_print_all_tap mptcp_lib_result_print_all_tap
exit $ret exit $ret
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