[LTP] [PATCH] kallsyms: check if CONFIG_KALLSYMS=y

Kuan-Ying Lee kuan-ying.lee@canonical.com
Thu Jun 27 04:19:47 CEST 2024


Only if CONFIG_KALLSYMS=y enable, node /proc/kallsyms is
generated.

We need to check if this config is set or not.

Signed-off-by: Kuan-Ying Lee <kuan-ying.lee@canonical.com>
---
 testcases/kernel/security/kallsyms/kallsyms.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testcases/kernel/security/kallsyms/kallsyms.c b/testcases/kernel/security/kallsyms/kallsyms.c
index ad3a9265afbe..2a5cbaa325ea 100644
--- a/testcases/kernel/security/kallsyms/kallsyms.c
+++ b/testcases/kernel/security/kallsyms/kallsyms.c
@@ -141,5 +141,9 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.max_runtime = 60,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_KALLSYMS=y",
+		NULL
+	},
 	.test_all = test_access_kernel_address,
 };
-- 
2.34.1



More information about the ltp mailing list