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

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:

  #36/1    bpftool_maps_access/unprotected_unpinned:OK
  #36/2    bpftool_maps_access/unprotected_pinned:OK
  #36/3    bpftool_maps_access/protected_unpinned:OK
  #36/4    bpftool_maps_access/protected_pinned:OK
  #36/5    bpftool_maps_access/nested_maps:OK
  #36/6    bpftool_maps_access/btf_list:OK
  #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>
Link: https://lore.kernel.org/r/20260123-bpftool-tests-v4-3-a6653a7f28e7@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/bpftool_maps_access.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_bpftool_map.sh [deleted file]