diff options
| author | Martin KaFai Lau <martin.lau@kernel.org> | 2024-07-22 11:30:47 -0700 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2024-07-29 13:09:10 -0700 |
| commit | 4009c95fede6b783802ad01f264a7a0541f5ea60 (patch) | |
| tree | 120a17e784ca02ef0cfdd75aecc71ff839e06be5 /tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c | |
| parent | selftests/bpf: Fix the missing tramp_1 to tramp_40 ops in cfi_stubs (diff) | |
| download | linux-4009c95fede6b783802ad01f264a7a0541f5ea60.tar.gz linux-4009c95fede6b783802ad01f264a7a0541f5ea60.zip | |
selftests/bpf: Ensure the unsupported struct_ops prog cannot be loaded
There is an existing "bpf_tcp_ca/unsupp_cong_op" test to ensure
the unsupported tcp-cc "get_info" struct_ops prog cannot be loaded.
This patch adds a new test in the bpf_testmod such that the
unsupported ops test does not depend on other kernel subsystem
where its supporting ops may be changed in the future.
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240722183049.2254692-4-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c b/tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c index bbcf12696a6b..75a0dea511b3 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c +++ b/tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c @@ -9,6 +9,7 @@ #include "struct_ops_nulled_out_cb.skel.h" #include "struct_ops_forgotten_cb.skel.h" #include "struct_ops_detach.skel.h" +#include "unsupported_ops.skel.h" static void check_map_info(struct bpf_map_info *info) { @@ -311,5 +312,6 @@ void serial_test_struct_ops_module(void) test_struct_ops_forgotten_cb(); if (test__start_subtest("test_detach_link")) test_detach_link(); + RUN_TESTS(unsupported_ops); } |
