Skip to content

kunit: Add test attributes API

Rae Moar linux-hardening linux-kselftest lkml oe-kbuild oe-kbuild-all 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest9 patches 10 repliesIn review
  2. v2 posting 2/29 patches 6 repliesSuperseded
  3. v2 RFC posting 1/29 patches 17 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC6 patches14 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9kunit: Add test attributes API structureinclude/kunit/attributes.h include/kunit/test.h lib/kunit/Makefile +3 more+161 -120 replies
2/9kunit: Add speed attributeinclude/kunit/test.h lib/kunit/attributes.c lib/kunit/kunit-example-test.c+83 -20 replies
3/9kunit: Add module attributeinclude/kunit/test.h lib/kunit/attributes.c+33 -50 replies
4/9kunit: Add ability to filter attributesinclude/kunit/attributes.h lib/kunit/attributes.c lib/kunit/executor.c +2 more+389 -285 replies
5/9kunit: tool: Add command line interface to filter and report attributestools/testing/kunit/kunit.py tools/testing/kunit/kunit_kernel.py tools/testing/kunit/kunit_parser.py +1 more+99 -290 replies
6/9kunit: memcpy: Mark tests as slow using test attributeslib/Kconfig.debug lib/memcpy_kunit.c+7 -40 replies
7/9kunit: time: Mark test as slow using test attributeskernel/time/time_test.c+1 -10 replies
8/9kunit: add tests for filtering attributeslib/kunit/executor_test.c+116 -00 replies
9/9kunit: Add documentation of KUnit test attributesDocumentation/dev-tools/kunit/run_wrapper.rst Documentation/dev-tools/kunit/running_tips.rst+178 -00 replies

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid GowKees CookArthur Grillo
SeriesR-b R-b
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b A-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/9] kunit: Add test attributes API

Hello everyone,

This patch series adds a test attributes framework to KUnit.

There has been interest in filtering out "slow" KUnit tests. Most notably, a new config, CONFIG_MEMCPY_SLOW_KUNIT_TEST, has been added to exclude a particularly slow memcpy test
(https://lore.kernel.org/all/[email protected]/).

This attributes framework can be used to save and access test associated data, including whether a test is slow. These attributes are reportable (via KTAP and command line output) and are also filterable.

This framework is designed to allow for the addition of other attributes in the future. These attributes could include whether the test can be run concurrently, test file path, etc.

To try out the framework I suggest running:
"./tools/testing/kunit/kunit.py run --filter speed!=slow"

This patch series was originally sent out as an RFC. Here is a link to the RFC v2:
https://lore.kernel.org/all/[email protected]/

Thanks!
Rae

Rae Moar (9):
kunit: Add test attributes API structure
kunit: Add speed attribute
kunit: Add module attribute
kunit: Add ability to filter attributes
kunit: tool: Add command line interface to filter and report
attributes
kunit: memcpy: Mark tests as slow using test attributes
kunit: time: Mark test as slow using test attributes
kunit: add tests for filtering attributes
kunit: Add documentation of KUnit test attributes

 Documentation/dev-tools/kunit/run_wrapper.rst |  12 +
 .../dev-tools/kunit/running_tips.rst          | 166 +++++++
 include/kunit/attributes.h                    |  50 +++
 include/kunit/test.h                          |  70 ++-
 kernel/time/time_test.c                       |   2 +-
 lib/Kconfig.debug                             |   3 +
 lib/kunit/Makefile                            |   3 +-
 lib/kunit/attributes.c                        | 418 ++++++++++++++++++
 lib/kunit/executor.c                          | 114 ++++-
 lib/kunit/executor_test.c                     | 128 +++++-
 lib/kunit/kunit-example-test.c                |   9 +
 lib/kunit/test.c                              |  27 +-
 lib/memcpy_kunit.c                            |   8 +-
 tools/testing/kunit/kunit.py                  |  70 ++-
 tools/testing/kunit/kunit_kernel.py           |   8 +-
 tools/testing/kunit/kunit_parser.py           |  11 +-
 tools/testing/kunit/kunit_tool_test.py        |  39 +-
 17 files changed, 1062 insertions(+), 76 deletions(-)
 create mode 100644 include/kunit/attributes.h
 create mode 100644 lib/kunit/attributes.c

base-commit: 64bd4641310c41a1ecf07c13c67bc0ed61045dfd

Signature · 1 line
2.41.0.487.g6d72f3e995-goog