Re: [PATCH v6 4/4] selftests: bpf: add missing test to runner

Hou Tao
2025-03-08T01:34:11Z

Hi,

On 3/7/2025 11:38 PM, Emil Tsalapatis wrote:
> BPF cpumask selftests need to be added to bpf/prog_tests/cpumask.c to be
> run. However, the test_refcount_null_tracking is missing from the main
> test file. Add the missing test name to properly trigger the selftest.
>
> Signed-off-by: Emil Tsalapatis (Meta) <emil@etsalapatis.com>
> ---
> tools/testing/selftests/bpf/prog_tests/cpumask.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/cpumask.c b/tools/testing/selftests/bpf/prog_tests/cpumask.c
> index 9b09beba988b..447a6e362fcd 100644
> --- a/tools/testing/selftests/bpf/prog_tests/cpumask.c
> +++ b/tools/testing/selftests/bpf/prog_tests/cpumask.c
> @@ -25,6 +25,7 @@ static const char * const cpumask_success_testcases[] = {
> "test_global_mask_nested_deep_rcu",
> "test_global_mask_nested_deep_array_rcu",
> "test_cpumask_weight",
> + "test_refcount_null_tracking",
> "test_populate_reject_small_mask",
> "test_populate_reject_unaligned",
> "test_populate",

Just find out that the invocation of RUN_TESTS(cpumask_success) will
lead to the double test result output for every program in the
cpumask_success.c. Considering we have test the loading of
test_refcount_null_tracking program through cpumask_success_testcases.
It would be better to remove the __success annotation for
test_refcount_null_tracking and the invocation of
RUN_TESTS(cpumask_success) as well.