Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: bpf: fix duplicate selftests in cpumask_success.

The BPF cpumask selftests are currently run twice in
test_progs/cpumask.c, once by traversing cpumask_success_testcases, and
once by invoking RUN_TESTS(cpumask_success). Remove the invocation of
RUN_TESTS to properly run the selftests only once.

Now that the tests are run only through cpumask_success_testscases, add
to it the missing test_refcount_null_tracking testcase. Also remove the
__success annotation from it, since it is now loaded and invoked by the
runner.

Signed-off-by: Emil Tsalapatis (Meta) <emil@etsalapatis.com>
Acked-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250309230427.26603-5-emil@etsalapatis.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Emil Tsalapatis and committed by
Alexei Starovoitov
c06707ff 014eb5c2

+1 -2
+1 -1
tools/testing/selftests/bpf/prog_tests/cpumask.c
··· 25 25 "test_global_mask_nested_deep_rcu", 26 26 "test_global_mask_nested_deep_array_rcu", 27 27 "test_cpumask_weight", 28 + "test_refcount_null_tracking", 28 29 "test_populate_reject_small_mask", 29 30 "test_populate_reject_unaligned", 30 31 "test_populate", ··· 82 81 verify_success(cpumask_success_testcases[i]); 83 82 } 84 83 85 - RUN_TESTS(cpumask_success); 86 84 RUN_TESTS(cpumask_failure); 87 85 }
-1
tools/testing/selftests/bpf/progs/cpumask_success.c
··· 749 749 } 750 750 751 751 SEC("tp_btf/task_newtask") 752 - __success 753 752 int BPF_PROG(test_refcount_null_tracking, struct task_struct *task, u64 clone_flags) 754 753 { 755 754 struct bpf_cpumask *mask1, *mask2;