Subject: Re: system info in test-suite.log

From: Collin Funk <[email-masked]>
Date: Mon, 17 Jun 2024 00:46:59 -0700

Hi Bruno,

You said:
> The problem with this is that
>   - It's not immediately clear to everyone what this information is.
>   - It can get in the way, for example when I want to search for "Linux"
>     among the test logs:
>       grep '^Linux' test-suite.log
>
> I would therefore suggest to mark them in some way:

I agree. Someone might not know the 'uname -a' output of their
machine. Solaris/SunOS comes to mind.

I've attached a patch that I think handles that and the extra space
you mentioned.

Here is what I see:

System information: Linux 6.8.11-300.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 27 14:53:33 UTC 2024 x86_64
Distribution:
NAME="Fedora Linux"
VERSION="40 (Workstation Edition)"
ID=fedora
VERSION_ID=40
VERSION_CODENAME=""
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Linux 40 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"

Collin

From d22f43b965cb5dcfa2c536802e3d3644bb80a25b Mon Sep 17 00:00:00 2001
From: Collin Funk <[email-masked]>
Date: Mon, 17 Jun 2024 00:32:07 -0700
Subject: [PATCH] test: Improve output of system information in test-suite.log.

Fixes https://bugs.gnu.org/71421.

* lib/am/check.am ($(TEST_SUITE_LOG): Use $(AWK) instead of 'awk'.  Remove an
extra space in uname output.  Start the line with "System information:".
---
 lib/am/check.am | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/am/check.am b/lib/am/check.am
index a506d1c79..04af927a1 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -366,10 +366,20 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	{ \
 ## Omit the hostname for privacy.  In practice it's a single word?
           echo;                                    \
-	  (uname -a | awk '{$$2=""; print}') 2>&1; \
+	  { uname -a | $(AWK) '{                   \
+  printf "System information:";                    \
+  for (i = 1; i < NF; ++i)                         \
+    {                                              \
+      if (i != 2)                                  \
+        printf " %s", $$i;                         \
+    }                                              \
+  printf "\n";                                     \
+}'; } 2>&1;                                        \
 	  if test -r /etc/os-release; then         \
+	    echo "Distribution:";                  \
 	    sed 8q /etc/os-release;                \
 	  elif test -r /etc/issue; then            \
+	    echo "Distribution:";                  \
 	    cat /etc/issue;                        \
 	  fi;                                      \
 	}; \
-- 
2.45.2