Skip to contentSkip to conversation

kselftest/runner: Print new line in print of timeout log

PATCH In review SeongJae Park 4 participants 7 messages Dec 2, 2019 – Dec 11, 2019 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 kselftest/runner: Print new line in print of timeout log

From: SeongJae Park <[email protected]>

If a timeout failure occurs, kselftest kills the test process and prints the timeout log. If the test process has killed while printing a log that ends with new line, the timeout log can be printed in middle of the test process output so that it can be seems like a comment, as below:

# test_process_log not ok 3 selftests: timers: nsleep-lat # TIMEOUT

This commit avoids such problem by printing one more line before the TIMEOUT failure log.

---
 tools/testing/selftests/kselftest/runner.sh | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/kselftest/runner.sh +1 -0
index 84de7bc74f2c..a8d20cbb711c 100644
@@ -79,6 +79,7 @@ run_one()
 		if [ $rc -eq $skip_rc ]; then	\
 			echo "not ok $test_num $TEST_HDR_MSG # SKIP"
 		elif [ $rc -eq $timeout_rc ]; then \
+			echo "#"
 			echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT"
 		else
 			echo "not ok $test_num $TEST_HDR_MSG # exit=$rc"
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 kselftest: Support old perl versions

From: SeongJae Park <[email protected]>

On an old perl such as v5.10.1, kselftest/prefix.pl gives below error message:

Can't locate object method "autoflush" via package "IO::Handle" at kselftest/prefix.pl line 10.

This commit fixes the error by explicitly specifying the use of the IO::Handle package.

---
 tools/testing/selftests/kselftest/prefix.pl | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/kselftest/prefix.pl +1 -0
index ec7e48118183..31f7c2a0a8bd 100755
@@ -3,6 +3,7 @@
 # Prefix all lines with "# ", unbuffered. Command being piped in may need
 # to have unbuffering forced with "stdbuf -i0 -o0 -e0 $cmd".
 use strict;
+use IO::Handle;
 
 binmode STDIN;
 binmode STDOUT;
Signature · 1 line
2.17.1
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] kselftest: Support old perl versions

Quoted 11 lines · SeongJae Park

From: SeongJae Park <[email protected]>

On an old perl such as v5.10.1, kselftest/prefix.pl gives below error message:

Can't locate object method "autoflush" via package "IO::Handle" at kselftest/prefix.pl line 10.

This commit fixes the error by explicitly specifying the use of the IO::Handle package.

Good catch!

-Kees

Quoted 19 lines
---
 tools/testing/selftests/kselftest/prefix.pl | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/kselftest/prefix.pl +1 -0
index ec7e48118183..31f7c2a0a8bd 100755
@@ -3,6 +3,7 @@
 # Prefix all lines with "# ", unbuffered. Command being piped in may need
 # to have unbuffering forced with "stdbuf -i0 -o0 -e0 $cmd".
 use strict;
+use IO::Handle;
 
 binmode STDIN;
 binmode STDOUT;
Signature · 1 line
2.17.1
Signature · 1 line
Kees Cook
maintainer
#3 lore raw

Re: [PATCH 2/2] kselftest: Support old perl versions

Quoted 33 lines · Kees Cook
Quoted 11 lines · SeongJae Park

From: SeongJae Park <[email protected]>

On an old perl such as v5.10.1, kselftest/prefix.pl gives below error message:

Can't locate object method "autoflush" via package "IO::Handle" at kselftest/prefix.pl line 10.

This commit fixes the error by explicitly specifying the use of the IO::Handle package.

Good catch!

-Kees

Quoted 14 lines
---
  tools/testing/selftests/kselftest/prefix.pl | 1 +
  1 file changed, 1 insertion(+)
tools/testing/selftests/kselftest/prefix.pl +1 -0
index ec7e48118183..31f7c2a0a8bd 100755
@@ -3,6 +3,7 @@
  # Prefix all lines with "# ", unbuffered. Command being piped in may need
  # to have unbuffering forced with "stdbuf -i0 -o0 -e0 $cmd".
  use strict;
+use IO::Handle;
 
Quoted 6 lines
Quoted 5 lines
tools/testing/selftests/kselftest/prefix.pl +0 -0
  binmode STDIN;
  binmode STDOUT;
Signature · 1 line
2.17.1

Applying to fixes for next 5.5-rc

thanks,
-- Shuah

#4 lore raw
In reply to SeongJae Park

Hello Shuah,

May I ask your comments?

Thanks,
SeongJae Park

Quoted 33 lines · SeongJae Park

From: SeongJae Park <[email protected]>

If a timeout failure occurs, kselftest kills the test process and prints the timeout log. If the test process has killed while printing a log that ends with new line, the timeout log can be printed in middle of the test process output so that it can be seems like a comment, as below:

    # test_process_log  not ok 3 selftests: timers: nsleep-lat # TIMEOUT

This commit avoids such problem by printing one more line before the TIMEOUT failure log.

---
 tools/testing/selftests/kselftest/runner.sh | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/kselftest/runner.sh +1 -1
index 84de7bc74f2c..a8d20cbb711c 100644
@@ -79,6 +79,7 @@ run_one()
                if [ $rc -eq $skip_rc ]; then   \
                        echo "not ok $test_num $TEST_HDR_MSG # SKIP"
                elif [ $rc -eq $timeout_rc ]; then \
+                       echo "#"
                        echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT"
                else
                        echo "not ok $test_num $TEST_HDR_MSG # exit=$rc"
--

2.17.1

Acked-by on v1 1/2
#5 lore raw
In reply to SeongJae Park
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

If a timeout failure occurs, kselftest kills the test process and prints the timeout log. If the test process has killed while printing a log that ends with new line, the timeout log can be printed in middle of the test process output so that it can be seems like a comment, as below:

Quoted 6 lines

# test_process_log not ok 3 selftests: timers: nsleep-lat # TIMEOUT

This commit avoids such problem by printing one more line before the TIMEOUT failure log.

Cool, yeah, this looks fine to me. Nice idea!

-Kees

Quoted 19 lines
---
 tools/testing/selftests/kselftest/runner.sh | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/kselftest/runner.sh +1 -0
index 84de7bc74f2c..a8d20cbb711c 100644
@@ -79,6 +79,7 @@ run_one()
 		if [ $rc -eq $skip_rc ]; then	\
 			echo "not ok $test_num $TEST_HDR_MSG # SKIP"
 		elif [ $rc -eq $timeout_rc ]; then \
+			echo "#"
 			echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT"
 		else
 			echo "not ok $test_num $TEST_HDR_MSG # exit=$rc"
Signature · 1 line
2.17.1
Signature · 1 line
Kees Cook
maintainer
#6 lore raw
Quoted 25 lines · Kees Cook
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

If a timeout failure occurs, kselftest kills the test process and prints the timeout log. If the test process has killed while printing a log that ends with new line, the timeout log can be printed in middle of the test process output so that it can be seems like a comment, as below:

Quoted 6 lines

# test_process_log not ok 3 selftests: timers: nsleep-lat # TIMEOUT

This commit avoids such problem by printing one more line before the TIMEOUT failure log.

Cool, yeah, this looks fine to me. Nice idea!

-Kees

Quoted 4 lines
---
  tools/testing/selftests/kselftest/runner.sh | 1 +
  1 file changed, 1 insertion(+)
Quoted 16 lines
Quoted 15 lines
tools/testing/selftests/kselftest/runner.sh +1 -0
index 84de7bc74f2c..a8d20cbb711c 100644
@@ -79,6 +79,7 @@ run_one()
  		if [ $rc -eq $skip_rc ]; then	\
  			echo "not ok $test_num $TEST_HDR_MSG # SKIP"
  		elif [ $rc -eq $timeout_rc ]; then \
+			echo "#"
  			echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT"
  		else
  			echo "not ok $test_num $TEST_HDR_MSG # exit=$rc"
Signature · 1 line
2.17.1

Thanks. Applying to fixes for the next 5.5-rc

-- Shuah