Skip to content

selftests/bpf: Fix prog_tests framework self-tests

KaFai Wan bpf linux-kselftest lkml 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3selftests/bpf: Fix prog_tests framework subtest count checkstools/testing/selftests/bpf/prog_tests/prog_tests_framework.c+8 -20 repliesApplied
2/3selftests/bpf: Skip expected_msgs subtests when stdout is not savedtools/testing/selftests/bpf/prog_tests/prog_tests_framework.c+6 -00 repliesApplied
3/3selftests/bpf: Skip compare_text subtest when stdout is not savedtools/testing/selftests/bpf/prog_tests/prog_tests_framework.c+11 -70 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] selftests/bpf: Fix prog_tests framework self-tests

Three prog_tests framework self-tests fail depending on how test_progs is invoked:

- ./test_progs -t prog_tests_framework/test_fail -v test_prog_tests_framework:FAIL:skip_cnt_check unexpected skip_cnt_check: actual 0 != expected 2

- ./test_progs -t prog_tests_framework_expected_msgs -v Caught signal #11!
Stack trace:
./test_progs(crash_handler+0x38)[0x55620006fbb0]

- ./test_progs -t prog_tests_framework_compare_text -v test_prog_tests_framework_compare_text:PASS:mismatch_rc 0 nsec Caught signal #11!
Stack trace:
./test_progs(crash_handler+0x38)[0x564ddbfcfbb0]

Patch #1 counts the subtests that actually ran, so the skip and error count checks no longer fail when -t or -n filters out some subtests.

Patches #2 and #3 skip the subtests that inspect the log buffer when the output is not captured, such as with -v in non-parallel mode, instead of crashing on a NULL log_buf.

---
KaFai Wan (3):
selftests/bpf: Fix prog_tests framework subtest count checks selftests/bpf: Skip expected_msgs subtests when stdout is not saved selftests/bpf: Skip compare_text subtest when stdout is not saved

 .../bpf/prog_tests/prog_tests_framework.c     | 34 ++++++++++++++-----
 1 file changed, 25 insertions(+), 9 deletions(-)
Signature · 1 line
2.43.0