public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] lib: print kernel version
@ 2024-07-26  9:55 Petr Vorel
  2024-07-26  9:55 ` [LTP] [PATCH 1/3] lib: Print tested kernel and arch Petr Vorel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Petr Vorel @ 2024-07-26  9:55 UTC (permalink / raw)
  To: ltp

Hi,

a follow up of 5cabf2bea7 ("tst_tmpdir: Print used temporary dir and its
filesystem") which should help debugging of LTP failure reports.

Kind regards,
Petr

Petr Vorel (3):
  lib: Print tested kernel and arch
  tst_test.sh: lib: Print tested kernel and arch
  tst_test: Print used temporary dir and its filesystem

 lib/tst_test.c            | 6 ++++++
 testcases/lib/tst_test.sh | 2 ++
 2 files changed, 8 insertions(+)

-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 1/3] lib: Print tested kernel and arch
  2024-07-26  9:55 [LTP] [PATCH 0/3] lib: print kernel version Petr Vorel
@ 2024-07-26  9:55 ` Petr Vorel
  2024-07-26  9:55 ` [LTP] [PATCH 2/3] tst_test.sh: " Petr Vorel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-07-26  9:55 UTC (permalink / raw)
  To: ltp

This helps reviewing tests posted on ML or github issue
(reporters sometimes don't include this info).

Using interesting parts from struct utsname to get used linux
distribution, kernel version, release and architecture (less info than
when running 'uname -a', but other info is not much useful).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_test.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index e5bc5bf4da..63221c5e9d 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -13,6 +13,7 @@
 #include <errno.h>
 #include <sys/mount.h>
 #include <sys/types.h>
+#include <sys/utsname.h>
 #include <sys/wait.h>
 #include <math.h>
 
@@ -1793,6 +1794,7 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)
 {
 	int ret = 0;
 	unsigned int test_variants = 1;
+	struct utsname uval;
 
 	lib_pid = getpid();
 	tst_test = self;
@@ -1805,6 +1807,10 @@ void tst_run_tcases(int argc, char *argv[], struct 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);
+
 	if (tst_test->max_runtime)
 		results->max_runtime = multiply_runtime(tst_test->max_runtime);
 
-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 2/3] tst_test.sh: lib: Print tested kernel and arch
  2024-07-26  9:55 [LTP] [PATCH 0/3] lib: print kernel version Petr Vorel
  2024-07-26  9:55 ` [LTP] [PATCH 1/3] lib: Print tested kernel and arch Petr Vorel
@ 2024-07-26  9:55 ` Petr Vorel
  2024-07-26  9:55 ` [LTP] [PATCH 3/3] tst_test: Print used temporary dir and its filesystem Petr Vorel
  2024-08-21  9:37 ` [LTP] [PATCH 0/3] lib: print kernel version Avinesh Kumar
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-07-26  9:55 UTC (permalink / raw)
  To: ltp

Similarly to previous commit this helps reviewing tests posted on ML or
github issue (reporters sometimes don't include this info). Use
'uname -a' (print more info than what is printed in C API).

Missing 'uname' binary (or busybox symlink) does not break test (just
the output is mangled), thus 'uname' presence is not tested/required.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 0d2fccb959..5ea2c9ba98 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -907,6 +907,7 @@ if [ -z "$TST_NO_DEFAULT_RUN" ]; then
 	TST_ARGS="$@"
 
 	tst_res TINFO "Running: $(basename $0) $TST_ARGS"
+	tst_res TINFO "Tested kernel: $(uname -a)"
 
 	OPTIND=1
 
-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 3/3] tst_test: Print used temporary dir and its filesystem
  2024-07-26  9:55 [LTP] [PATCH 0/3] lib: print kernel version Petr Vorel
  2024-07-26  9:55 ` [LTP] [PATCH 1/3] lib: Print tested kernel and arch Petr Vorel
  2024-07-26  9:55 ` [LTP] [PATCH 2/3] tst_test.sh: " Petr Vorel
@ 2024-07-26  9:55 ` Petr Vorel
  2024-08-21  9:37 ` [LTP] [PATCH 0/3] lib: print kernel version Avinesh Kumar
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-07-26  9:55 UTC (permalink / raw)
  To: ltp

It helps debugging to know used filesystem (and in case of
TST_ALL_FILESYSTEMS=1 the underlying filesystem). This follows
5cabf2bea7 change in C API, using 'stat' which should work also on
busybox.

Missing 'stat' binary (or busybox symlink) does not break test (just the
output is mangled), thus 'stat' presence is not tested/required.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 5ea2c9ba98..c19c30b76f 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -745,6 +745,7 @@ tst_run()
 
 		TST_STARTWD=$(pwd)
 		cd "$TST_TMPDIR"
+		tst_res TINFO "Using $TST_TMPDIR as tmpdir ($(stat -f -c '%T' $TST_TMPDIR) filesystem)"
 	fi
 
 	# needs to be after cd $TST_TMPDIR to keep test_dev.img under $TST_TMPDIR
-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH 0/3] lib: print kernel version
  2024-07-26  9:55 [LTP] [PATCH 0/3] lib: print kernel version Petr Vorel
                   ` (2 preceding siblings ...)
  2024-07-26  9:55 ` [LTP] [PATCH 3/3] tst_test: Print used temporary dir and its filesystem Petr Vorel
@ 2024-08-21  9:37 ` Avinesh Kumar
  2024-08-21 19:46   ` Petr Vorel
  3 siblings, 1 reply; 6+ messages in thread
From: Avinesh Kumar @ 2024-08-21  9:37 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi Petr,

I think this is very helpful. Thank you!

Reviewed-by: Avinesh Kumar <akumar@suse.de>
for all patches in series.

On Friday, July 26, 2024 11:55:43 AM GMT+2 Petr Vorel wrote:
> Hi,
> 
> a follow up of 5cabf2bea7 ("tst_tmpdir: Print used temporary dir and its
> filesystem") which should help debugging of LTP failure reports.
> 
> Kind regards,
> Petr
> 
> Petr Vorel (3):
>   lib: Print tested kernel and arch
>   tst_test.sh: lib: Print tested kernel and arch
>   tst_test: Print used temporary dir and its filesystem
> 
>  lib/tst_test.c            | 6 ++++++
>  testcases/lib/tst_test.sh | 2 ++
>  2 files changed, 8 insertions(+)
> 
> 

Regards,
Avinesh



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH 0/3] lib: print kernel version
  2024-08-21  9:37 ` [LTP] [PATCH 0/3] lib: print kernel version Avinesh Kumar
@ 2024-08-21 19:46   ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-08-21 19:46 UTC (permalink / raw)
  To: Avinesh Kumar; +Cc: ltp

Hi Avinesh,

> Hi Petr,

> I think this is very helpful. Thank you!

Thanks for your review, merged!

Kind regards,
Petr

> Reviewed-by: Avinesh Kumar <akumar@suse.de>
> for all patches in series.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-21 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-26  9:55 [LTP] [PATCH 0/3] lib: print kernel version Petr Vorel
2024-07-26  9:55 ` [LTP] [PATCH 1/3] lib: Print tested kernel and arch Petr Vorel
2024-07-26  9:55 ` [LTP] [PATCH 2/3] tst_test.sh: " Petr Vorel
2024-07-26  9:55 ` [LTP] [PATCH 3/3] tst_test: Print used temporary dir and its filesystem Petr Vorel
2024-08-21  9:37 ` [LTP] [PATCH 0/3] lib: print kernel version Avinesh Kumar
2024-08-21 19:46   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox