Skip to content

Commit b134a58

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: join: correctly check for no RST
The commit mentioned below was more tolerant with the number of RST seen during a test because in some uncontrollable situations, multiple RST can be generated. But it was not taking into account the case where no RST are expected: this validation was then no longer reporting issues for the 0 RST case because it is not possible to have less than 0 RST in the counter. This patch fixes the issue by adding a specific condition. Fixes: 6bf4102 ("selftests: mptcp: update and extend fastclose test-cases") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts <matttbe@kernel.org> Signed-off-by: Mat Martineau <martineau@kernel.org> Link: https://lore.kernel.org/r/20231018-send-net-20231018-v1-1-17ecb002e41d@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 389db4f commit b134a58

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,9 @@ chk_rst_nr()
14321432
count=$(get_counter ${ns_tx} "MPTcpExtMPRstTx")
14331433
if [ -z "$count" ]; then
14341434
print_skip
1435-
elif [ $count -lt $rst_tx ]; then
1435+
# accept more rst than expected except if we don't expect any
1436+
elif { [ $rst_tx -ne 0 ] && [ $count -lt $rst_tx ]; } ||
1437+
{ [ $rst_tx -eq 0 ] && [ $count -ne 0 ]; }; then
14361438
fail_test "got $count MP_RST[s] TX expected $rst_tx"
14371439
else
14381440
print_ok
@@ -1442,7 +1444,9 @@ chk_rst_nr()
14421444
count=$(get_counter ${ns_rx} "MPTcpExtMPRstRx")
14431445
if [ -z "$count" ]; then
14441446
print_skip
1445-
elif [ "$count" -lt "$rst_rx" ]; then
1447+
# accept more rst than expected except if we don't expect any
1448+
elif { [ $rst_rx -ne 0 ] && [ $count -lt $rst_rx ]; } ||
1449+
{ [ $rst_rx -eq 0 ] && [ $count -ne 0 ]; }; then
14461450
fail_test "got $count MP_RST[s] RX expected $rst_rx"
14471451
else
14481452
print_ok

0 commit comments

Comments
 (0)