Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH 0/2] kunit: add boot time parameter to enable KUnit
@ 2022-08-17 16:48 Joe Fradley
  2022-08-17 16:48 ` [PATCH 1/2] kunit: add kunit.enable to enable/disable KUnit test Joe Fradley
  2022-08-17 16:48 ` [PATCH 2/2] kunit: no longer call module_info(test, "Y") for kunit modules Joe Fradley
  0 siblings, 2 replies; 8+ messages in thread
From: Joe Fradley @ 2022-08-17 16:48 UTC (permalink / raw)
  To: Jonathan Corbet, Brendan Higgins, David Gow
  Cc: Joe Fradley, kernel-team, linux-doc, linux-kernel,
	linux-kselftest, kunit-dev

There are some use cases where the kernel binary is desired to be the same
for both production and testing. This poses a problem for users of KUnit
as built-in tests will automatically run at startup and test modules
can still be loaded leaving the kernel in an unsafe state. There is a
"test" taint flag that gets set if a test runs but nothing to prevent
the execution.

This patch adds the kunit.enable module parameter that will need to be
set to true in addition to KUNIT being enabled for KUnit tests to run.
The default value is true giving backwards compatibility. However, for
the production+testing use case the new config option
KUNIT_ENABLE_DEFAULT_DISABLED can be enabled to default kunit.enable to
false requiring the tester to opt-in by passing kunit.enable=1 to
the kernel.

Joe Fradley (2):
  kunit: add kunit.enable to enable/disable KUnit test
  kunit: no longer call module_info(test, "Y") for kunit modules

 .../admin-guide/kernel-parameters.txt         |  6 ++++++
 include/kunit/test.h                          |  1 -
 lib/kunit/Kconfig                             |  8 ++++++++
 lib/kunit/test.c                              | 20 +++++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)

-- 
2.37.1.595.g718a3a8f04-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-22 20:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-17 16:48 [PATCH 0/2] kunit: add boot time parameter to enable KUnit Joe Fradley
2022-08-17 16:48 ` [PATCH 1/2] kunit: add kunit.enable to enable/disable KUnit test Joe Fradley
2022-08-19  8:16   ` David Gow
2022-08-22 20:37     ` Joe Fradley
2022-08-17 16:48 ` [PATCH 2/2] kunit: no longer call module_info(test, "Y") for kunit modules Joe Fradley
2022-08-19  8:34   ` David Gow
2022-08-22 20:47     ` Joe Fradley
2022-08-22 20:57   ` Brendan Higgins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox