Skip to content

Commit c06707f

Browse files
etsalAlexei Starovoitov
authored andcommitted
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) <[email protected]> Acked-by: Hou Tao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 014eb5c commit c06707f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

tools/testing/selftests/bpf/prog_tests/cpumask.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static const char * const cpumask_success_testcases[] = {
2525
"test_global_mask_nested_deep_rcu",
2626
"test_global_mask_nested_deep_array_rcu",
2727
"test_cpumask_weight",
28+
"test_refcount_null_tracking",
2829
"test_populate_reject_small_mask",
2930
"test_populate_reject_unaligned",
3031
"test_populate",
@@ -81,6 +82,5 @@ void test_cpumask(void)
8182
verify_success(cpumask_success_testcases[i]);
8283
}
8384

84-
RUN_TESTS(cpumask_success);
8585
RUN_TESTS(cpumask_failure);
8686
}

tools/testing/selftests/bpf/progs/cpumask_success.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,6 @@ int BPF_PROG(test_cpumask_weight, struct task_struct *task, u64 clone_flags)
749749
}
750750

751751
SEC("tp_btf/task_newtask")
752-
__success
753752
int BPF_PROG(test_refcount_null_tracking, struct task_struct *task, u64 clone_flags)
754753
{
755754
struct bpf_cpumask *mask1, *mask2;

0 commit comments

Comments
 (0)