Skip to content

Commit 81ab772

Browse files
Geliang Tangdavem330
authored andcommitted
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: Geliang Tang <[email protected]> Reviewed-by: Matthieu Baerts <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0bd962d commit 81ab772

File tree

1 file changed

+16
-1
lines changed
  • tools/testing/selftests/net/mptcp

1 file changed

+16
-1
lines changed

tools/testing/selftests/net/mptcp/diag.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ __chk_nr()
5656
local command="$1"
5757
local expected=$2
5858
local msg="$3"
59-
local skip="${4:-SKIP}"
59+
local skip="${4-SKIP}"
6060
local nr
6161

6262
nr=$(eval $command)
@@ -182,6 +182,15 @@ chk_msk_inuse()
182182
__chk_nr get_msk_inuse $expected "$msg" 0
183183
}
184184

185+
# $1: cestab nr
186+
chk_msk_cestab()
187+
{
188+
local cestab=$1
189+
190+
__chk_nr "mptcp_lib_get_counter ${ns} MPTcpExtMPCurrEstab" \
191+
"${cestab}" "....chk ${cestab} cestab" ""
192+
}
193+
185194
wait_connected()
186195
{
187196
local listener_ns="${1}"
@@ -219,9 +228,11 @@ chk_msk_nr 2 "after MPC handshake "
219228
chk_msk_remote_key_nr 2 "....chk remote_key"
220229
chk_msk_fallback_nr 0 "....chk no fallback"
221230
chk_msk_inuse 2 "....chk 2 msk in use"
231+
chk_msk_cestab 2
222232
flush_pids
223233

224234
chk_msk_inuse 0 "....chk 0 msk in use after flush"
235+
chk_msk_cestab 0
225236

226237
echo "a" | \
227238
timeout ${timeout_test} \
@@ -237,9 +248,11 @@ echo "b" | \
237248
wait_connected $ns 10001
238249
chk_msk_fallback_nr 1 "check fallback"
239250
chk_msk_inuse 1 "....chk 1 msk in use"
251+
chk_msk_cestab 1
240252
flush_pids
241253

242254
chk_msk_inuse 0 "....chk 0 msk in use after flush"
255+
chk_msk_cestab 0
243256

244257
NR_CLIENTS=100
245258
for I in `seq 1 $NR_CLIENTS`; do
@@ -261,9 +274,11 @@ done
261274

262275
wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present"
263276
chk_msk_inuse $((NR_CLIENTS*2)) "....chk many msk in use"
277+
chk_msk_cestab $((NR_CLIENTS*2))
264278
flush_pids
265279

266280
chk_msk_inuse 0 "....chk 0 msk in use after flush"
281+
chk_msk_cestab 0
267282

268283
mptcp_lib_result_print_all_tap
269284
exit $ret

0 commit comments

Comments
 (0)