linux_kselftest-kunit-6.19-rc1

Makes filter parameters configurable via Kconfig.
 Adds description of kunit.enable parameter documentation.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAmkvebAACgkQCwJExA0N
 Qxw+WQ/9FsRM52lyWrZdJFTJQ5+c/im7xi5h/S9eIpGQ61ZiNtnuGPQbmNtlXVVH
 EaL3/OQuZic3srx4tTpTOS5iJl3+OLFi9sjIxQ6341OeHjOtvaPm+9i6zCxrgkqM
 64EnXi8IKiXnam6kFJGoQbn/Xkhsxh+1jreHgZHfiVPg3gxysp75sxzPQL1Lt1Ml
 jZxyPQFSqTJnyP2xq+c1qK5jskXkCQiXPQAcPEItEFmsH//ZTUa8rhk8xlW1LQNn
 Nz5C2I1/HRAHppM2DEcehsxnGOGxNu76x/vjHZ3w8D+tV3AzJtCy+NxVIaS3Xc4K
 9egMVTwDOsnX1gx7wqJ8YBAD+2K1MWMFm5R/7guppImZa35oCmqFnrZ+cifgGU8l
 /1SqEmF/PZ18T+EIjEfnWVDL0dHX3uZTwzx+eMj8pLnIfBnGZC2elqTrg4zhJD2M
 khIJ8Szc43YOk33tkKrcUmyWcQTjQ0h3UejKLZ8MfSQgTSYPa/W/0gxMKn648a7s
 JeJ6F2LQ5Fyt1hbzp3arFY8DxVvW3Ks6G9EhNWFhwhNPMjmcCXpKLc4A1Fy8UlXH
 4oyZvorKOUqdcHBRP6nIYiuJWwZ0qjb/p7REq50GTk6MnJlbuAlZ/FxP8oFN6fEl
 va6pCONKRx/m05qZB7EvomhQs1KSSyFodBO9cRpFZyL1FXNgQGQ=
 =6Rqh
 -----END PGP SIGNATURE-----

Merge tag 'linux_kselftest-kunit-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kunit updates from Shuah Khan:

 - Make filter parameters configurable via Kconfig

 - Add description of kunit.enable parameter to documentation

* tag 'linux_kselftest-kunit-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kunit: Make filter parameters configurable via Kconfig
  Documentation: kunit: add description of kunit.enable parameter
pull/1354/merge
Linus Torvalds 2025-12-03 15:50:11 -08:00
commit b6d993310a
3 changed files with 35 additions and 3 deletions

View File

@ -35,6 +35,12 @@ or be built into the kernel.
a good way of quickly testing everything applicable to the current a good way of quickly testing everything applicable to the current
config. config.
KUnit can be enabled or disabled at boot time, and this behavior is
controlled by the kunit.enable kernel parameter.
By default, kunit.enable is set to 1 because KUNIT_DEFAULT_ENABLED is
enabled by default. To ensure that tests are executed as expected,
verify that kunit.enable=1 at boot time.
Once we have built our kernel (and/or modules), it is simple to run Once we have built our kernel (and/or modules), it is simple to run
the tests. If the tests are built-in, they will run automatically on the the tests. If the tests are built-in, they will run automatically on the
kernel boot. The results will be written to the kernel log (``dmesg``) kernel boot. The results will be written to the kernel log (``dmesg``)

View File

@ -93,6 +93,30 @@ config KUNIT_AUTORUN_ENABLED
In most cases this should be left as Y. Only if additional opt-in In most cases this should be left as Y. Only if additional opt-in
behavior is needed should this be set to N. behavior is needed should this be set to N.
config KUNIT_DEFAULT_FILTER_GLOB
string "Default value of the filter_glob module parameter"
help
Sets the default value of kunit.filter_glob. If set to a non-empty
string only matching tests are executed.
If unsure, leave empty so all tests are executed.
config KUNIT_DEFAULT_FILTER
string "Default value of the filter module parameter"
help
Sets the default value of kunit.filter. If set to a non-empty
string only matching tests are executed.
If unsure, leave empty so all tests are executed.
config KUNIT_DEFAULT_FILTER_ACTION
string "Default value of the filter_action module parameter"
help
Sets the default value of kunit.filter_action. If set to a non-empty
string only matching tests are executed.
If unsure, leave empty so all tests are executed.
config KUNIT_DEFAULT_TIMEOUT config KUNIT_DEFAULT_TIMEOUT
int "Default value of the timeout module parameter" int "Default value of the timeout module parameter"
default 300 default 300

View File

@ -45,9 +45,11 @@ bool kunit_autorun(void)
return autorun_param; return autorun_param;
} }
static char *filter_glob_param; #define PARAM_FROM_CONFIG(config) (config[0] ? config : NULL)
static char *filter_param;
static char *filter_action_param; static char *filter_glob_param = PARAM_FROM_CONFIG(CONFIG_KUNIT_DEFAULT_FILTER_GLOB);
static char *filter_param = PARAM_FROM_CONFIG(CONFIG_KUNIT_DEFAULT_FILTER);
static char *filter_action_param = PARAM_FROM_CONFIG(CONFIG_KUNIT_DEFAULT_FILTER_ACTION);
module_param_named(filter_glob, filter_glob_param, charp, 0600); module_param_named(filter_glob, filter_glob_param, charp, 0600);
MODULE_PARM_DESC(filter_glob, MODULE_PARM_DESC(filter_glob,