]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Check BPFTOOL env var in detect_bpftool_path()
authorIhor Solodrai <ihor.solodrai@linux.dev>
Mon, 23 Feb 2026 19:11:17 +0000 (11:11 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 24 Feb 2026 16:19:49 +0000 (08:19 -0800)
commita2714e730304c79bf85d2178387255ef8348b897
tree284c864392639543045c1042225bd9ed9bfce5c0
parentad90ecedad755e2f3e31364ec3130e5bb2f4b64a
selftests/bpf: Check BPFTOOL env var in detect_bpftool_path()

The bpftool_maps_access and bpftool_metadata tests may fail on BPF CI
with "command not found", depending on a workflow.
This happens because detect_bpftool_path() only checks two hardcoded
relative paths:
  - ./tools/sbin/bpftool
  - ../tools/sbin/bpftool

Add support for a BPFTOOL environment variable that allows specifying
the exact path to the bpftool binary.

Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260223191118.655185-2-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/bpftool_helpers.c