Skip to contentSkip to conversation

selftests: cpufreq: Write test output to stdout as well

PATCH In review Nícolas F. R. A. Prado 3 participants 3 messages Jan 14, 2022 – Jan 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: cpufreq: Write test output to stdout as well

Use 'tee' to send the test output to stdout in addition to the current output file. This makes the output easier to handle in automated test systems and is superior to only later dumping the output file contents to stdout, since this way the test output can be interleaved with other log messages, like from the kernel, so that chronology is preserved, making it easier to detect issues.

---
 tools/testing/selftests/cpufreq/main.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cpufreq/main.sh +1 -1
index 31f8c9a76c5f..60ce18ed0666 100755
@@ -194,5 +194,5 @@ prerequisite
 
 # Run requested functions
 clear_dumps $OUTFILE
-do_test >> $OUTFILE.txt
+do_test | tee -a $OUTFILE.txt
 dmesg_dumps $OUTFILE
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Nícolas F. R. A. Prado

Use 'tee' to send the test output to stdout in addition to the current output file. This makes the output easier to handle in automated test systems and is superior to only later dumping the output file contents to stdout, since this way the test output can be interleaved with other log messages, like from the kernel, so that chronology is preserved, making it easier to detect issues.

---
 tools/testing/selftests/cpufreq/main.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cpufreq/main.sh +0 -0
index 31f8c9a76c5f..60ce18ed0666 100755

tools/testing/selftests/cpufreq/main.sh prerequisite · line 198

Quoted 6 lines
tools/testing/selftests/cpufreq/main.sh +1 -1
@@ -194,5 +194,5 @@ prerequisite
 
 # Run requested functions
 clear_dumps $OUTFILE
-do_test >> $OUTFILE.txt
+do_test | tee -a $OUTFILE.txt
 dmesg_dumps $OUTFILE
Signature · 1 line
viresh
maintainer
#2 lore raw
Quoted 19 lines · Viresh Kumar
Quoted 18 lines · Nícolas F. R. A. Prado

Use 'tee' to send the test output to stdout in addition to the current output file. This makes the output easier to handle in automated test systems and is superior to only later dumping the output file contents to stdout, since this way the test output can be interleaved with other log messages, like from the kernel, so that chronology is preserved, making it easier to detect issues.

---
  tools/testing/selftests/cpufreq/main.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cpufreq/main.sh +0 -0
index 31f8c9a76c5f..60ce18ed0666 100755
@@ -194,5 +194,5 @@ prerequisite
 
Quoted 8 lines

tools/testing/selftests/cpufreq/main.sh prerequisite · line 198

Quoted 5 lines
tools/testing/selftests/cpufreq/main.sh +1 -1
  # Run requested functions
  clear_dumps $OUTFILE
-do_test >> $OUTFILE.txt
+do_test | tee -a $OUTFILE.txt
  dmesg_dumps $OUTFILE

Thank you. Applied to linux-kselftest fixes for rc2/3

thanks,
-- Shuah