linux-stable/lib/kunit
Scott Mayhew a5ac124bdd kunit: bail out early in __kunit_test_suites_init() if there are no suites to test
[ Upstream commit 5496b9b77d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-30 09:49:21 +02:00
..
.kunitconfig kunit: tool: make --kunitconfig accept dirs, add lib/kunit fragment 2021-04-02 14:14:36 -06:00
Kconfig kunit: Allow kunit test modules to use test filtering 2023-08-08 13:46:18 -06:00
Makefile kunit: Add APIs for managing devices 2023-12-18 13:28:08 -07:00
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
device-impl.h kunit: device: Unregister the kunit_bus on shutdown 2024-02-06 17:07:37 -07:00
device.c kunit: unregister the device on error 2024-05-30 09:49:21 +02:00
executor.c kunit: run test suites only after module initialization completes 2024-01-22 07:58:54 -07:00
executor_test.c kunit: test: Log the correct filter string in executor_test 2024-03-26 18:16:28 -04:00
hooks-impl.h kunit: Add printf attribute to fail_current_test_impl 2023-02-08 18:08:14 -07:00
hooks.c kunit: Add "hooks" to call into KUnit when it's built as a module 2023-02-08 14:26:25 -07:00
kunit-example-test.c kunit: Add example of kunit_activate_static_stub() with pointer-to-function 2024-01-03 09:07:23 -07:00
kunit-test.c kunit: Fix a NULL vs IS_ERR() bug 2024-01-22 07:58:12 -07:00
resource.c kunit: Add kunit_add_action() to defer a call until test exit 2023-05-25 08:52:55 -06:00
static_stub.c kunit: Expose 'static stub' API to redirect functions 2023-02-08 14:28:17 -07:00
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: bail out early in __kunit_test_suites_init() if there are no suites to test 2024-05-30 09:49:21 +02:00
try-catch-impl.h
try-catch.c kunit: Fix kthread reference 2024-05-30 09:49:21 +02:00