]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: mptcp: add mptcp getsockopt test cases
authorFlorian Westphal <fw@strlen.de>
Fri, 17 Sep 2021 23:33:22 +0000 (16:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Sep 2021 13:20:01 +0000 (14:20 +0100)
commit58a985d3f5da07dd7ed89d701d612e564da34d81
tree4252af1ca2a9aefc97ba62cea0f9d78932580f08
parent1af943d9080b9355ec3ff7f9120a40e6ee4d4a20
selftests: mptcp: add mptcp getsockopt test cases

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>
tools/testing/selftests/net/mptcp/.gitignore
tools/testing/selftests/net/mptcp/Makefile
tools/testing/selftests/net/mptcp/mptcp_sockopt.c [new file with mode: 0644]
tools/testing/selftests/net/mptcp/mptcp_sockopt.sh