[LTP] [PATCH 1/1] lib: Print version and kernel early enough

Petr Vorel pvorel@suse.cz
Wed Sep 30 11:51:16 CEST 2026


Print LTP version and tested kernel before calling do_setup()
which can quit testing due various reasons, e.g.:

    # ./fw_load02
    tst_kconfig.c:90: TINFO: Parsing kernel config '/proc/config.gz'
    tst_kconfig.c:90: TINFO: Parsing kernel config '/proc/config.gz'
    tst_kconfig.c:90: TINFO: Parsing kernel config '/proc/config.gz'
    tst_security.c:115: TINFO: SecureBoot sysfs file not available
    tst_security.c:94: TINFO: Unable to determine system lockdown state
    tst_security.c:115: TINFO: SecureBoot sysfs file not available
    tst_tmpdir.c:309: TINFO: Using /tmp/LTP_fw_ZRzLML as tmpdir (btrfs filesystem)
    tst_sys_conf.c:103: TBROK: Failed to read anything from
	'/sys/module/firmware_class/parameters/path': SUCCESS (0)

It's always good to know this info.

Fixes: eb0a5367fa ("lib: Print tested kernel and arch")
Fixes: 546beb5340 ("lib/C-API: Print LTP version at test start")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
It should be merged *after* the release.

 lib/tst_test.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index e27a24c246..10ff733971 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -2058,17 +2058,17 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)
 
 	tst_test = self;
 
+	tst_res(TINFO, "LTP version: "LTP_VERSION);
+
+	uname(&uval);
+	tst_res(TINFO, "Tested kernel: %s %s %s", uval.release, uval.version, uval.machine);
+
 	do_setup(argc, argv);
 	tst_enable_oom_protection(context->lib_pid);
 
 	SAFE_SIGNAL(SIGALRM, alarm_handler);
 	SAFE_SIGNAL(SIGUSR1, heartbeat_handler);
 
-	tst_res(TINFO, "LTP version: "LTP_VERSION);
-
-	uname(&uval);
-	tst_res(TINFO, "Tested kernel: %s %s %s", uval.release, uval.version, uval.machine);
-
 	if (tst_test->min_runtime && !tst_test->runtime)
 		tst_test->runtime = tst_test->min_runtime;
 
-- 
2.55.0



More information about the ltp mailing list