* [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs
@ 2026-04-02 12:13 Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 01/17] syscalls: ioctl08: Remove .needs_drivers Cyril Hrubis
` (17 more replies)
0 siblings, 18 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
The needs_drivers and needs_kconfigs options had overlapping
functionality. This patchset gets rid of needs_drivers by adding module
checks to needs_kconfigs.
Cyril Hrubis (17):
syscalls: ioctl08: Remove .needs_drivers
lib: shell: Remove needs_drivers from JSON parser
lib: tst_kernel: Add tst_check_module_driver()
lib: tst_kconfig: Add module presence checks
tests: kvm: Switch from needs_drivers to needs_kconfigs
tests: zram03: Switch from needs_drivers to needs_kconfigs
tests: squashfs01: Switch from needs_drivers to needs_kconfigs
tests: ioctl: Switch from needs_drivers to needs_kconfigs
tests: madvise11: Switch from needs_drivers to needs_kconfigs
tests: quotactl: Switch from needs_drivers to needs_kconfigs
tests: uevent: Switch from needs_drivers to needs_kconfigs
cve: tcindex01: Switch from needs_drivers to needs_kconfigs
tests: can: Switch from needs_drivers to needs_kconfigs
tests: fsetxattr: Switch from needs_drivers to needs_kconfigs
sctp: Switch from needs_drivers to needs_kconfigs
lib: tst_test: Remove now unused needs_drivers
doc: metadata: Remove needs_drivers from docs
doc/developers/writing_tests.rst | 3 --
doc/old/C-Test-API.asciidoc | 13 +++---
include/tst_kernel.h | 10 +++++
include/tst_test.h | 5 ---
lib/tst_kconfig.c | 41 +++++++++++++++++++
lib/tst_kernel.c | 12 +++---
lib/tst_test.c | 9 ----
metadata/README.md | 15 +++----
testcases/cve/tcindex01.c | 5 +--
testcases/kernel/device-drivers/zram/zram03.c | 4 +-
testcases/kernel/fs/squashfs/squashfs01.c | 4 +-
testcases/kernel/kvm/kvm_pagefault01.c | 4 +-
testcases/kernel/kvm/kvm_svm01.c | 4 +-
testcases/kernel/kvm/kvm_svm02.c | 4 +-
testcases/kernel/kvm/kvm_svm03.c | 4 +-
testcases/kernel/kvm/kvm_svm04.c | 4 +-
testcases/kernel/kvm/kvm_vmx01.c | 4 +-
testcases/kernel/kvm/kvm_vmx02.c | 4 +-
.../kernel/syscalls/fsetxattr/fsetxattr02.c | 4 +-
testcases/kernel/syscalls/ioctl/ioctl08.c | 4 --
testcases/kernel/syscalls/ioctl/ioctl09.c | 4 +-
.../kernel/syscalls/ioctl/ioctl_loop01.c | 4 +-
.../kernel/syscalls/ioctl/ioctl_loop02.c | 4 +-
.../kernel/syscalls/ioctl/ioctl_loop03.c | 4 +-
.../kernel/syscalls/ioctl/ioctl_loop04.c | 4 +-
.../kernel/syscalls/ioctl/ioctl_loop05.c | 4 +-
.../kernel/syscalls/ioctl/ioctl_loop06.c | 4 +-
.../kernel/syscalls/ioctl/ioctl_loop07.c | 4 +-
testcases/kernel/syscalls/madvise/madvise11.c | 5 +--
.../kernel/syscalls/quotactl/quotactl01.c | 4 +-
.../kernel/syscalls/quotactl/quotactl04.c | 4 +-
.../kernel/syscalls/quotactl/quotactl06.c | 4 +-
.../kernel/syscalls/quotactl/quotactl08.c | 4 +-
.../kernel/syscalls/quotactl/quotactl09.c | 4 +-
testcases/kernel/uevents/uevent01.c | 4 +-
testcases/kernel/uevents/uevent02.c | 4 +-
testcases/kernel/uevents/uevent03.c | 4 +-
testcases/lib/tst_run_shell.c | 5 ---
testcases/network/can/cve/can_bcm01.c | 6 +--
.../network/can/filter-tests/can_filter.c | 6 +--
.../can/filter-tests/can_rcv_own_msgs.c | 6 +--
.../func_tests/test_1_to_1_initmsg_connect.c | 4 +-
42 files changed, 135 insertions(+), 118 deletions(-)
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* [LTP] [PATCH 01/17] syscalls: ioctl08: Remove .needs_drivers
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 21:34 ` Petr Vorel
2026-04-02 12:13 ` [LTP] [PATCH 02/17] lib: shell: Remove needs_drivers from JSON parser Cyril Hrubis
` (16 subsequent siblings)
17 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
The test already required btrfs filesystem to be mounted by the test
library which means that the test would be skipped properly if btrfs is
not supported. There is no need to have a duplicit check for a btrfs
module.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/ioctl/ioctl08.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/testcases/kernel/syscalls/ioctl/ioctl08.c b/testcases/kernel/syscalls/ioctl/ioctl08.c
index dd6406550..46a2e5fa7 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl08.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl08.c
@@ -129,10 +129,6 @@ static struct tst_test test = {
{.type = "btrfs"},
{}
},
- .needs_drivers = (const char *const[]) {
- "btrfs",
- NULL,
- },
};
#else
TST_TEST_TCONF(
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 02/17] lib: shell: Remove needs_drivers from JSON parser
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 01/17] syscalls: ioctl08: Remove .needs_drivers Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 21:29 ` Petr Vorel
2026-04-02 12:13 ` [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver() Cyril Hrubis
` (15 subsequent siblings)
17 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
No shell tests were using it at the moment.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/lib/tst_run_shell.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c
index c12361ef5..2778fb6d5 100644
--- a/testcases/lib/tst_run_shell.c
+++ b/testcases/lib/tst_run_shell.c
@@ -68,7 +68,6 @@ enum test_attr_ids {
NEEDS_CMDS,
NEEDS_DEVFS,
NEEDS_DEVICE,
- NEEDS_DRIVERS,
NEEDS_HUGETLBFS,
NEEDS_KCONFIGS,
NEEDS_ROFS,
@@ -103,7 +102,6 @@ static ujson_obj_attr test_attrs[] = {
UJSON_OBJ_ATTR_IDX(NEEDS_CMDS, "needs_cmds", UJSON_ARR),
UJSON_OBJ_ATTR_IDX(NEEDS_DEVFS, "needs_devfs", UJSON_BOOL),
UJSON_OBJ_ATTR_IDX(NEEDS_DEVICE, "needs_device", UJSON_BOOL),
- UJSON_OBJ_ATTR_IDX(NEEDS_DRIVERS, "needs_drivers", UJSON_ARR),
UJSON_OBJ_ATTR_IDX(NEEDS_HUGETLBFS, "needs_hugetlbfs", UJSON_BOOL),
UJSON_OBJ_ATTR_IDX(NEEDS_KCONFIGS, "needs_kconfigs", UJSON_ARR),
UJSON_OBJ_ATTR_IDX(NEEDS_ROFS, "needs_rofs", UJSON_BOOL),
@@ -512,9 +510,6 @@ static void parse_metadata(void)
case NEEDS_DEVICE:
test.needs_device = val.val_bool;
break;
- case NEEDS_DRIVERS:
- test.needs_drivers = parse_strarr(&reader, &val);
- break;
case NEEDS_HUGETLBFS:
test.needs_hugetlbfs = val.val_bool;
break;
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 01/17] syscalls: ioctl08: Remove .needs_drivers Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 02/17] lib: shell: Remove needs_drivers from JSON parser Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 21:26 ` Petr Vorel
2026-04-02 21:47 ` Petr Vorel
2026-04-02 12:13 ` [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks Cyril Hrubis
` (14 subsequent siblings)
17 siblings, 2 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
This function allows us to check for presence of drivers build as
modules.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
include/tst_kernel.h | 10 ++++++++++
lib/tst_kernel.c | 12 +++++++-----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/include/tst_kernel.h b/include/tst_kernel.h
index 63ecb19a4..d5a4a9625 100644
--- a/include/tst_kernel.h
+++ b/include/tst_kernel.h
@@ -45,6 +45,16 @@ bool tst_abi_bits(int abi);
*/
int tst_check_builtin_driver(const char *driver);
+/**
+ * tst_check_module_driver() - Check if the kernel module is present.
+ *
+ * @driver: the name of the driver.
+ *
+ * Return: 0 if module driver is present or -1 when driver is missing or config file not
+ * available. On Android *always* 0 (always expect the module is present).
+ */
+int tst_check_module_driver(const char *driver);
+
/**
* tst_check_driver() - Check support for the kernel module.
*
diff --git a/lib/tst_kernel.c b/lib/tst_kernel.c
index 8bb7e080a..8f7503c02 100644
--- a/lib/tst_kernel.c
+++ b/lib/tst_kernel.c
@@ -200,16 +200,18 @@ static int tst_search_driver(const char *driver, const char *file)
int tst_check_builtin_driver(const char *driver)
{
- if (!tst_search_driver(driver, "modules.builtin"))
- return 0;
+ return tst_search_driver(driver, "modules.builtin");
+}
- return -1;
+int tst_check_module_driver(const char *driver)
+{
+ return tst_search_driver(driver, "modules.dep");
}
int tst_check_driver(const char *driver)
{
- if (!tst_search_driver(driver, "modules.dep") ||
- !tst_check_builtin_driver(driver))
+ if (!tst_check_module_driver(driver) ||
+ !tst_check_builtin_driver(driver))
return 0;
return -1;
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (2 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver() Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-03 3:09 ` Li Wang via ltp
2026-04-02 12:13 ` [LTP] [PATCH 05/17] tests: kvm: Switch from needs_drivers to needs_kconfigs Cyril Hrubis
` (13 subsequent siblings)
17 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
The .needs_kconfig and .needs_drivers fields in the tst_test structure
had overlaping functionality. Both were checking if a functionality was
build in into the kernel or compiled as a driver. Similarily to the
runtime checks added to tst_kconfig modules can be build but packaged
into separate packages and may not be installed on the system even if
corresponding config option was set to 'm'.
This commit adds a mapping table from CONFIG options to module names for
the modules we care about. Most of the time the mapping is trivial, but
some CONFIG options does not really match the module name, hence we need
a mapping. We may also be able to generate the table from kernel config
infrastructure later on, but at this point the number of options is
small enough to be manageable by hand editing.
Once we have that mapping we can run aditional check for a module
presence if the confing option was set to 'm' and if mapping exists in
order to disable the config option when the module was not found.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
lib/tst_kconfig.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
index 52dd6d726..c5dd97a45 100644
--- a/lib/tst_kconfig.c
+++ b/lib/tst_kconfig.c
@@ -144,6 +144,46 @@ static void runtime_check(struct tst_kconfig_var *var)
}
}
+static struct module_check {
+ const char *config;
+ const char *module_name;
+} module_checks[] = {
+ {"CONFIG_KVM", "kvm"},
+ {"CONFIG_ZRAM", "zram"},
+ {"CONFIG_SQUASHFS", "squashfs"},
+ {"CONFIG_BLK_DEV_LOOP", "loop"},
+ {"CONFIG_TUN", "tun"},
+ {"CONFIG_BLK_DEV_RAM", "brd"},
+ {"CONFIG_HWPOISON_INJECT", "hwpoison_inject"},
+ {"CONFIG_QFMT_V2", "quota_v2"},
+ {"CONFIG_INPUT_UINPUT", "uinput"},
+ {"CONFIG_DUMMY", "dummy"},
+ {"CONFIG_CAN_VCAN", "vcan"},
+ {"CONFIG_CAN_RAW", "can-raw"},
+ {"CONFIG_CAN_BCM", "can-bcm"},
+ {"CONFIG_IP_SCTP", "sctp"},
+ {}
+};
+
+static void module_check(struct tst_kconfig_var *var)
+{
+ size_t i;
+
+ for (i = 0; module_checks[i].config; i++) {
+ if (strcmp(module_checks[i].config, var->id))
+ continue;
+
+ tst_res(TDEBUG, "Running module check for '%s'", var->id);
+
+ if (tst_check_module_driver(module_checks[i].module_name)) {
+ tst_res(TINFO, "%s=%c present but module '%s' not installed",
+ var->id, var->choice, module_checks[i].module_name);
+ var->choice = 'n';
+ return;
+ }
+ }
+}
+
static inline int kconfig_parse_line(const char *line,
struct tst_kconfig_var *vars,
unsigned int vars_len)
@@ -222,6 +262,7 @@ out:
case 'm':
vars[i].choice = 'm';
runtime_check(&vars[i]);
+ module_check(&vars[i]);
return 1;
}
}
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 05/17] tests: kvm: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (3 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 06/17] tests: zram03: " Cyril Hrubis
` (12 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/kvm/kvm_pagefault01.c | 4 ++--
testcases/kernel/kvm/kvm_svm01.c | 4 ++--
testcases/kernel/kvm/kvm_svm02.c | 4 ++--
testcases/kernel/kvm/kvm_svm03.c | 4 ++--
testcases/kernel/kvm/kvm_svm04.c | 4 ++--
testcases/kernel/kvm/kvm_vmx01.c | 4 ++--
testcases/kernel/kvm/kvm_vmx02.c | 4 ++--
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/testcases/kernel/kvm/kvm_pagefault01.c b/testcases/kernel/kvm/kvm_pagefault01.c
index 2b477f7af..090d8a6a3 100644
--- a/testcases/kernel/kvm/kvm_pagefault01.c
+++ b/testcases/kernel/kvm/kvm_pagefault01.c
@@ -165,8 +165,8 @@ static struct tst_test test = {
.setup = setup,
.cleanup = tst_kvm_cleanup,
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "kvm",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_KVM",
NULL
},
.supported_archs = (const char *const []) {
diff --git a/testcases/kernel/kvm/kvm_svm01.c b/testcases/kernel/kvm/kvm_svm01.c
index f81602567..b295c18ba 100644
--- a/testcases/kernel/kvm/kvm_svm01.c
+++ b/testcases/kernel/kvm/kvm_svm01.c
@@ -108,8 +108,8 @@ static struct tst_test test = {
.test_all = tst_kvm_run,
.setup = tst_kvm_setup,
.cleanup = tst_kvm_cleanup,
- .needs_drivers = (const char *const []) {
- "kvm",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_KVM",
NULL
},
.supported_archs = (const char *const []) {
diff --git a/testcases/kernel/kvm/kvm_svm02.c b/testcases/kernel/kvm/kvm_svm02.c
index 701f2731d..0c1b239cf 100644
--- a/testcases/kernel/kvm/kvm_svm02.c
+++ b/testcases/kernel/kvm/kvm_svm02.c
@@ -129,8 +129,8 @@ static struct tst_test test = {
.test_all = tst_kvm_run,
.setup = tst_kvm_setup,
.cleanup = tst_kvm_cleanup,
- .needs_drivers = (const char *const []) {
- "kvm",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_KVM",
NULL
},
.supported_archs = (const char *const []) {
diff --git a/testcases/kernel/kvm/kvm_svm03.c b/testcases/kernel/kvm/kvm_svm03.c
index faafaf7cf..dba1ab9e7 100644
--- a/testcases/kernel/kvm/kvm_svm03.c
+++ b/testcases/kernel/kvm/kvm_svm03.c
@@ -154,8 +154,8 @@ static struct tst_test test = {
.test_all = run,
.setup = setup,
.cleanup = cleanup,
- .needs_drivers = (const char *const []) {
- "kvm",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_KVM",
NULL
},
.min_cpus = 2,
diff --git a/testcases/kernel/kvm/kvm_svm04.c b/testcases/kernel/kvm/kvm_svm04.c
index af3c8b1c6..4a6e73818 100644
--- a/testcases/kernel/kvm/kvm_svm04.c
+++ b/testcases/kernel/kvm/kvm_svm04.c
@@ -295,8 +295,8 @@ static struct tst_test test = {
.test_all = tst_kvm_run,
.setup = tst_kvm_setup,
.cleanup = tst_kvm_cleanup,
- .needs_drivers = (const char *const []) {
- "kvm",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_KVM",
NULL
},
.supported_archs = (const char *const []) {
diff --git a/testcases/kernel/kvm/kvm_vmx01.c b/testcases/kernel/kvm/kvm_vmx01.c
index d0c4913c9..9950e1bc8 100644
--- a/testcases/kernel/kvm/kvm_vmx01.c
+++ b/testcases/kernel/kvm/kvm_vmx01.c
@@ -269,8 +269,8 @@ static struct tst_test test = {
.setup = setup,
.cleanup = tst_kvm_cleanup,
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "kvm",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_KVM",
NULL
},
.supported_archs = (const char *const []) {
diff --git a/testcases/kernel/kvm/kvm_vmx02.c b/testcases/kernel/kvm/kvm_vmx02.c
index 4ce225e56..5152ad8f3 100644
--- a/testcases/kernel/kvm/kvm_vmx02.c
+++ b/testcases/kernel/kvm/kvm_vmx02.c
@@ -183,8 +183,8 @@ static struct tst_test test = {
.setup = setup,
.cleanup = tst_kvm_cleanup,
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "kvm",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_KVM",
NULL
},
.supported_archs = (const char *const []) {
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 06/17] tests: zram03: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (4 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 05/17] tests: kvm: Switch from needs_drivers to needs_kconfigs Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 07/17] tests: squashfs01: " Cyril Hrubis
` (11 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/device-drivers/zram/zram03.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/device-drivers/zram/zram03.c b/testcases/kernel/device-drivers/zram/zram03.c
index 4dcf23b4e..23f6da14f 100644
--- a/testcases/kernel/device-drivers/zram/zram03.c
+++ b/testcases/kernel/device-drivers/zram/zram03.c
@@ -236,8 +236,8 @@ static struct tst_test test = {
.cleanup = cleanup,
.needs_root = 1,
.needs_tmpdir = 1,
- .needs_drivers = (const char *const []) {
- "zram",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_ZRAM",
NULL
},
.needs_cmds = (struct tst_cmd[]) {
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 07/17] tests: squashfs01: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (5 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 06/17] tests: zram03: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 08/17] tests: ioctl: " Cyril Hrubis
` (10 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/fs/squashfs/squashfs01.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/fs/squashfs/squashfs01.c b/testcases/kernel/fs/squashfs/squashfs01.c
index 7a548d62c..a5789c6ae 100644
--- a/testcases/kernel/fs/squashfs/squashfs01.c
+++ b/testcases/kernel/fs/squashfs/squashfs01.c
@@ -106,8 +106,8 @@ static struct tst_test test = {
{.cmd = "mksquashfs"},
{}
},
- .needs_drivers = (const char *const []) {
- "squashfs",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_SQUASHFS",
NULL
},
.tags = (const struct tst_tag[]) {
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 08/17] tests: ioctl: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (6 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 07/17] tests: squashfs01: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 09/17] tests: madvise11: " Cyril Hrubis
` (9 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/ioctl/ioctl09.c | 4 ++--
testcases/kernel/syscalls/ioctl/ioctl_loop01.c | 4 ++--
testcases/kernel/syscalls/ioctl/ioctl_loop02.c | 4 ++--
testcases/kernel/syscalls/ioctl/ioctl_loop03.c | 4 ++--
testcases/kernel/syscalls/ioctl/ioctl_loop04.c | 4 ++--
testcases/kernel/syscalls/ioctl/ioctl_loop05.c | 4 ++--
testcases/kernel/syscalls/ioctl/ioctl_loop06.c | 4 ++--
testcases/kernel/syscalls/ioctl/ioctl_loop07.c | 4 ++--
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/testcases/kernel/syscalls/ioctl/ioctl09.c b/testcases/kernel/syscalls/ioctl/ioctl09.c
index 561c1b6b5..bffcc2e0e 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl09.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl09.c
@@ -104,8 +104,8 @@ static struct tst_test test = {
.cleanup = cleanup,
.test_all = verify_ioctl,
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
},
.needs_cmds = (struct tst_cmd[]) {
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop01.c b/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
index f7e56dea8..0322b2633 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
@@ -136,8 +136,8 @@ static struct tst_test test = {
.cleanup = cleanup,
.test_all = verify_ioctl_loop,
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
},
.tags = (const struct tst_tag[]) {
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop02.c b/testcases/kernel/syscalls/ioctl/ioctl_loop02.c
index a5398ba0a..27f8e6cf9 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_loop02.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_loop02.c
@@ -158,8 +158,8 @@ static struct tst_test test = {
.test = verify_ioctl_loop,
.needs_root = 1,
.needs_tmpdir = 1,
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
}
};
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop03.c b/testcases/kernel/syscalls/ioctl/ioctl_loop03.c
index 56a717476..47f69e800 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_loop03.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_loop03.c
@@ -71,8 +71,8 @@ static struct tst_test test = {
.test_all = verify_ioctl_loop,
.needs_root = 1,
.needs_tmpdir = 1,
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
}
};
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop04.c b/testcases/kernel/syscalls/ioctl/ioctl_loop04.c
index 38134fb70..e5c11aa5b 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_loop04.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_loop04.c
@@ -96,8 +96,8 @@ static struct tst_test test = {
.test_all = verify_ioctl_loop,
.needs_root = 1,
.needs_tmpdir = 1,
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
}
};
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop05.c b/testcases/kernel/syscalls/ioctl/ioctl_loop05.c
index 88db7d168..11952af0a 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_loop05.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_loop05.c
@@ -154,8 +154,8 @@ static struct tst_test test = {
"overlayfs",
NULL
},
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
}
};
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop06.c b/testcases/kernel/syscalls/ioctl/ioctl_loop06.c
index 94f9bcdc6..f523df1c6 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_loop06.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_loop06.c
@@ -147,8 +147,8 @@ static struct tst_test test = {
.tcnt = ARRAY_SIZE(tcases),
.needs_root = 1,
.needs_tmpdir = 1,
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
}
};
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_loop07.c b/testcases/kernel/syscalls/ioctl/ioctl_loop07.c
index 0a210038b..6a58577c7 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_loop07.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_loop07.c
@@ -162,8 +162,8 @@ static struct tst_test test = {
{"linux-git", "79e5dc59e297"},
{}
},
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
}
};
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 09/17] tests: madvise11: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (7 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 08/17] tests: ioctl: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 10/17] tests: quotactl: " Cyril Hrubis
` (8 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/madvise/madvise11.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/testcases/kernel/syscalls/madvise/madvise11.c b/testcases/kernel/syscalls/madvise/madvise11.c
index 73d2d4294..97d2b851e 100644
--- a/testcases/kernel/syscalls/madvise/madvise11.c
+++ b/testcases/kernel/syscalls/madvise/madvise11.c
@@ -417,10 +417,6 @@ static void cleanup(void)
static struct tst_test test = {
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- HW_MODULE,
- NULL
- },
.needs_cmds = (struct tst_cmd[]) {
{.cmd = "modprobe"},
{.cmd = "rmmod"},
@@ -428,6 +424,7 @@ static struct tst_test test = {
},
.needs_kconfigs = (const char *[]) {
"CONFIG_MEMORY_FAILURE=y",
+ "CONFIG_HWPOISON_INJECT",
NULL
},
.runtime = 30,
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 10/17] tests: quotactl: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (8 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 09/17] tests: madvise11: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 11/17] tests: uevent: " Cyril Hrubis
` (7 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/quotactl/quotactl01.c | 4 ++--
testcases/kernel/syscalls/quotactl/quotactl04.c | 4 ++--
testcases/kernel/syscalls/quotactl/quotactl06.c | 4 ++--
testcases/kernel/syscalls/quotactl/quotactl08.c | 4 ++--
testcases/kernel/syscalls/quotactl/quotactl09.c | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 3091ac5bf..b14203a28 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -208,8 +208,8 @@ static void verify_quota(unsigned int n)
static struct tst_test test = {
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "quota_v2",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_QFMT_V2",
NULL
},
.test = verify_quota,
diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index a70903330..ee7671ca3 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -144,8 +144,8 @@ static void verify_quota(unsigned int n)
static struct tst_test test = {
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "quota_v2",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_QFMT_V2",
NULL
},
.min_kver = "4.5", /* commit 689c958cbe6b (ext4: add project quota support) */
diff --git a/testcases/kernel/syscalls/quotactl/quotactl06.c b/testcases/kernel/syscalls/quotactl/quotactl06.c
index 333f5720d..b46fd1a3b 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl06.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl06.c
@@ -211,8 +211,8 @@ static void cleanup(void)
static struct tst_test test = {
.setup = setup,
.cleanup = cleanup,
- .needs_drivers = (const char *const []) {
- "quota_v2",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_QFMT_V2",
NULL
},
.tcnt = ARRAY_SIZE(tcases),
diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c
index ce7a8b008..e20a8a8ae 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl08.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl08.c
@@ -200,8 +200,8 @@ static void verify_quota(unsigned int n)
static struct tst_test test = {
.needs_root = 1,
- .needs_drivers = (const char *const []) {
- "quota_v2",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_QFMT_V2",
NULL
},
.test = verify_quota,
diff --git a/testcases/kernel/syscalls/quotactl/quotactl09.c b/testcases/kernel/syscalls/quotactl/quotactl09.c
index fd6629c0c..862ab4edf 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl09.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl09.c
@@ -168,8 +168,8 @@ static void cleanup(void)
static struct tst_test test = {
.setup = setup,
.cleanup = cleanup,
- .needs_drivers = (const char *const []) {
- "quota_v2",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_QFMT_V2",
NULL
},
.tcnt = ARRAY_SIZE(tcases),
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 11/17] tests: uevent: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (9 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 10/17] tests: quotactl: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 12/17] cve: tcindex01: " Cyril Hrubis
` (6 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/uevents/uevent01.c | 4 ++--
testcases/kernel/uevents/uevent02.c | 4 ++--
testcases/kernel/uevents/uevent03.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/testcases/kernel/uevents/uevent01.c b/testcases/kernel/uevents/uevent01.c
index 09ef42412..f5fe099d8 100644
--- a/testcases/kernel/uevents/uevent01.c
+++ b/testcases/kernel/uevents/uevent01.c
@@ -90,8 +90,8 @@ static struct tst_test test = {
.test_all = verify_uevent,
.forks_child = 1,
.needs_checkpoints = 1,
- .needs_drivers = (const char *const []) {
- "loop",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_BLK_DEV_LOOP",
NULL
},
.needs_root = 1
diff --git a/testcases/kernel/uevents/uevent02.c b/testcases/kernel/uevents/uevent02.c
index abae4f88e..1135f55a8 100644
--- a/testcases/kernel/uevents/uevent02.c
+++ b/testcases/kernel/uevents/uevent02.c
@@ -148,8 +148,8 @@ static struct tst_test test = {
.test_all = verify_uevent,
.forks_child = 1,
.needs_checkpoints = 1,
- .needs_drivers = (const char *const []) {
- "tun",
+ .needs_kconfigs = (const char *const []) {
+ "CONFIG_TUN",
NULL
},
.needs_root = 1
diff --git a/testcases/kernel/uevents/uevent03.c b/testcases/kernel/uevents/uevent03.c
index 23866460b..42d629a4a 100644
--- a/testcases/kernel/uevents/uevent03.c
+++ b/testcases/kernel/uevents/uevent03.c
@@ -239,8 +239,8 @@ static struct tst_test test = {
.test_all = verify_uevent,
.forks_child = 1,
.needs_checkpoints = 1,
- .needs_drivers = (const char *const[]) {
- "uinput",
+ .needs_kconfigs = (const char *const[]) {
+ "CONFIG_INPUT_UINPUT",
NULL
},
.needs_root = 1,
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 12/17] cve: tcindex01: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (10 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 11/17] tests: uevent: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 13/17] tests: can: " Cyril Hrubis
` (5 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/cve/tcindex01.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/testcases/cve/tcindex01.c b/testcases/cve/tcindex01.c
index 370d7de49..478d75055 100644
--- a/testcases/cve/tcindex01.c
+++ b/testcases/cve/tcindex01.c
@@ -145,16 +145,13 @@ static struct tst_test test = {
"CONFIG_NET_NS=y",
"CONFIG_NET_SCH_HTB",
"CONFIG_NET_CLS_TCINDEX",
+ "CONFIG_DUMMY",
NULL
},
.save_restore = (const struct tst_path_val[]) {
{"/proc/sys/user/max_user_namespaces", "1024", TST_SR_SKIP},
{}
},
- .needs_drivers = (const char *const []) {
- "dummy",
- NULL
- },
.tags = (const struct tst_tag[]) {
{"linux-git", "8c710f75256b"},
{"CVE", "2023-1829"},
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 13/17] tests: can: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (11 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 12/17] cve: tcindex01: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 14/17] tests: fsetxattr: " Cyril Hrubis
` (4 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/network/can/cve/can_bcm01.c | 6 +++---
testcases/network/can/filter-tests/can_filter.c | 6 +++---
testcases/network/can/filter-tests/can_rcv_own_msgs.c | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/testcases/network/can/cve/can_bcm01.c b/testcases/network/can/cve/can_bcm01.c
index 57ec4989f..3b66037e7 100644
--- a/testcases/network/can/cve/can_bcm01.c
+++ b/testcases/network/can/cve/can_bcm01.c
@@ -140,9 +140,9 @@ static struct tst_test test = {
.needs_root = 1,
.skip_in_compat = 1,
.min_runtime = 30,
- .needs_drivers = (const char *const[]) {
- "vcan",
- "can-bcm",
+ .needs_kconfigs = (const char *const[]) {
+ "CONFIG_CAN_VCAN",
+ "CONFIG_CAN_BCM",
NULL
},
.tags = (const struct tst_tag[]) {
diff --git a/testcases/network/can/filter-tests/can_filter.c b/testcases/network/can/filter-tests/can_filter.c
index 1ea8ea18f..8b4f2fc05 100644
--- a/testcases/network/can/filter-tests/can_filter.c
+++ b/testcases/network/can/filter-tests/can_filter.c
@@ -183,9 +183,9 @@ static struct tst_test test = {
TST_CAP(TST_CAP_DROP, CAP_SYS_ADMIN),
{}
},
- .needs_drivers = (const char *const[]) {
- "vcan",
- "can-raw",
+ .needs_kconfigs = (const char *const[]) {
+ "CONFIG_CAN_VCAN",
+ "CONFIG_CAN_RAW",
NULL
}
};
diff --git a/testcases/network/can/filter-tests/can_rcv_own_msgs.c b/testcases/network/can/filter-tests/can_rcv_own_msgs.c
index ba40666dc..2c0acecf9 100644
--- a/testcases/network/can/filter-tests/can_rcv_own_msgs.c
+++ b/testcases/network/can/filter-tests/can_rcv_own_msgs.c
@@ -145,9 +145,9 @@ static struct tst_test test = {
TST_CAP(TST_CAP_DROP, CAP_SYS_ADMIN),
{}
},
- .needs_drivers = (const char *const[]) {
- "vcan",
- "can-raw",
+ .needs_kconfigs = (const char *const[]) {
+ "CONFIG_CAN_VCAN",
+ "CONFIG_CAN_RAW",
NULL
}
};
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 14/17] tests: fsetxattr: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (12 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 13/17] tests: can: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 15/17] sctp: " Cyril Hrubis
` (3 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/fsetxattr/fsetxattr02.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
index 42dfc9d4f..2a48b7da7 100644
--- a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
+++ b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
@@ -265,8 +265,8 @@ static struct tst_test test = {
.needs_devfs = 1,
.mntpoint = MNTPOINT,
.needs_root = 1,
- .needs_drivers = (const char *const[]) {
- "brd",
+ .needs_kconfigs = (const char *const[]) {
+ "CONFIG_BLK_DEV_RAM",
NULL,
},
};
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 15/17] sctp: Switch from needs_drivers to needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (13 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 14/17] tests: fsetxattr: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers Cyril Hrubis
` (2 subsequent siblings)
17 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
utils/sctp/func_tests/test_1_to_1_initmsg_connect.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c b/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c
index 98013cd30..c9c3c1c30 100644
--- a/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c
+++ b/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c
@@ -110,8 +110,8 @@ static void test_sctp(unsigned int n)
static struct tst_test test = {
.test = test_sctp,
.tcnt = ARRAY_SIZE(testcase_list),
- .needs_drivers = (const char *[]) {
- "sctp",
+ .needs_kconfigs = (const char *[]) {
+ "CONFIG_IP_SCTP",
NULL
},
};
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (14 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 15/17] sctp: " Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-03 3:01 ` Li Wang via ltp
2026-04-02 12:13 ` [LTP] [PATCH 17/17] doc: metadata: Remove needs_drivers from docs Cyril Hrubis
2026-04-02 21:59 ` [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Petr Vorel
17 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
include/tst_test.h | 5 -----
lib/tst_test.c | 9 ---------
2 files changed, 14 deletions(-)
diff --git a/include/tst_test.h b/include/tst_test.h
index ddfe9d4d6..752688c45 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -498,10 +498,6 @@ struct tst_fs {
* to the test temporary directory from the LTP datafiles
* directory.
*
- * @needs_drivers: A NULL terminated array of kernel modules required to run
- * the test. The module has to be build in or present in order
- * for the test to run.
- *
* @save_restore: A {} terminated array of /proc or /sys files that should
* saved at the start of the test and restored at the end. See
* tst_sys_conf_save() and :ref:`struct tst_path_val` for details.
@@ -605,7 +601,6 @@ struct tst_fs {
int (*sample)(int clk_id, long long usec);
const char *const *resource_files;
- const char * const *needs_drivers;
const struct tst_path_val *save_restore;
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 2d62ab164..26f6510a0 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1487,15 +1487,6 @@ static void do_setup(int argc, char *argv[])
}
}
- if (tst_test->needs_drivers) {
- const char *name;
- int i;
-
- for (i = 0; (name = tst_test->needs_drivers[i]); ++i)
- if (tst_check_driver(name))
- tst_brk(TCONF, "%s driver not available", name);
- }
-
if (tst_test->mount_device)
tst_test->format_device = 1;
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* [LTP] [PATCH 17/17] doc: metadata: Remove needs_drivers from docs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (15 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers Cyril Hrubis
@ 2026-04-02 12:13 ` Cyril Hrubis
2026-04-02 21:34 ` Petr Vorel
2026-04-02 21:59 ` [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Petr Vorel
17 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-02 12:13 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
doc/developers/writing_tests.rst | 3 ---
doc/old/C-Test-API.asciidoc | 13 ++++++-------
metadata/README.md | 15 ++++++---------
3 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/doc/developers/writing_tests.rst b/doc/developers/writing_tests.rst
index 992374f8b..5b1516ba5 100644
--- a/doc/developers/writing_tests.rst
+++ b/doc/developers/writing_tests.rst
@@ -435,9 +435,6 @@ LTP C And Shell Test API Comparison
* - .needs_device
- TST_NEEDS_DEVICE
- * - .needs_drivers
- - TST_NEEDS_DRIVERS
-
* - .needs_kconfigs
- TST_NEEDS_KCONFIGS
diff --git a/doc/old/C-Test-API.asciidoc b/doc/old/C-Test-API.asciidoc
index 72fd2731d..7493fc578 100644
--- a/doc/old/C-Test-API.asciidoc
+++ b/doc/old/C-Test-API.asciidoc
@@ -1621,13 +1621,12 @@ test should include 'tst_checksum.h' header, then can call 'tst_crc32c()'.
1.26 Checking kernel for the driver support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Some tests may need specific kernel drivers, either compiled in, or built
-as a module. If '.needs_drivers' points to a 'NULL' terminated array of kernel
-module names these are all checked and the test exits with 'TCONF' on the
-first missing driver.
-
-The detection is based on reading 'modules.dep' and 'modules.builtin' files
-generated by kmod. The check is skipped on Android.
+Some tests may need specific kernel drivers, either compiled in, or built as a
+module. For this cases a mappping of kernel config options to modules is
+maintained in the kconfig checker. When a kernel config option is requested by
+a test that has associated mapping in the kconfig source the 'modules.dep' file
+is checked for module presence when the option is set to 'm'. The check is
+skipped on Android.
1.27 Saving & restoring /proc|sys values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/metadata/README.md b/metadata/README.md
index 2cf978d39..950e49f6e 100644
--- a/metadata/README.md
+++ b/metadata/README.md
@@ -144,15 +144,14 @@ struct tst_test test = {
/* Indicates that the test is messing with system wall clock */
.restore_wallclock = 1,
- /* Tests needs uinput either compiled in or loaded as a module */
- .needs_drivers = (const char *[]) {
- "uinput",
- NULL
- },
-
/* Tests needs enabled kernel config flags */
.needs_kconfigs = (const char *[]) {
"CONFIG_X86_INTEL_UMIP=y",
+ /*
+ * For config options that enable modules we also check the presence of
+ * the module if the config option has module mapping set and is set to 'm'.
+ */
+ "CONFIG_INPUT_UINPUT",
NULL
},
@@ -185,11 +184,9 @@ Which will yield following JSON output:
"dev_min_size": "1024",
"dev_fs_type": "ext4",
"restore_wallclock": "1",
- "needs_drivers": [
- "uinput",
- ],
"needs_kconfigs": [
"CONFIG_X86_INTEL_UMIP=y",
+ "CONFIG_INPUT_UINPUT",
],
"tags": [
[
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
2026-04-02 12:13 ` [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver() Cyril Hrubis
@ 2026-04-02 21:26 ` Petr Vorel
2026-04-02 21:47 ` Petr Vorel
1 sibling, 0 replies; 36+ messages in thread
From: Petr Vorel @ 2026-04-02 21:26 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
> This function allows us to check for presence of drivers build as
s/build/built/
> modules.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> include/tst_kernel.h | 10 ++++++++++
> lib/tst_kernel.c | 12 +++++++-----
> 2 files changed, 17 insertions(+), 5 deletions(-)
> diff --git a/include/tst_kernel.h b/include/tst_kernel.h
> index 63ecb19a4..d5a4a9625 100644
> --- a/include/tst_kernel.h
> +++ b/include/tst_kernel.h
> @@ -45,6 +45,16 @@ bool tst_abi_bits(int abi);
> */
> int tst_check_builtin_driver(const char *driver);
> +/**
> + * tst_check_module_driver() - Check if the kernel module is present.
> + *
> + * @driver: the name of the driver.
> + *
> + * Return: 0 if module driver is present or -1 when driver is missing or config file not
> + * available. On Android *always* 0 (always expect the module is present).
nit: "the driver" vs. "the module". We have kernel modules which are builtin or
compiled as modules. The older two functions say "the driver", but they are also
modules (although builtin), maybe worth to change it.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 02/17] lib: shell: Remove needs_drivers from JSON parser
2026-04-02 12:13 ` [LTP] [PATCH 02/17] lib: shell: Remove needs_drivers from JSON parser Cyril Hrubis
@ 2026-04-02 21:29 ` Petr Vorel
0 siblings, 0 replies; 36+ messages in thread
From: Petr Vorel @ 2026-04-02 21:29 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> No shell tests were using it at the moment.
And the current shell tests (tst_test.sh) will be also during conversion to the
shell loader changed to use needs_kconfigs.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 17/17] doc: metadata: Remove needs_drivers from docs
2026-04-02 12:13 ` [LTP] [PATCH 17/17] doc: metadata: Remove needs_drivers from docs Cyril Hrubis
@ 2026-04-02 21:34 ` Petr Vorel
0 siblings, 0 replies; 36+ messages in thread
From: Petr Vorel @ 2026-04-02 21:34 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> doc/developers/writing_tests.rst | 3 ---
> doc/old/C-Test-API.asciidoc | 13 ++++++-------
> metadata/README.md | 15 ++++++---------
> 3 files changed, 12 insertions(+), 19 deletions(-)
> diff --git a/doc/developers/writing_tests.rst b/doc/developers/writing_tests.rst
> index 992374f8b..5b1516ba5 100644
> --- a/doc/developers/writing_tests.rst
> +++ b/doc/developers/writing_tests.rst
> @@ -435,9 +435,6 @@ LTP C And Shell Test API Comparison
> * - .needs_device
> - TST_NEEDS_DEVICE
> - * - .needs_drivers
> - - TST_NEEDS_DRIVERS
> -
NOTE: this is the old comparison for tst_test.sh, it should be change:
- * - not applicable
- - TST_NEEDS_DRIVERS
> * - .needs_kconfigs
> - TST_NEEDS_KCONFIGS
> diff --git a/doc/old/C-Test-API.asciidoc b/doc/old/C-Test-API.asciidoc
> index 72fd2731d..7493fc578 100644
> --- a/doc/old/C-Test-API.asciidoc
> +++ b/doc/old/C-Test-API.asciidoc
> @@ -1621,13 +1621,12 @@ test should include 'tst_checksum.h' header, then can call 'tst_crc32c()'.
> 1.26 Checking kernel for the driver support
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -Some tests may need specific kernel drivers, either compiled in, or built
> -as a module. If '.needs_drivers' points to a 'NULL' terminated array of kernel
> -module names these are all checked and the test exits with 'TCONF' on the
> -first missing driver.
> -
> -The detection is based on reading 'modules.dep' and 'modules.builtin' files
> -generated by kmod. The check is skipped on Android.
> +Some tests may need specific kernel drivers, either compiled in, or built as a
> +module. For this cases a mappping of kernel config options to modules is
> +maintained in the kconfig checker. When a kernel config option is requested by
Please amend before merge to use formatting:
``modules.dep``
> +a test that has associated mapping in the kconfig source the 'modules.dep' file
> +is checked for module presence when the option is set to 'm'. The check is
... set to ``m``.
> +skipped on Android.
The rest LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 01/17] syscalls: ioctl08: Remove .needs_drivers
2026-04-02 12:13 ` [LTP] [PATCH 01/17] syscalls: ioctl08: Remove .needs_drivers Cyril Hrubis
@ 2026-04-02 21:34 ` Petr Vorel
0 siblings, 0 replies; 36+ messages in thread
From: Petr Vorel @ 2026-04-02 21:34 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
2026-04-02 12:13 ` [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver() Cyril Hrubis
2026-04-02 21:26 ` Petr Vorel
@ 2026-04-02 21:47 ` Petr Vorel
2026-04-07 9:43 ` Cyril Hrubis
1 sibling, 1 reply; 36+ messages in thread
From: Petr Vorel @ 2026-04-02 21:47 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
> @@ -200,16 +200,18 @@ static int tst_search_driver(const char *driver, const char *file)
> int tst_check_builtin_driver(const char *driver)
> {
> - if (!tst_search_driver(driver, "modules.builtin"))
> - return 0;
> + return tst_search_driver(driver, "modules.builtin");
> +}
> - return -1;
> +int tst_check_module_driver(const char *driver)
> +{
> + return tst_search_driver(driver, "modules.dep");
Thinking about it twice, could we check for the module by reading
/sys/module/? Our current approach shows what module *should* be available, but
that might not be true for some reason (i.e. loadable module not installed).
Unfortunately while this works for loadable modules (and IMHO worth to add it),
builtin modules are here only if they have a version or at least one parameter
[1]. And this will not work at least for hwpoison_inject.
Kind regards,
Petr
[1] https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-module
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
` (16 preceding siblings ...)
2026-04-02 12:13 ` [LTP] [PATCH 17/17] doc: metadata: Remove needs_drivers from docs Cyril Hrubis
@ 2026-04-02 21:59 ` Petr Vorel
17 siblings, 0 replies; 36+ messages in thread
From: Petr Vorel @ 2026-04-02 21:59 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
> The needs_drivers and needs_kconfigs options had overlapping
> functionality. This patchset gets rid of needs_drivers by adding module
> checks to needs_kconfigs.
to whole patchset:
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Besides few notes I posted the main concern is whether to move to reading /sys/module/
at least for loadable modules. OTOH it can be done as a separate effort.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers
2026-04-02 12:13 ` [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers Cyril Hrubis
@ 2026-04-03 3:01 ` Li Wang via ltp
2026-04-07 10:02 ` Cyril Hrubis
0 siblings, 1 reply; 36+ messages in thread
From: Li Wang via ltp @ 2026-04-03 3:01 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> --- a/include/tst_test.h
> +++ b/include/tst_test.h
> @@ -498,10 +498,6 @@ struct tst_fs {
> * to the test temporary directory from the LTP datafiles
> * directory.
> *
> - * @needs_drivers: A NULL terminated array of kernel modules required to run
> - * the test. The module has to be build in or present in order
> - * for the test to run.
> - *
> * @save_restore: A {} terminated array of /proc or /sys files that should
> * saved at the start of the test and restored at the end. See
> * tst_sys_conf_save() and :ref:`struct tst_path_val` for details.
As we add runtime_check and module_check, I think we also need to update
the descrition comments of @needs_kconfigs in tst_test.h.
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks
2026-04-02 12:13 ` [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks Cyril Hrubis
@ 2026-04-03 3:09 ` Li Wang via ltp
2026-04-07 10:05 ` Cyril Hrubis
0 siblings, 1 reply; 36+ messages in thread
From: Li Wang via ltp @ 2026-04-03 3:09 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Thu, Apr 02, 2026 at 02:13:43PM +0200, Cyril Hrubis wrote:
> The .needs_kconfig and .needs_drivers fields in the tst_test structure
> had overlaping functionality. Both were checking if a functionality was
> build in into the kernel or compiled as a driver. Similarily to the
> runtime checks added to tst_kconfig modules can be build but packaged
> into separate packages and may not be installed on the system even if
> corresponding config option was set to 'm'.
>
> This commit adds a mapping table from CONFIG options to module names for
> the modules we care about. Most of the time the mapping is trivial, but
> some CONFIG options does not really match the module name, hence we need
> a mapping. We may also be able to generate the table from kernel config
> infrastructure later on, but at this point the number of options is
> small enough to be manageable by hand editing.
>
> Once we have that mapping we can run aditional check for a module
> presence if the confing option was set to 'm' and if mapping exists in
> order to disable the config option when the module was not found.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> lib/tst_kconfig.c | 41 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> index 52dd6d726..c5dd97a45 100644
> --- a/lib/tst_kconfig.c
> +++ b/lib/tst_kconfig.c
> @@ -144,6 +144,46 @@ static void runtime_check(struct tst_kconfig_var *var)
> }
> }
>
> +static struct module_check {
> + const char *config;
> + const char *module_name;
> +} module_checks[] = {
> + {"CONFIG_KVM", "kvm"},
> + {"CONFIG_ZRAM", "zram"},
> + {"CONFIG_SQUASHFS", "squashfs"},
> + {"CONFIG_BLK_DEV_LOOP", "loop"},
> + {"CONFIG_TUN", "tun"},
> + {"CONFIG_BLK_DEV_RAM", "brd"},
> + {"CONFIG_HWPOISON_INJECT", "hwpoison_inject"},
> + {"CONFIG_QFMT_V2", "quota_v2"},
> + {"CONFIG_INPUT_UINPUT", "uinput"},
> + {"CONFIG_DUMMY", "dummy"},
> + {"CONFIG_CAN_VCAN", "vcan"},
> + {"CONFIG_CAN_RAW", "can-raw"},
> + {"CONFIG_CAN_BCM", "can-bcm"},
> + {"CONFIG_IP_SCTP", "sctp"},
> + {}
> +};
Maybe rename the struct to:
static struct config_module_map {
const char *config;
const char *module_name;
} config_module_maps[] = {
...
}
And rename 'struct runtime_check' to:
static struct config_runtime_map {
const char *config;
bool (*runtime_check)(void);
} config_runtime_maps[] = {
...
};
This is a tiny nit; I don't have strong opinions.
> static inline int kconfig_parse_line(const char *line,
> struct tst_kconfig_var *vars,
> unsigned int vars_len)
> @@ -222,6 +262,7 @@ out:
> case 'm':
> vars[i].choice = 'm';
> runtime_check(&vars[i]);
> + module_check(&vars[i]);
Then rename the two functions to:
kconfig_runtime_check()
kconfig_module_check()
Because in tst_kconfig.c most function contains "kconfig_" string.
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
2026-04-02 21:47 ` Petr Vorel
@ 2026-04-07 9:43 ` Cyril Hrubis
2026-04-07 11:15 ` Petr Vorel
0 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-07 9:43 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > - return -1;
> > +int tst_check_module_driver(const char *driver)
> > +{
> > + return tst_search_driver(driver, "modules.dep");
>
> Thinking about it twice, could we check for the module by reading
> /sys/module/? Our current approach shows what module *should* be available, but
> that might not be true for some reason (i.e. loadable module not installed).
The modules.dep file contains names of all modules installed in
particular kernel modules directory. We cannot do anything better than
parsing that file because it's (re)genrated on the system each time
packages with modules have been installed/removed. If that wasn't the
case modprobe that depends on that file wouldn't work either.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers
2026-04-03 3:01 ` Li Wang via ltp
@ 2026-04-07 10:02 ` Cyril Hrubis
2026-04-07 11:39 ` Li Wang via ltp
0 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-07 10:02 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
Hi!
> > --- a/include/tst_test.h
> > +++ b/include/tst_test.h
> > @@ -498,10 +498,6 @@ struct tst_fs {
> > * to the test temporary directory from the LTP datafiles
> > * directory.
> > *
> > - * @needs_drivers: A NULL terminated array of kernel modules required to run
> > - * the test. The module has to be build in or present in order
> > - * for the test to run.
> > - *
> > * @save_restore: A {} terminated array of /proc or /sys files that should
> > * saved at the start of the test and restored at the end. See
> > * tst_sys_conf_save() and :ref:`struct tst_path_val` for details.
>
> As we add runtime_check and module_check, I think we also need to update
> the descrition comments of @needs_kconfigs in tst_test.h.
What about something like this:
diff --git a/include/tst_test.h b/include/tst_test.h
index 752688c45..f2a5378cd 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -511,6 +511,13 @@ struct tst_fs {
* and parenthesis are supported, e.g.
* "CONFIG_X86_INTEL_UMIP=y | CONFIG_X86_UIMP=y" is evaluated
* to true if at least one of the options is present.
+ * For some config options their presence in the config file
+ * is not enough to assure the functionality is present or
+ * enabled. E.g. config option may be set to 'm' but the
+ * module may not be installed or functionality may be
+ * disabled on the kernel command line. The kconfig library
+ * has a set of additonal checks for a few config options that
+ * are used in the tests and need additional checks.
*
* @bufs: A description of guarded buffers to be allocated for the test. Guarded
* buffers are buffers with poisoned page allocated right before the start
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks
2026-04-03 3:09 ` Li Wang via ltp
@ 2026-04-07 10:05 ` Cyril Hrubis
2026-04-07 11:40 ` Li Wang via ltp
0 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-07 10:05 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
Hi!
> Maybe rename the struct to:
>
> static struct config_module_map {
> const char *config;
> const char *module_name;
> } config_module_maps[] = {
> ...
> }
>
> And rename 'struct runtime_check' to:
>
> static struct config_runtime_map {
> const char *config;
> bool (*runtime_check)(void);
> } config_runtime_maps[] = {
> ...
> };
>
> This is a tiny nit; I don't have strong opinions.
>
> > static inline int kconfig_parse_line(const char *line,
> > struct tst_kconfig_var *vars,
> > unsigned int vars_len)
> > @@ -222,6 +262,7 @@ out:
> > case 'm':
> > vars[i].choice = 'm';
> > runtime_check(&vars[i]);
> > + module_check(&vars[i]);
>
> Then rename the two functions to:
>
> kconfig_runtime_check()
> kconfig_module_check()
>
> Because in tst_kconfig.c most function contains "kconfig_" string.
I do not have strong opition, if you agree that these names are better
we can rename them.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
2026-04-07 9:43 ` Cyril Hrubis
@ 2026-04-07 11:15 ` Petr Vorel
2026-04-07 11:24 ` Cyril Hrubis
0 siblings, 1 reply; 36+ messages in thread
From: Petr Vorel @ 2026-04-07 11:15 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > > - return -1;
> > > +int tst_check_module_driver(const char *driver)
> > > +{
> > > + return tst_search_driver(driver, "modules.dep");
> > Thinking about it twice, could we check for the module by reading
> > /sys/module/? Our current approach shows what module *should* be available, but
> > that might not be true for some reason (i.e. loadable module not installed).
> The modules.dep file contains names of all modules installed in
> particular kernel modules directory. We cannot do anything better than
> parsing that file because it's (re)genrated on the system each time
> packages with modules have been installed/removed. If that wasn't the
> case modprobe that depends on that file wouldn't work either.
We effectively ask users to install modules.dep and modules.builtin. While this
is ok for distros and nobody has complained, I can imagine special embedded
systems can have problem. If everything was reliably detectable via /sys or
/proc I'd move to it. But even it's not working for all modules, checking first
/sys/module/ and fallback using modules.{builtin,dep} wouldn't take much effort.
But sure, we can postpone it until somebody has problems with the current
approach.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
2026-04-07 11:15 ` Petr Vorel
@ 2026-04-07 11:24 ` Cyril Hrubis
2026-04-08 7:06 ` Petr Vorel
0 siblings, 1 reply; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-07 11:24 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > > Thinking about it twice, could we check for the module by reading
> > > /sys/module/? Our current approach shows what module *should* be available, but
> > > that might not be true for some reason (i.e. loadable module not installed).
>
> > The modules.dep file contains names of all modules installed in
> > particular kernel modules directory. We cannot do anything better than
> > parsing that file because it's (re)genrated on the system each time
> > packages with modules have been installed/removed. If that wasn't the
> > case modprobe that depends on that file wouldn't work either.
>
> We effectively ask users to install modules.dep and modules.builtin. While this
> is ok for distros and nobody has complained, I can imagine special embedded
> systems can have problem. If everything was reliably detectable via /sys or
> /proc I'd move to it. But even it's not working for all modules, checking first
> /sys/module/ and fallback using modules.{builtin,dep} wouldn't take much effort.
My code does not add any new dependencies. The check for module.dep has
been in LTP since:
8f7013ba6917 ('tst_check_driver(): Fix kernel module detection on BusyBox')
which was introduced five years ago.
The only thing that changes is that the check is being moved from
needs_drivers to needs_kconfigs.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers
2026-04-07 10:02 ` Cyril Hrubis
@ 2026-04-07 11:39 ` Li Wang via ltp
2026-04-07 11:40 ` Cyril Hrubis
0 siblings, 1 reply; 36+ messages in thread
From: Li Wang via ltp @ 2026-04-07 11:39 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Overall it's good, just minor polishing below:
> --- a/include/tst_test.h
> +++ b/include/tst_test.h
> @@ -511,6 +511,13 @@ struct tst_fs {
> * and parenthesis are supported, e.g.
> * "CONFIG_X86_INTEL_UMIP=y | CONFIG_X86_UIMP=y" is evaluated
> * to true if at least one of the options is present.
> + * For some config options their presence in the config file
> + * is not enough to assure the functionality is present or
Merely finding a config option in the config file does not
guarantee that the corresponding functionality is available.
> + * enabled. E.g. config option may be set to 'm' but the
> + * module may not be installed or functionality may be
> + * disabled on the kernel command line. The kconfig library
For instance, an option might be set to 'm' without the
module being installed, or the feature could be disabled via
the kernel command line.
> + * has a set of additonal checks for a few config options that
> + * are used in the tests and need additional checks.
To address this, the kconfig library implements supplementary
runtime checks for specific options required by the tests.
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers
2026-04-07 11:39 ` Li Wang via ltp
@ 2026-04-07 11:40 ` Cyril Hrubis
0 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-07 11:40 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
Hi!
> > --- a/include/tst_test.h
> > +++ b/include/tst_test.h
> > @@ -511,6 +511,13 @@ struct tst_fs {
> > * and parenthesis are supported, e.g.
> > * "CONFIG_X86_INTEL_UMIP=y | CONFIG_X86_UIMP=y" is evaluated
> > * to true if at least one of the options is present.
>
> > + * For some config options their presence in the config file
> > + * is not enough to assure the functionality is present or
>
> Merely finding a config option in the config file does not
> guarantee that the corresponding functionality is available.
>
> > + * enabled. E.g. config option may be set to 'm' but the
> > + * module may not be installed or functionality may be
> > + * disabled on the kernel command line. The kconfig library
>
> For instance, an option might be set to 'm' without the
> module being installed, or the feature could be disabled via
> the kernel command line.
>
> > + * has a set of additonal checks for a few config options that
> > + * are used in the tests and need additional checks.
>
> To address this, the kconfig library implements supplementary
> runtime checks for specific options required by the tests.
Thanks, will use that version for the final patchset.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks
2026-04-07 10:05 ` Cyril Hrubis
@ 2026-04-07 11:40 ` Li Wang via ltp
2026-04-07 11:44 ` Cyril Hrubis
0 siblings, 1 reply; 36+ messages in thread
From: Li Wang via ltp @ 2026-04-07 11:40 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> I do not have strong opition, if you agree that these names are better
> we can rename them.
Yes, I have a bit preference to rename.
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks
2026-04-07 11:40 ` Li Wang via ltp
@ 2026-04-07 11:44 ` Cyril Hrubis
0 siblings, 0 replies; 36+ messages in thread
From: Cyril Hrubis @ 2026-04-07 11:44 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
Hi!
> > I do not have strong opition, if you agree that these names are better
> > we can rename them.
>
> Yes, I have a bit preference to rename.
I will rename the config module checks in this patchset and add a rename
for the runtime checks on the top of it later on then.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver()
2026-04-07 11:24 ` Cyril Hrubis
@ 2026-04-08 7:06 ` Petr Vorel
0 siblings, 0 replies; 36+ messages in thread
From: Petr Vorel @ 2026-04-08 7:06 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > > > Thinking about it twice, could we check for the module by reading
> > > > /sys/module/? Our current approach shows what module *should* be available, but
> > > > that might not be true for some reason (i.e. loadable module not installed).
> > > The modules.dep file contains names of all modules installed in
> > > particular kernel modules directory. We cannot do anything better than
> > > parsing that file because it's (re)genrated on the system each time
> > > packages with modules have been installed/removed. If that wasn't the
> > > case modprobe that depends on that file wouldn't work either.
> > We effectively ask users to install modules.dep and modules.builtin. While this
> > is ok for distros and nobody has complained, I can imagine special embedded
> > systems can have problem. If everything was reliably detectable via /sys or
> > /proc I'd move to it. But even it's not working for all modules, checking first
> > /sys/module/ and fallback using modules.{builtin,dep} wouldn't take much effort.
> My code does not add any new dependencies. The check for module.dep has
> been in LTP since:
> 8f7013ba6917 ('tst_check_driver(): Fix kernel module detection on BusyBox')
> which was introduced five years ago.
> The only thing that changes is that the check is being moved from
> needs_drivers to needs_kconfigs.
Sure, it's not new dependency and I like this cleanup. My point is not directly
related to the these changes, but to the fact that I probably did not know about
/sys/module/ back then. But I knew the limitations (no detection on Android,
possible problems on embedded).
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 36+ messages in thread
end of thread, other threads:[~2026-04-08 7:06 UTC | newest]
Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02 12:13 [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 01/17] syscalls: ioctl08: Remove .needs_drivers Cyril Hrubis
2026-04-02 21:34 ` Petr Vorel
2026-04-02 12:13 ` [LTP] [PATCH 02/17] lib: shell: Remove needs_drivers from JSON parser Cyril Hrubis
2026-04-02 21:29 ` Petr Vorel
2026-04-02 12:13 ` [LTP] [PATCH 03/17] lib: tst_kernel: Add tst_check_module_driver() Cyril Hrubis
2026-04-02 21:26 ` Petr Vorel
2026-04-02 21:47 ` Petr Vorel
2026-04-07 9:43 ` Cyril Hrubis
2026-04-07 11:15 ` Petr Vorel
2026-04-07 11:24 ` Cyril Hrubis
2026-04-08 7:06 ` Petr Vorel
2026-04-02 12:13 ` [LTP] [PATCH 04/17] lib: tst_kconfig: Add module presence checks Cyril Hrubis
2026-04-03 3:09 ` Li Wang via ltp
2026-04-07 10:05 ` Cyril Hrubis
2026-04-07 11:40 ` Li Wang via ltp
2026-04-07 11:44 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 05/17] tests: kvm: Switch from needs_drivers to needs_kconfigs Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 06/17] tests: zram03: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 07/17] tests: squashfs01: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 08/17] tests: ioctl: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 09/17] tests: madvise11: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 10/17] tests: quotactl: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 11/17] tests: uevent: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 12/17] cve: tcindex01: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 13/17] tests: can: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 14/17] tests: fsetxattr: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 15/17] sctp: " Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 16/17] lib: tst_test: Remove now unused needs_drivers Cyril Hrubis
2026-04-03 3:01 ` Li Wang via ltp
2026-04-07 10:02 ` Cyril Hrubis
2026-04-07 11:39 ` Li Wang via ltp
2026-04-07 11:40 ` Cyril Hrubis
2026-04-02 12:13 ` [LTP] [PATCH 17/17] doc: metadata: Remove needs_drivers from docs Cyril Hrubis
2026-04-02 21:34 ` Petr Vorel
2026-04-02 21:59 ` [LTP] [PATCH 00/17] Replace needs_drivers with needs_kconfigs Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox