Skip to content

Commit 6bdb621

Browse files
Paolo Abenidavem330
authored andcommitted
mptcp: more stable diag self-tests
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: multipath-tcp/mptcp_net-next#68 Fixes: df62f2e ("selftests/mptcp: add diag interface tests") Tested-and-acked-by: Matthieu Baerts <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 158b47a commit 6bdb621

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/testing/selftests/net/mptcp/mptcp_connect.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,11 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd)
406406

407407
/* ... but we still receive.
408408
* Close our write side, ev. give some time
409-
* for address notification
409+
* for address notification and/or checking
410+
* the current status
410411
*/
411-
if (cfg_join)
412-
usleep(400000);
412+
if (cfg_wait)
413+
usleep(cfg_wait);
413414
shutdown(peerfd, SHUT_WR);
414415
} else {
415416
if (errno == EINTR)
@@ -427,7 +428,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd)
427428
}
428429

429430
/* leave some time for late join/announce */
430-
if (cfg_wait)
431+
if (cfg_join)
431432
usleep(cfg_wait);
432433

433434
close(peerfd);

0 commit comments

Comments
 (0)