]> git.ipfire.org Git - people/ms/linux.git/commitdiff
selftests: mptcp: improve 'fair usage on close' stability
authorPaolo Abeni <pabeni@redhat.com>
Fri, 18 Feb 2022 21:35:39 +0000 (13:35 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 Feb 2022 12:28:00 +0000 (12:28 +0000)
The mentioned test 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 <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/mptcp/mptcp_join.sh

index c0801df15f547265e2f63d0625ca7f958e765572..10b3bd805ac6e17cbcc2435ebfbd4039b7180c0e 100755 (executable)
@@ -961,7 +961,7 @@ wait_for_tw()
        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))