]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: test_tunnel: Add ping helpers
authorBastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Mon, 3 Mar 2025 08:22:50 +0000 (09:22 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 15 Mar 2025 18:48:26 +0000 (11:48 -0700)
commitfcb39996a2426b5da54036002c39699426109fa2
treee0941278db32012f67e7d96a0aea389bd25ff733
parent5d6aa606c157c94d785624aae1fd9e5df57745d7
selftests/bpf: test_tunnel: Add ping helpers

All tests use more or less the same ping commands as final validation.
Also test_ping()'s return value is checked with ASSERT_OK() while this
check is already done by the SYS() macro inside test_ping().

Create helpers around test_ping() and use them in the tests to avoid code
duplication.
Remove the unnecessary ASSERT_OK() from the tests.

Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250303-tunnels-v2-2-8329f38f0678@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/test_tunnel.c