From 8653fdf0a07cac5556460754fc4b08e925cfea62 Mon Sep 17 00:00:00 2001 From: Paolo Abeni Date: Thu, 14 Jan 2021 13:10:52 +0100 Subject: [PATCH] mptcp: add regression test for disconnect() This simply trigger the in-kernel mptcp disconnect code path, so that we can have coverage for: https://marc.info/?l=linux-netdev&m=161053335929207&w=2 Signed-off-by: Paolo Abeni --- .../net/mptcp/regressions/unconnected_shutdown.pkt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 gtests/net/mptcp/regressions/unconnected_shutdown.pkt diff --git a/gtests/net/mptcp/regressions/unconnected_shutdown.pkt b/gtests/net/mptcp/regressions/unconnected_shutdown.pkt new file mode 100644 index 00000000..aa9f5dfb --- /dev/null +++ b/gtests/net/mptcp/regressions/unconnected_shutdown.pkt @@ -0,0 +1,14 @@ +// This test case covers the regression fixed by ("mptcp: fix locking in mptcp_disconnect()") +// shutdown a socket with connect pending, so that mptcp_disconnect() +// is inoked +--tolerance_usecs=100000 +`../common/defaults.sh` + +0.0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3 ++0.0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR) ++0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0 + ++0.0 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress) ++0.0 > S 0:0(0) + ++0.0 shutdown(3, SHUT_WR) = 0