Skip to content

Commit

Permalink
selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not…
Browse files Browse the repository at this point in the history
… available

This test relies on bpf_testmod, so skip it if the module is not available.

Fixes: aa3d65d ("bpf/selftests: Test fentry attachment to shadowed functions")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230914124928.340701-1-asavkov@redhat.com
  • Loading branch information
Artem Savkov authored and Andrii Nakryiko committed Sep 14, 2023
1 parent 8fa1934 commit 971f7c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ void test_module_fentry_shadow(void)
int link_fd[2] = {};
__s32 btf_id[2] = {};

if (!env.has_testmod) {
test__skip();
return;
}

LIBBPF_OPTS(bpf_prog_load_opts, load_opts,
.expected_attach_type = BPF_TRACE_FENTRY,
);
Expand Down

0 comments on commit 971f7c3

Please sign in to comment.