]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: test_tunnel: Add generic_attach* helpers
authorBastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Mon, 3 Mar 2025 08:22:49 +0000 (09:22 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 15 Mar 2025 18:48:26 +0000 (11:48 -0700)
commit5d6aa606c157c94d785624aae1fd9e5df57745d7
tree0a969d5f2f2ce7fb4ee4837bf4040b2dcc6d2157
parent191598fc4dad72fca491ef629db3d0c411c234a9
selftests/bpf: test_tunnel: Add generic_attach* helpers

A fair amount of code duplication is present among tests to attach BPF
programs.

Create generic_attach* helpers that attach BPF programs to a given
interface.
Use ASSERT_OK_FD() instead of ASSERT_GE() to check fd's validity.
Use these helpers in all the available 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-1-8329f38f0678@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/test_tunnel.c