]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Add a few helpers for bpftool testing
authorAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Fri, 23 Jan 2026 08:30:08 +0000 (09:30 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Jan 2026 02:47:21 +0000 (18:47 -0800)
commitf21fae57744607330ae5dabdd996538faac7f5ab
tree53940536d3cbd563dd538439d27bd84209f90981
parent78980b4c7fcb5ef74b7af65fbef5ce8d718cf791
selftests/bpf: Add a few helpers for bpftool testing

In order to integrate some bpftool tests into test_progs, define a few
specific helpers that allow to execute bpftool commands, while possibly
retrieving the command output. Those helpers most notably set the
path to the bpftool binary under test. This version checks different
possible paths relative to the directories where the different
test_progs runners are executed, as we want to make sure not to
accidentally use a bootstrap version of the binary.

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20260123-bpftool-tests-v4-1-a6653a7f28e7@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/bpftool_helpers.c [new file with mode: 0644]
tools/testing/selftests/bpf/bpftool_helpers.h [new file with mode: 0644]