selftests/net: Add TCP-AO selfconnect/simultaneous connect test
authorDmitry Safonov <dima@arista.com>
Fri, 15 Dec 2023 02:36:25 +0000 (02:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Dec 2023 10:41:55 +0000 (10:41 +0000)
commit8c4e8dd0c047db7c68be01e6c30ada320b8babbc
treee5b4349bc94bdbbed1f863a11a3d76ad0deb9070
parentc6df7b2361d721f40610df5c832ea0fa73e918b1
selftests/net: Add TCP-AO selfconnect/simultaneous connect test

Check that a rare functionality of TCP named self-connect works with
TCP-AO. This "under the cover" also checks TCP simultaneous connect
(TCP_SYN_RECV socket state), which would be harder to check other ways.

In order to verify that it's indeed TCP simultaneous connect, check
the counters TCPChallengeACK and TCPSYNChallenge.

Sample of the output:
> # ./self-connect_ipv6
> 1..4
> # 1738[lib/setup.c:254] rand seed 1696451931
> TAP version 13
> ok 1 self-connect(same keyids): connect TCPAOGood 0 => 24
> ok 2 self-connect(different keyids): connect TCPAOGood 26 => 50
> ok 3 self-connect(restore): connect TCPAOGood 52 => 97
> ok 4 self-connect(restore, different keyids): connect TCPAOGood 99 => 144
> # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/tcp_ao/Makefile
tools/testing/selftests/net/tcp_ao/self-connect.c [new file with mode: 0644]