lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251106-kunit-filter-kconfig-v1-1-d723fb7ac221@linutronix.de>
Date: Thu, 06 Nov 2025 11:32:39 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Brendan Higgins <brendan.higgins@...ux.dev>, 
 David Gow <davidgow@...gle.com>, Rae Moar <rmoar@...gle.com>
Cc: linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com, 
 linux-kernel@...r.kernel.org, 
 Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH] kunit: Make filter parameters configurable via Kconfig

Enable the preset of filter parameters from kconfig options, similar to
how other KUnit configuration parameters are handled already.
This is useful to run a subset of tests even if the cmdline is not
readily modifyable.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
 lib/kunit/Kconfig    | 24 ++++++++++++++++++++++++
 lib/kunit/executor.c |  8 +++++---
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/lib/kunit/Kconfig b/lib/kunit/Kconfig
index 7a6af361d2fc6276b9667be8c694b0c80e33c1e8..50ecf55d2b9c8a82f2aff7a0b4156bd6179b0a2f 100644
--- a/lib/kunit/Kconfig
+++ b/lib/kunit/Kconfig
@@ -93,6 +93,30 @@ config KUNIT_AUTORUN_ENABLED
 	  In most cases this should be left as Y. Only if additional opt-in
 	  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
 	int "Default value of the timeout module parameter"
 	default 300
diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c
index 0061d4c7e35170634a3c1d1cff7179037fb8ba07..02ff380ab7938cfac2be3f8c0e7630a78961cc3d 100644
--- a/lib/kunit/executor.c
+++ b/lib/kunit/executor.c
@@ -45,9 +45,11 @@ bool kunit_autorun(void)
 	return autorun_param;
 }
 
-static char *filter_glob_param;
-static char *filter_param;
-static char *filter_action_param;
+#define PARAM_FROM_CONFIG(config) (config[0] ? config : NULL)
+
+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_PARM_DESC(filter_glob,

---
base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
change-id: 20251106-kunit-filter-kconfig-f08998936fc6

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@...utronix.de>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ