Re: [PATCH 04/12] selftests/net: Add a test for TCP-AO keys matching

From: Hangbin Liu
Date: Mon Dec 18 2023 - 04:05:36 EST


On Fri, Dec 15, 2023 at 02:36:18AM +0000, Dmitry Safonov wrote:
> Add TCP-AO tests on connect()/accept() pair.
> SNMP counters exposed by kernel are very useful here to verify the
> expected behavior of TCP-AO.
>
> Expected output for ipv4 version:
> > # ./connect-deny_ipv4
> > 1..19
> > # 1702[lib/setup.c:254] rand seed 1680553689
> > TAP version 13
> > ok 1 Non-AO server + AO client
> > ok 2 Non-AO server + AO client: counter TCPAOKeyNotFound increased 0 => 1
> > ok 3 AO server + Non-AO client
> > ok 4 AO server + Non-AO client: counter TCPAORequired increased 0 => 1
> > ok 5 Wrong password
> > ok 6 Wrong password: counter TCPAOBad increased 0 => 1
> > ok 7 Wrong rcv id
> > ok 8 Wrong rcv id: counter TCPAOKeyNotFound increased 1 => 2
> > ok 9 Wrong snd id
> > ok 10 Wrong snd id: counter TCPAOGood increased 0 => 1
> > ok 11 Server: Wrong addr: counter TCPAOKeyNotFound increased 2 => 3
> > ok 12 Server: Wrong addr
> > ok 13 Client: Wrong addr: connect() was prevented
> > ok 14 rcv id != snd id: connected
> > ok 15 rcv id != snd id: counter TCPAOGood increased 1 => 3
> > ok 16 Server: prefix match: connected
> > ok 17 Server: prefix match: counter TCPAOGood increased 4 => 6
> > ok 18 Client: prefix match: connected
> > ok 19 Client: prefix match: counter TCPAOGood increased 7 => 9
> > # Totals: pass:19 fail:0 xfail:0 xpass:0 skip:0 error:0
>
> Expected output for ipv6 version:
> > # ./connect-deny_ipv6
> > 1..19
> > # 1725[lib/setup.c:254] rand seed 1680553711
> > TAP version 13
> > ok 1 Non-AO server + AO client
> > ok 2 Non-AO server + AO client: counter TCPAOKeyNotFound increased 0 => 1
> > ok 3 AO server + Non-AO client: counter TCPAORequired increased 0 => 1
> > ok 4 AO server + Non-AO client
> > ok 5 Wrong password: counter TCPAOBad increased 0 => 1
> > ok 6 Wrong password
> > ok 7 Wrong rcv id: counter TCPAOKeyNotFound increased 1 => 2
> > ok 8 Wrong rcv id
> > ok 9 Wrong snd id: counter TCPAOGood increased 0 => 1
> > ok 10 Wrong snd id
> > ok 11 Server: Wrong addr
> > ok 12 Server: Wrong addr: counter TCPAOKeyNotFound increased 2 => 3
> > ok 13 Client: Wrong addr: connect() was prevented
> > ok 14 rcv id != snd id: connected
> > ok 15 rcv id != snd id: counter TCPAOGood increased 1 => 3
> > ok 16 Server: prefix match: connected
> > ok 17 Server: prefix match: counter TCPAOGood increased 5 => 7
> > ok 18 Client: prefix match: connected
> > ok 19 Client: prefix match: counter TCPAOGood increased 8 => 10
> > # Totals: pass:19 fail:0 xfail:0 xpass:0 skip:0 error:0
>
> Signed-off-by: Dmitry Safonov <dima@xxxxxxxxxx>

Tested-by: Hangbin Liu <liuhangbin@xxxxxxxxx>