Skip to content

Commit

Permalink
selftests: mptcp: improve 'fair usage on close' stability
Browse files Browse the repository at this point in the history
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: 46e967d ("selftests: mptcp: add tests for subflow creation failure")
Closes: #257
Reported-and-tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Paolo Abeni authored and jenkins-tessares committed Feb 12, 2022
1 parent 0f9fd9e commit 59dc6ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 59dc6ca

Please sign in to comment.