Skip to content

Separate tests that need error injection

Viktor Malik bpf 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 11 repliesIn review
  2. v23 patches 2 repliesSuperseded
  3. v13 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Replace return by goto cleanup when skeleton is already open (found by AI review)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3selftests/bpf: Split module_attach into subteststools/testing/selftests/bpf/prog_tests/module_attach.c tools/testing/selftests/bpf/progs/test_module_attach.c+149 -820 replies
2/3selftests/bpf: Split read_vsyscall into subteststools/testing/selftests/bpf/prog_tests/read_vsyscall.c tools/testing/selftests/bpf/progs/read_vsyscall.c+44 -150 replies
3/3selftests/bpf: Split sleepable fentry from LSM testtools/testing/selftests/bpf/prog_tests/fentry_sleepable.c tools/testing/selftests/bpf/prog_tests/test_lsm.c tools/testing/selftests/bpf/progs/fentry_sleepable.c +1 more+56 -290 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/3] Separate tests that need error injection

Some enterprise kernels (such as RHEL) do not enable error injection via BPF (CONFIG_FUNCTION_ERROR_INJECTION and CONFIG_BPF_KPROBE_OVERRIDE). When running test_progs on such kernels, a lot of test cases fail since they use sleepable fentry or fmod_ret program types which require error injection to be enabled. While it is possible to skip these via custom DENYLIST, some test_progs are not properly split into subtests and therefore must be entirely skipped.

This patch series split such tests into subtests, namely module_attach and read_vsyscall. In addition, the last patch separates a sleepable fentry test out of the LSM test suite into a separate test so that it can be skipped without skipping other LSM tests.

Changes in v3:
- Replace return by goto cleanup when skeleton is already open (found by AI review)

Changes in v2:
- Fix indices in read_vsyscall/copy_from_user subtest (reported by CI)

Viktor Malik (3):
selftests/bpf: Split module_attach into subtests selftests/bpf: Split read_vsyscall into subtests selftests/bpf: Split sleepable fentry from LSM test

 .../bpf/prog_tests/fentry_sleepable.c         |  28 +++
 .../selftests/bpf/prog_tests/module_attach.c  | 168 +++++++++++++-----
 .../selftests/bpf/prog_tests/read_vsyscall.c  |  41 ++++-
 .../selftests/bpf/prog_tests/test_lsm.c       |   8 -
 .../selftests/bpf/progs/fentry_sleepable.c    |  28 +++
 tools/testing/selftests/bpf/progs/lsm.c       |  21 ---
 .../selftests/bpf/progs/read_vsyscall.c       |  18 +-
 .../selftests/bpf/progs/test_module_attach.c  |  63 +++----
 8 files changed, 249 insertions(+), 126 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/fentry_sleepable.c
 create mode 100644 tools/testing/selftests/bpf/progs/fentry_sleepable.c
Signature · 1 line
2.53.0