selftests/bpf: Replace CHECK with ASSERT_* in ns_current_pid_tgid test
authorYonghong Song <yonghong.song@linux.dev>
Fri, 15 Mar 2024 18:48:59 +0000 (11:48 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 19 Mar 2024 21:24:37 +0000 (14:24 -0700)
commit84239a24d10174fcfc7d6760cb120435a6ff69af
tree9590038ef860dc7d5a538b15bbd15d30144dcd16
parenteb166e522c77699fc19bfa705652327a1e51a117
selftests/bpf: Replace CHECK with ASSERT_* in ns_current_pid_tgid test

Replace CHECK in selftest ns_current_pid_tgid with recommended ASSERT_* style.
I also shortened subtest name as the prefix of subtest name is covered
by the test name already.

This patch does fix a testing issue. Currently even if bss->user_{pid,tgid}
is not correct, the test still passed since the clone func returns 0.
I fixed it to return a non-zero value if bss->user_{pid,tgid} is incorrect.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20240315184859.2975543-1-yonghong.song@linux.dev
tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c