aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/tcp_ao/lib/utils.c
diff options
context:
space:
mode:
authorDmitry Safonov <0x7f454c46@gmail.com>2024-08-23 23:04:57 +0100
committerJakub Kicinski <kuba@kernel.org>2024-08-27 14:11:27 -0700
commit044e037051252ca8df07e1355bf4d7964645a6e8 (patch)
treeb8a3a7fe4f2c4537da497ee89bbb710bbc0fb966 /tools/testing/selftests/net/tcp_ao/lib/utils.c
parent1c69e1f433990a81b5a5d415d8892ebcaacb985b (diff)
selftests/net: Synchronize client/server before counters checks
On tests that are expecting failure the timeout value is TEST_RETRANSMIT_SEC == 1 second. Which is big enough for most of devices under tests. But on a particularly slow machine/VM, 1 second might be not enough for another thread to be scheduled and attempt to connect(). It is not a problem for tests that expect connect() to succeed as the timeout value for them (TEST_TIMEOUT_SEC) is intentionally bigger. One obvious way to solve this would be to increase TEST_RETRANSMIT_SEC. But as all tests would increase the timeouts, that's going to sum up. But here is less obvious way that keeps timeouts for expected connect() failures low: just synchronize the two threads, which will assure that before counter checks the other thread got a chance to run and timeout on connect(). The expected increase of the related counter for listen() socket will yet test the expected failure. Never happens on my machine, but I suppose the majority of netdev's connect-deny-* flakes [1] are caused by this. Prevents the following testing issue: > # selftests: net/tcp_ao: connect-deny_ipv6 > # 1..21 > # # 462[lib/setup.c:243] rand seed 1720905426 > # TAP version 13 > # ok 1 Non-AO server + AO client > # not ok 2 Non-AO server + AO client: TCPAOKeyNotFound counter did not increase: 0 <= 0 > # ok 3 AO server + Non-AO client > # ok 4 AO server + Non-AO client: counter TCPAORequired increased 0 => 1 ... [1]: https://netdev-3.bots.linux.dev/vmksft-tcp-ao/results/681741/6-connect-deny-ipv6/stdout Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-7-05623636fe8c@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/tcp_ao/lib/utils.c')
0 files changed, 0 insertions, 0 deletions