diff options
author | Daniel Müller <[email protected]> | 2023-05-25 23:22:48 +0000 |
---|---|---|
committer | Andrii Nakryiko <[email protected]> | 2023-05-25 16:51:05 -0700 |
commit | 321a64b328156fd43d3be589c24905a641c7995b (patch) | |
tree | 3b3e65cbb5e5b98a9e1a9352847cd81111cf710f | |
parent | 4c857a719bf9c5ddbcf3bd92398632041bff50d0 (diff) |
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.
Signed-off-by: Daniel Müller <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/sockopt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/sockopt.c b/tools/testing/selftests/bpf/prog_tests/sockopt.c index 33dd4532e642..9e6a5e3ed4de 100644 --- a/tools/testing/selftests/bpf/prog_tests/sockopt.c +++ b/tools/testing/selftests/bpf/prog_tests/sockopt.c @@ -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); } |