Commit 5b31dda7 authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller
Browse files

selftests: mptcp: improve 'fair usage on close' stability

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: 46e967d1 ("selftests: mptcp: add tests for subflow creation failure")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/257


Reported-and-tested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0cd33c5f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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))