]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: convert test_bpftool_metadata.sh into test_progs framework
authorAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Fri, 23 Jan 2026 08:30:09 +0000 (09:30 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Jan 2026 02:47:31 +0000 (18:47 -0800)
commit1c0b505908a201054dadc87930f550bea2631c1e
tree855e2db66194a1b4b6ff76c9a3f7d63b95a2ce82
parentf21fae57744607330ae5dabdd996538faac7f5ab
selftests/bpf: convert test_bpftool_metadata.sh into test_progs framework

The test_bpftool_metadata.sh script validates that bpftool properly
returns in its ouptput any metadata generated by bpf programs through
some .rodata sections.

Port this test to the test_progs framework so that it can be executed
automatically in CI. The new test, similarly to the former script,
checks that valid data appears both for textual output and json output,
as well as for both data not used at all and used data. For the json
check part, the expected json string is hardcoded to avoid bringing a
new external dependency (eg: a json deserializer) for test_progs.
As the test is now converted into test_progs, remove the former script.

The newly converted test brings two new subtests:

  #37/1    bpftool_metadata/metadata_unused:OK
  #37/2    bpftool_metadata/metadata_used:OK
  #37      bpftool_metadata:OK
  Summary: 1/2 PASSED, 0 SKIPPED, 0 FAILED

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