]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Split module_attach into subtests
authorViktor Malik <vmalik@redhat.com>
Wed, 25 Feb 2026 12:09:04 +0000 (13:09 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 3 Mar 2026 17:23:57 +0000 (09:23 -0800)
commit05c9b2eda8a9e3a216e43879fc812981a4890704
tree2a52aaa77a45c26446f79b0f7fbcfb25362b26e5
parent44dd647b668984fb52b7fb73952cb1668b76ebed
selftests/bpf: Split module_attach into subtests

The test verifies attachment to various hooks in a kernel module,
however, everything is flattened into a single test. This makes it
impossible to run or skip test cases selectively.

Isolate each BPF program into a separate subtest. This is done by
disabling auto-loading of programs and loading and testing each program
separately.

At the same time, modernize the test to use ASSERT* instead of CHECK and
replace `return` by `goto cleanup` where necessary.

Signed-off-by: Viktor Malik <vmalik@redhat.com>
Link: https://lore.kernel.org/r/20260225120904.1529112-1-vmalik@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/module_attach.c
tools/testing/selftests/bpf/progs/test_module_attach.c