From: Li Wang <li.wang@linux.dev>
To: ltp@lists.linux.it
Subject: [LTP] [Patch v2 4/4] testcases: drop manual tst_modprobe() now handled by tst_kconfig
Date: Thu, 8 Oct 2026 13:21:41 +0800 [thread overview]
Message-ID: <20261008052141.129763-5-li.wang@linux.dev> (raw)
In-Reply-To: <20261008052141.129763-1-li.wang@linux.dev>
Now that tst_kconfig loads the modules for every CONFIG_*=m entry
listed in config_module_maps[] and unloads them again at cleanup
time, tests no longer have to call tst_modprobe() from setup().
Drop the explicit tst_modprobe() calls, and the now unused
tst_module.h includes, from:
- cve-2026-46331.c: sch_ingress, cls_matchall, act_pedit
- sctphantom.c: sctp
- keyctl29.c: x509_key_parser
- keyctl30.c: pkcs8_key_parser
All four tests already declare the matching configs in
.needs_kconfigs, so tst_kconfig takes care of loading the modules
before setup() runs and unloading them once the test finishes.
BTW, with KCONFIG_SKIP_CHECK=1 the config check returns early,
so the automatic module loading is skipped as well. Users who set
that variable are expected to ensure the required modules are
loaded themselves.
Signed-off-by: Li Wang <li.wang@linux.dev>
---
testcases/cve/cve-2026-46331.c | 7 -------
testcases/cve/sctphantom.c | 3 ---
testcases/kernel/syscalls/keyctl/keyctl29.c | 3 ---
testcases/kernel/syscalls/keyctl/keyctl30.c | 3 ---
4 files changed, 16 deletions(-)
diff --git a/testcases/cve/cve-2026-46331.c b/testcases/cve/cve-2026-46331.c
index 3d32a1cbb..3c8db5042 100644
--- a/testcases/cve/cve-2026-46331.c
+++ b/testcases/cve/cve-2026-46331.c
@@ -44,7 +44,6 @@
#include <linux/rtnetlink.h>
#include "tst_test.h"
-#include "tst_module.h"
#include "tst_net.h"
#include "tst_netdevice.h"
#include "lapi/if_ether.h"
@@ -136,12 +135,6 @@ static void setup(void)
{
struct sockaddr_in addr;
struct passwd *pw;
- static const char *const mods[] = {
- "sch_ingress", "cls_matchall", "act_pedit"
- };
-
- for (unsigned int i = 0; i < ARRAY_SIZE(mods); i++)
- tst_modprobe(mods[i], NULL);
/* Drop privileges so the reproducer runs as an unprivileged user */
pw = SAFE_GETPWNAM("nobody");
diff --git a/testcases/cve/sctphantom.c b/testcases/cve/sctphantom.c
index 83834b848..bdbe40286 100644
--- a/testcases/cve/sctphantom.c
+++ b/testcases/cve/sctphantom.c
@@ -50,7 +50,6 @@
*/
#include "tst_test.h"
-#include "tst_module.h"
#include "tst_checksum.h"
#include "tst_safe_net.h"
@@ -205,8 +204,6 @@ static void setup(void)
};
const struct tst_path_val *sysctl;
- tst_modprobe("sctp", NULL);
-
for (sysctl = sysctls; sysctl->path; sysctl++)
tst_sys_conf_save(sysctl);
diff --git a/testcases/kernel/syscalls/keyctl/keyctl29.c b/testcases/kernel/syscalls/keyctl/keyctl29.c
index afc0a093c..e66b39bcb 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl29.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl29.c
@@ -23,7 +23,6 @@
#include "keyctl_common.h"
#include "keyctl_pkey_data.h"
-#include "tst_module.h"
static key_serial_t cert_key;
static struct keyctl_pkey_query *query_buf;
@@ -32,8 +31,6 @@ static void setup(void)
{
SAFE_KEYCTL(KEYCTL_JOIN_SESSION_KEYRING, 0, 0, 0, 0);
- tst_modprobe("x509_key_parser", NULL);
-
cert_key = add_asymmetric_key_or_tconf("cert", rsa2048_cert,
sizeof(rsa2048_cert),
"CONFIG_X509_CERTIFICATE_PARSER");
diff --git a/testcases/kernel/syscalls/keyctl/keyctl30.c b/testcases/kernel/syscalls/keyctl/keyctl30.c
index ef51bba33..4f43007e0 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl30.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl30.c
@@ -20,7 +20,6 @@
#include "keyctl_common.h"
#include "keyctl_pkey_data.h"
-#include "tst_module.h"
static key_serial_t priv_key;
static struct keyctl_pkey_query *query_buf;
@@ -29,8 +28,6 @@ static void setup(void)
{
SAFE_KEYCTL(KEYCTL_JOIN_SESSION_KEYRING, 0, 0, 0, 0);
- tst_modprobe("pkcs8_key_parser", NULL);
-
priv_key = add_asymmetric_key_or_tconf("priv", rsa2048_pkcs8,
sizeof(rsa2048_pkcs8),
"CONFIG_PKCS8_PRIVATE_KEY_PARSER");
--
2.56.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-10-08 5:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 5:21 [LTP] [Patch v2 0/4] tst_kconfig: automatic module load/unload for CONFIG_*=m Li Wang
2026-10-08 5:21 ` [LTP] [Patch v2 1/4] lib: add module is loaded check Li Wang
2026-10-08 10:14 ` [LTP] " linuxtestproject.agent
2026-10-10 1:43 ` Li Wang
2026-10-08 5:21 ` [LTP] [Patch v2 2/4] tst_kconfig: load and unload kernel modules for CONFIG_*=m Li Wang
2026-10-08 5:21 ` [LTP] [Patch v2 3/4] tst_kconfig: add module mappings for vsock/vsock_loopback Li Wang
2026-10-08 5:21 ` Li Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261008052141.129763-5-li.wang@linux.dev \
--to=li.wang@linux.dev \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox