linux/lib/kunit
Scott Mayhew 5496b9b77d kunit: bail out early in __kunit_test_suites_init() if there are no suites to test
Commit c72a870926 added a mutex to prevent kunit tests from running
concurrently.  Unfortunately that mutex gets locked during module load
regardless of whether the module actually has any kunit tests.  This
causes a problem for kunit tests that might need to load other kernel
modules (e.g. gss_krb5_test loading the camellia module).

So check to see if there are actually any tests to run before locking
the kunit_run_lock mutex.

Fixes: c72a870926 ("kunit: add ability to run tests after boot using debugfs")
Reported-by: Nico Pache <npache@redhat.com>
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2024-05-06 14:22:02 -06:00
..
.kunitconfig
assert.c
attributes.c
debugfs.c
debugfs.h
device-impl.h
device.c kunit: unregister the device on error 2024-05-06 14:22:02 -06:00
executor.c
executor_test.c
hooks-impl.h
hooks.c
Kconfig kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option 2024-05-06 14:22:02 -06:00
kunit-example-test.c
kunit-test.c kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option 2024-05-06 14:22:02 -06:00
Makefile
resource.c
static_stub.c
string-stream-test.c kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER 2024-05-06 14:22:02 -06:00
string-stream.c
string-stream.h
test.c kunit: bail out early in __kunit_test_suites_init() if there are no suites to test 2024-05-06 14:22:02 -06:00
try-catch-impl.h
try-catch.c kunit: Fix race condition in try-catch completion 2024-05-06 14:22:02 -06:00