selftests/bpf: Check whether to run selftest
Subsystems (3)
PATCH 1/1 selftests/bpf: Check whether to run selftest
The sockopt test invokes test__start_subtest and then unconditionally asserts the success. That means that even if deny-listed, any test will still run and potentially fail.
Evaluate the return value of test__start_subtest() to achieve the desired behavior, as other tests do.
--- tools/testing/selftests/bpf/prog_tests/sockopt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/sockopt.c +3 -1
@@ -1060,7 +1060,9 @@ void test_sockopt(void)return ;for (i =0 ; i <ARRAY_SIZE (tests); i++) { -test__start_subtest (tests[i].descr); +if (!test__start_subtest (tests[i].descr)) +continue ; +ASSERT_OK (run_test (cgroup_fd, &tests[i]), tests[i].descr); }
Signature · 1 line
2.34.1
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 9 lines · On Thu, 25 May 2023 23:22:48 +0000 you wrote:
The sockopt test invokes
test__start_subtestand then unconditionally asserts the success. That means that even if deny-listed, any test will still run and potentially fail.
Evaluate the return value oftest__start_subtest()to achieve the desired behavior, as other tests do.Signed-off-by Daniel Müller <[email protected]>[...]
Here is the summary with links:
- [bpf-next] selftests/bpf: Check whether to run selftest
https://git.kernel.org/bpf/bpf-next/c/321a64b32815
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html