From b64c4865664017b1031a46802374bead03af36f4 Mon Sep 17 00:00:00 2001 From: Paolo Abeni Date: Tue, 8 Feb 2022 10:38:00 +0100 Subject: [PATCH] selftests: mptcp: improve 'fair usage on close' stability The mentioned tests has to wait for a subflow creation failure. The current code looks for TCP sockets in TW state and sometimes misses the relevant event. Switch to a more stable check, looking for the associated mib counter. Fixes: 46e967d187ed ("selftests: mptcp: add tests for subflow creation failure") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/257 Reported-and-tested-by: Matthieu Baerts Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 18bb0d0cf4bd4..367747ecb6054 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1094,14 +1094,14 @@ chk_link_usage() fi } -wait_for_tw() +wait_attempt_fail() { local timeout_ms=$((timeout_poll * 1000)) local time=0 local ns=$1 while [ $time -lt $timeout_ms ]; do - local cnt=$(ip netns exec $ns ss -t state time-wait |wc -l) + local cnt=$(ip netns exec $ns nstat -as TcpAttemptFails | grep TcpAttemptFails | awk '{print $2}') [ "$cnt" = 1 ] && return 1 time=$((time + 100)) @@ -1213,7 +1213,7 @@ subflows_error_tests() TEST_COUNT=$((TEST_COUNT+1)) # mpj subflow will be in TW after the reset - wait_for_tw $ns2 + wait_attempt_fail $ns2 pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow wait