Skip to content

Commit

Permalink
selftests: mptcp: add mptcp getsockopt test cases
Browse files Browse the repository at this point in the history
Add a test program that retrieves the three info types:
1. mptcp meta information
2. tcp info for subflow
3. subflow endpoint addresses

For all three rudimentary checks are added.

1. Meta information checks that the logical mptcp
   sequence numbers advance as expected, based on the bytes read
   (init seq + bytes_received/sent) and the connection state
   (after close, we should exect 1 extra byte due to FIN).

2. TCP info checks the number of bytes sent/received vs.
   sums of read/write syscall return values.

3. Subflow endpoint addresses are checked vs. getsockname/getpeername
   result.

Tests for forward compatibility (0-initialisation of output-only
fields in mptcp_subflow_data structure) are added as well.

Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and davem330 committed Sep 18, 2021
1 parent c11c590 commit ce99791
Show file tree
Hide file tree
Showing 4 changed files with 714 additions and 3 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/net/mptcp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
mptcp_connect
mptcp_sockopt
pm_nl_ctl
*.pcap
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/mptcp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include
TEST_PROGS := mptcp_connect.sh pm_netlink.sh mptcp_join.sh diag.sh \
simult_flows.sh mptcp_sockopt.sh

TEST_GEN_FILES = mptcp_connect pm_nl_ctl
TEST_GEN_FILES = mptcp_connect pm_nl_ctl mptcp_sockopt

TEST_FILES := settings

Expand Down

0 comments on commit ce99791

Please sign in to comment.