Skip to content

Commit

Permalink
mptcp: add basic kselftest for mptcp
Browse files Browse the repository at this point in the history
Add mptcp_connect tool:
xmit two files back and forth between two processes, several net
namespaces including some adding delays, losses and reordering.
Wrapper script tests that data was transmitted without corruption.

The "-c" command line option for mptcp_connect.sh is there for debugging:

The script will use tcpdump to create one .pcap file per test case, named
according to the namespaces, protocols, and connect address in use.
For example, the first test case writes the capture to
ns1-ns1-MPTCP-MPTCP-10.0.1.1.pcap.

The stderr output from tcpdump is printed after the test completes to
show tcpdump's "packets dropped by kernel" information.

Also check that userspace can't create MPTCP sockets when mptcp.enabled
sysctl is off.

The "-b" option allows to tune/lower send buffer size.
"-m mmap" can be used to test blocking io.  Default is non-blocking
io using read/write/poll.

Will run automatically on "make kselftest".

Note that the default timeout of 45 seconds is used even if there is a
"settings" changing it to 450. 45 seconds should be enough in most cases
but this depends on the machine running the tests.

A fix to correctly read the "settings" file has been proposed upstream
but not applied yet. It is not blocking the execution of these new tests
but it would be nice to have it:

  https://patchwork.kernel.org/patch/11204935/

Co-developed-by: Paolo Abeni <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Co-developed-by: Mat Martineau <[email protected]>
Signed-off-by: Mat Martineau <[email protected]>
Co-developed-by: Matthieu Baerts <[email protected]>
Signed-off-by: Matthieu Baerts <[email protected]>
Co-developed-by: Davide Caratti <[email protected]>
Signed-off-by: Davide Caratti <[email protected]>
Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Christoph Paasch <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Florian Westphal authored and davem330 committed Jan 24, 2020
1 parent 784325e commit 048d19d
Show file tree
Hide file tree
Showing 8 changed files with 1,449 additions and 0 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -11584,6 +11584,7 @@ B: https://github.com/multipath-tcp/mptcp_net-next/issues
S: Maintained
F: include/net/mptcp.h
F: net/mptcp/
F: tools/testing/selftests/net/mptcp/

NETWORKING [TCP]
M: Eric Dumazet <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ TARGETS += memory-hotplug
TARGETS += mount
TARGETS += mqueue
TARGETS += net
TARGETS += net/mptcp
TARGETS += netfilter
TARGETS += networking/timestamping
TARGETS += nsfs
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/net/mptcp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mptcp_connect
*.pcap
13 changes: 13 additions & 0 deletions tools/testing/selftests/net/mptcp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: GPL-2.0

top_srcdir = ../../../../..

CFLAGS = -Wall -Wl,--no-as-needed -O2 -g

TEST_PROGS := mptcp_connect.sh

TEST_GEN_FILES = mptcp_connect

EXTRA_CLEAN := *.pcap

include ../../lib.mk
4 changes: 4 additions & 0 deletions tools/testing/selftests/net/mptcp/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_MPTCP=y
CONFIG_MPTCP_IPV6=y
CONFIG_VETH=y
CONFIG_NET_SCH_NETEM=m
Loading

0 comments on commit 048d19d

Please sign in to comment.