Skip to content

Add support for KUnit tests

Isabella Basso dri-devel igt-dev linux-kselftest lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 26 repliesIn review
  2. v12 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Major rework of parsing function structure:
- It is not longer recursive
- Adapt kselftests functions and structs to be used with KUnit
- Switch DRM selftests to KUnit parsing as they're updated in the kernel
- Replace AMD KUnit tests by DRM selftests

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lib/igt_kmod: rename kselftest functions to ktestlib/igt_kmod.c lib/igt_kmod.h+17 -171 reply
2/4lib/igt_kmod.c: check if module is builtin before attempting to unload itlib/igt_kmod.c+3 -02 replies
3/4lib/igt_kmod: add compatibility for KUnitlib/igt_kmod.c lib/igt_kmod.h+292 -017 replies
4/4tests: DRM selftests: switch to KUnittests/drm_buddy.c tests/drm_mm.c tests/kms_selftest.c+17 -95 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchJanusz Krzysztofik
1/4R-b
2/4A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH i-g-t v2 0/4] Add support for KUnit tests

This patch series was first developed as part of the LKCamp hackathon that happened last year[1], mainly focusing on refactoring DRM tests to use KUnit.

KUnit[2][3] is a unified test framework that provides helper tools, simplifying their development and execution. Using an x86-64 machine it's possible to run tests in the host's kernel natively using user-mode Linux[4] (aka UML), which simplifies usage in a wide variety of scenarios, including integration to CI.

As the tool's adoption widens into graphics testing territory, I and LKCamp members figured it would be important to support it in IGT, as it's a core tool for GPU drivers maintainers.

I have then added KUnit support into IGT mainly following the KTAP specs, and it can be tested using patch 4/4 in this series together with a DRM selftests patch series available at [5].

Changes since v1:
- Major rework of parsing function structure:
- It is not longer recursive
- Adapt kselftests functions and structs to be used with KUnit
- Switch DRM selftests to KUnit parsing as they're updated in the kernel
- Replace AMD KUnit tests by DRM selftests

[1]: https://groups.google.com/g/kunit-dev/c/YqFR1q2uZvk/m/IbvItSfHBAAJ
[2]: https://kunit.dev
[3]: https://docs.kernel.org/dev-tools/kunit/index.html
[4]: http://user-mode-linux.sourceforge.net
[5]: https://lore.kernel.org/all/[email protected]/

Isabella Basso (4):
lib/igt_kmod: rename kselftest functions to ktest lib/igt_kmod.c: check if module is builtin before attempting to unload
it
lib/igt_kmod: add compatibility for KUnit
tests: DRM selftests: switch to KUnit

 lib/igt_kmod.c       | 315 +++++++++++++++++++++++++++++++++++++++++--
 lib/igt_kmod.h       |  14 +-
 tests/drm_buddy.c    |   7 +-
 tests/drm_mm.c       |   7 +-
 tests/kms_selftest.c |  12 +-
 5 files changed, 329 insertions(+), 26 deletions(-)
Signature · 1 line
2.37.2