Skip to content

Commit

Permalink
mptcp: more stable diag self-tests
Browse files Browse the repository at this point in the history
During diag self-tests we introduce long wait in the mptcp test
program to give the script enough time to access the sockets
dump.

Such wait is introduced after shutting down one sockets end. Since
commit 43b54c6 ("mptcp: Use full MPTCP-level disconnect state
machine") if both sides shutdown the socket is correctly transitioned
into CLOSED status.

As a side effect some sockets are not dumped via the diag interface,
because the socket state (CLOSED) does not match the default filter, and
this cause self-tests instability.

Address the issue moving the above mentioned wait before shutting
down the socket.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/68
Fixes: df62f2e ("selftests/mptcp: add diag interface tests")
Tested-and-acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paolo Abeni authored and David S. Miller committed Aug 8, 2020
1 parent 158b47a commit 6bdb621
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/testing/selftests/net/mptcp/mptcp_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,11 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd)

/* ... but we still receive.
* Close our write side, ev. give some time
* for address notification
* for address notification and/or checking
* the current status
*/
if (cfg_join)
usleep(400000);
if (cfg_wait)
usleep(cfg_wait);
shutdown(peerfd, SHUT_WR);
} else {
if (errno == EINTR)
Expand All @@ -427,7 +428,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd)
}

/* leave some time for late join/announce */
if (cfg_wait)
if (cfg_join)
usleep(cfg_wait);

close(peerfd);
Expand Down

0 comments on commit 6bdb621

Please sign in to comment.