Skip to content

Commit 5f88117

Browse files
matttbedavem330
authored andcommitted
selftests: mptcp: fail if not enough SYN/3rd ACK
If we receive less MPCapable SYN or 3rd ACK than expected, we now mark the test as failed. On the other hand, if we receive more, we keep the warning but we add a hint that it is probably due to retransmissions and that's why we don't mark the test as failed. Closes: multipath-tcp/mptcp_net-next#148 Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 45759a8 commit 5f88117

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,6 @@ do_transfer()
483483
check_transfer $cin $sout "file received by server"
484484
rets=$?
485485

486-
if [ $retc -eq 0 ] && [ $rets -eq 0 ]; then
487-
printf "[ OK ]"
488-
fi
489-
490486
local stat_synrx_now_l=$(get_mib_counter "${listener_ns}" "MPTcpExtMPCapableSYNRX")
491487
local stat_ackrx_now_l=$(get_mib_counter "${listener_ns}" "MPTcpExtMPCapableACKRX")
492488
local stat_cookietx_now=$(get_mib_counter "${listener_ns}" "TcpExtSyncookiesSent")
@@ -502,6 +498,22 @@ do_transfer()
502498
expect_synrx=$((stat_synrx_last_l+1))
503499
expect_ackrx=$((stat_ackrx_last_l+1))
504500
fi
501+
502+
if [ ${stat_synrx_now_l} -lt ${expect_synrx} ]; then
503+
printf "[ FAIL ] lower MPC SYN rx (%d) than expected (%d)\n" \
504+
"${stat_synrx_now_l}" "${expect_synrx}" 1>&2
505+
retc=1
506+
fi
507+
if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} ]; then
508+
printf "[ FAIL ] lower MPC ACK rx (%d) than expected (%d)\n" \
509+
"${stat_ackrx_now_l}" "${expect_ackrx}" 1>&2
510+
rets=1
511+
fi
512+
513+
if [ $retc -eq 0 ] && [ $rets -eq 0 ]; then
514+
printf "[ OK ]"
515+
fi
516+
505517
if [ $cookies -eq 2 ];then
506518
if [ $stat_cookietx_last -ge $stat_cookietx_now ] ;then
507519
printf " WARN: CookieSent: did not advance"
@@ -518,12 +530,12 @@ do_transfer()
518530
fi
519531
fi
520532

521-
if [ $expect_synrx -ne $stat_synrx_now_l ] ;then
522-
printf " WARN: SYNRX: expect %d, got %d" \
533+
if [ ${stat_synrx_now_l} -gt ${expect_synrx} ]; then
534+
printf " WARN: SYNRX: expect %d, got %d (probably retransmissions)" \
523535
"${expect_synrx}" "${stat_synrx_now_l}"
524536
fi
525-
if [ $expect_ackrx -ne $stat_ackrx_now_l ] ;then
526-
printf " WARN: ACKRX: expect %d, got %d" \
537+
if [ ${stat_ackrx_now_l} -gt ${expect_ackrx} ]; then
538+
printf " WARN: ACKRX: expect %d, got %d (probably retransmissions)" \
527539
"${expect_ackrx}" "${stat_ackrx_now_l}"
528540
fi
529541

0 commit comments

Comments
 (0)