Skip to content

Conversation

@Tropicao
Copy link
Contributor

test

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 5 times, most recently from 243bdd7 to 24a3f92 Compare January 21, 2026 04:52
@Tropicao Tropicao force-pushed the bpftool-tests-ci branch 5 times, most recently from 028bb9d to 0958f1c Compare January 21, 2026 14:15
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 2 times, most recently from b96afa5 to a172611 Compare January 21, 2026 17:52
@Tropicao Tropicao force-pushed the bpftool-tests-ci branch 2 times, most recently from a5493b2 to b67a8b8 Compare January 21, 2026 20:05
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 2 times, most recently from bcd42c7 to 5b97fbd Compare January 21, 2026 22:08
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>
---
Changes in v2:
- Drop the new runner from commit, keep only the new bpftool-specific
  helpers
- replace hardcoded path with a detected (and cached) path
…work

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:

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

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
---
Changes in v2:
- move the new test in prog_tests directory
- use power of 2 for bpftool output buffer size
- check snprintf return when building commands
- target program by pin path rather than prog name
- remove a few blank lines
…mework

The test_bpftool_map.sh script tests that maps read/write accesses
are being properly allowed/refused by the kernel depending on a specific
fmod_ret program being attached on security_bpf_map function.

Rewrite this test to integrate it in the test_progs. The
new test spawns a few subtests:

  kernel-patches#36/1    bpftool_maps_access/unprotected_unpinned:OK
  kernel-patches#36/2    bpftool_maps_access/unprotected_pinned:OK
  kernel-patches#36/3    bpftool_maps_access/protected_unpinned:OK
  kernel-patches#36/4    bpftool_maps_access/protected_pinned:OK
  kernel-patches#36/5    bpftool_maps_access/nested_maps:OK
  kernel-patches#36/6    bpftool_maps_access/btf_list:OK
  kernel-patches#36      bpftool_maps_access:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Acked-by: Quentin Monnet <qmo@kernel.org>

---
Changes in v2:
- move the new test in prog_tests directory
- collect Quentin's AB
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 3 times, most recently from 403c46b to 53953d6 Compare January 23, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant