linux/lib/kunit
Rae Moar c72a870926 kunit: add ability to run tests after boot using debugfs
Add functionality to run built-in tests after boot by writing to a
debugfs file.

Add a new debugfs file labeled "run" for each test suite to use for
this purpose.

As an example, write to the file using the following:

echo "any string" > /sys/kernel/debugfs/kunit/<testsuite>/run

This will trigger the test suite to run and will print results to the
kernel log.

To guard against running tests concurrently with this feature, add a
mutex lock around running kunit. This supports the current practice of
not allowing tests to be run concurrently on the same kernel.

This new functionality could be used to design a parameter
injection feature in the future.

Fixed up merge conflict duing rebase to Linux 6.7-rc6
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Rae Moar <rmoar@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-12-18 13:25:49 -07:00
..
.kunitconfig
assert.c kunit: Don't use a managed alloc in is_literal() 2023-09-18 10:45:30 -06:00
attributes.c kunit: add is_init test attribute 2023-12-18 13:21:15 -07:00
debugfs.c kunit: add ability to run tests after boot using debugfs 2023-12-18 13:25:49 -07:00
debugfs.h
executor_test.c kunit: test: Fix the possible memory leak in executor_test 2023-09-28 08:51:07 -06:00
executor.c kunit: add is_init test attribute 2023-12-18 13:21:15 -07:00
hooks-impl.h
hooks.c
Kconfig kunit: Allow kunit test modules to use test filtering 2023-08-08 13:46:18 -06:00
kunit-example-test.c kunit: add example suite to test init suites 2023-12-18 13:21:15 -07:00
kunit-test.c kunit: Add a macro to wrap a deferred action function 2023-12-18 13:21:14 -07:00
Makefile
resource.c
static_stub.c
string-stream-test.c kunit: string-stream-test: Avoid cast warning when testing gfp_t flags 2023-12-18 13:21:14 -07:00
string-stream.c kunit: string-stream: Allow ERR_PTR to be passed to string_stream_destroy() 2023-12-18 13:21:14 -07:00
string-stream.h kunit: string-stream: Decouple string_stream from kunit 2023-09-18 10:45:40 -06:00
test.c kunit: add ability to run tests after boot using debugfs 2023-12-18 13:25:49 -07:00
try-catch-impl.h
try-catch.c