selftests/bpf: factorize conn and syncookies tests in a single runner
authorAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Sun, 20 Oct 2024 19:22:53 +0000 (21:22 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 21 Oct 2024 18:49:15 +0000 (11:49 -0700)
commit6414b3e5d5d44cd214161abf2ce2221d9e9de7bf
tree5c9108fd245e371807ab6897bf7b3b5d47a0cab7
parent91158257bc33aefe0b71573cc9a6e0beac520348
selftests/bpf: factorize conn and syncookies tests in a single runner

btf_skc_cls_ingress currently describe two tests, both running a simple
tcp server and then initializing a connection to it. The sole difference
between the tests is about the tcp_syncookie configuration, and some
checks around this feature being enabled/disabled.

Share the common code between those two tests by moving the code into a
single runner, parameterized by a "gen_cookies" argument. Split the
performed checks accordingly.

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20241020-syncookie-v2-1-2db240225fed@bootlin.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c