linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kselftest/runner: Print new line in print of timeout log
@ 2019-12-02 11:42 SeongJae Park
  2019-12-02 11:42 ` [PATCH 2/2] kselftest: Support old perl versions SeongJae Park
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: SeongJae Park @ 2019-12-02 11:42 UTC (permalink / raw)
  To: shuah, keescook; +Cc: linux-kselftest, linux-kernel, sj38.park, SeongJae Park

From: SeongJae Park <sjpark@amazon.de>

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.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 tools/testing/selftests/kselftest/runner.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
index 84de7bc74f2c..a8d20cbb711c 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -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


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

* [PATCH 2/2] kselftest: Support old perl versions
  2019-12-02 11:42 [PATCH 1/2] kselftest/runner: Print new line in print of timeout log SeongJae Park
@ 2019-12-02 11:42 ` SeongJae Park
  2019-12-07 18:47   ` Kees Cook
  2019-12-06 19:31 ` [PATCH 1/2] kselftest/runner: Print new line in print of timeout log SeongJae Park
  2019-12-07 18:47 ` Kees Cook
  2 siblings, 1 reply; 7+ messages in thread
From: SeongJae Park @ 2019-12-02 11:42 UTC (permalink / raw)
  To: shuah, keescook; +Cc: linux-kselftest, linux-kernel, sj38.park, SeongJae Park

From: SeongJae Park <sjpark@amazon.de>

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.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 tools/testing/selftests/kselftest/prefix.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/kselftest/prefix.pl b/tools/testing/selftests/kselftest/prefix.pl
index ec7e48118183..31f7c2a0a8bd 100755
--- a/tools/testing/selftests/kselftest/prefix.pl
+++ b/tools/testing/selftests/kselftest/prefix.pl
@@ -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;
-- 
2.17.1


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

* Re: [PATCH 1/2] kselftest/runner: Print new line in print of timeout log
  2019-12-02 11:42 [PATCH 1/2] kselftest/runner: Print new line in print of timeout log SeongJae Park
  2019-12-02 11:42 ` [PATCH 2/2] kselftest: Support old perl versions SeongJae Park
@ 2019-12-06 19:31 ` SeongJae Park
  2019-12-07 18:47 ` Kees Cook
  2 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2019-12-06 19:31 UTC (permalink / raw)
  To: SeongJae Park
  Cc: Shuah Khan, Kees Cook, open list:KERNEL SELFTEST FRAMEWORK, LKML,
	SeongJae Park

Hello Shuah,


May I ask your comments?


Thanks,
SeongJae Park

On Mon, Dec 2, 2019 at 12:42 PM SeongJae Park <sjpark@amazon.com> wrote:
>
> From: SeongJae Park <sjpark@amazon.de>
>
> 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.
>
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> ---
>  tools/testing/selftests/kselftest/runner.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
> index 84de7bc74f2c..a8d20cbb711c 100644
> --- a/tools/testing/selftests/kselftest/runner.sh
> +++ b/tools/testing/selftests/kselftest/runner.sh
> @@ -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
>

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

* Re: [PATCH 1/2] kselftest/runner: Print new line in print of timeout log
  2019-12-02 11:42 [PATCH 1/2] kselftest/runner: Print new line in print of timeout log SeongJae Park
  2019-12-02 11:42 ` [PATCH 2/2] kselftest: Support old perl versions SeongJae Park
  2019-12-06 19:31 ` [PATCH 1/2] kselftest/runner: Print new line in print of timeout log SeongJae Park
@ 2019-12-07 18:47 ` Kees Cook
  2019-12-11 17:19   ` shuah
  2 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2019-12-07 18:47 UTC (permalink / raw)
  To: SeongJae Park
  Cc: shuah, linux-kselftest, linux-kernel, sj38.park, SeongJae Park

On Mon, Dec 02, 2019 at 12:42:20PM +0100, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
> 
> 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.
> 
> Signed-off-by: SeongJae Park <sjpark@amazon.de>

Acked-by: Kees Cook <keescook@chromium.org>

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

-Kees

> ---
>  tools/testing/selftests/kselftest/runner.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
> index 84de7bc74f2c..a8d20cbb711c 100644
> --- a/tools/testing/selftests/kselftest/runner.sh
> +++ b/tools/testing/selftests/kselftest/runner.sh
> @@ -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
> 

-- 
Kees Cook

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

* Re: [PATCH 2/2] kselftest: Support old perl versions
  2019-12-02 11:42 ` [PATCH 2/2] kselftest: Support old perl versions SeongJae Park
@ 2019-12-07 18:47   ` Kees Cook
  2019-12-11 17:20     ` shuah
  0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2019-12-07 18:47 UTC (permalink / raw)
  To: SeongJae Park
  Cc: shuah, linux-kselftest, linux-kernel, sj38.park, SeongJae Park

On Mon, Dec 02, 2019 at 12:42:21PM +0100, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
> 
> 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.
> 
> Signed-off-by: SeongJae Park <sjpark@amazon.de>

Good catch!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  tools/testing/selftests/kselftest/prefix.pl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/kselftest/prefix.pl b/tools/testing/selftests/kselftest/prefix.pl
> index ec7e48118183..31f7c2a0a8bd 100755
> --- a/tools/testing/selftests/kselftest/prefix.pl
> +++ b/tools/testing/selftests/kselftest/prefix.pl
> @@ -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;
> -- 
> 2.17.1
> 

-- 
Kees Cook

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

* Re: [PATCH 1/2] kselftest/runner: Print new line in print of timeout log
  2019-12-07 18:47 ` Kees Cook
@ 2019-12-11 17:19   ` shuah
  0 siblings, 0 replies; 7+ messages in thread
From: shuah @ 2019-12-11 17:19 UTC (permalink / raw)
  To: Kees Cook, SeongJae Park
  Cc: linux-kselftest, linux-kernel, sj38.park, SeongJae Park, shuah

On 12/7/19 11:47 AM, Kees Cook wrote:
> On Mon, Dec 02, 2019 at 12:42:20PM +0100, SeongJae Park wrote:
>> From: SeongJae Park <sjpark@amazon.de>
>>
>> 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.
>>
>> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> 
> Acked-by: Kees Cook <keescook@chromium.org>
> 
> Cool, yeah, this looks fine to me. Nice idea!
> 
> -Kees
> 
>> ---
>>   tools/testing/selftests/kselftest/runner.sh | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
>> index 84de7bc74f2c..a8d20cbb711c 100644
>> --- a/tools/testing/selftests/kselftest/runner.sh
>> +++ b/tools/testing/selftests/kselftest/runner.sh
>> @@ -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
>>
> 

Thanks. Applying to fixes for the next 5.5-rc

-- Shuah

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

* Re: [PATCH 2/2] kselftest: Support old perl versions
  2019-12-07 18:47   ` Kees Cook
@ 2019-12-11 17:20     ` shuah
  0 siblings, 0 replies; 7+ messages in thread
From: shuah @ 2019-12-11 17:20 UTC (permalink / raw)
  To: Kees Cook, SeongJae Park
  Cc: linux-kselftest, linux-kernel, sj38.park, SeongJae Park, shuah

On 12/7/19 11:47 AM, Kees Cook wrote:
> On Mon, Dec 02, 2019 at 12:42:21PM +0100, SeongJae Park wrote:
>> From: SeongJae Park <sjpark@amazon.de>
>>
>> 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.
>>
>> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> 
> Good catch!
> 
> Acked-by: Kees Cook <keescook@chromium.org>
> 
> -Kees
> 
>> ---
>>   tools/testing/selftests/kselftest/prefix.pl | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/testing/selftests/kselftest/prefix.pl b/tools/testing/selftests/kselftest/prefix.pl
>> index ec7e48118183..31f7c2a0a8bd 100755
>> --- a/tools/testing/selftests/kselftest/prefix.pl
>> +++ b/tools/testing/selftests/kselftest/prefix.pl
>> @@ -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;
>> -- 
>> 2.17.1
>>
> 

Applying to fixes for next 5.5-rc

thanks,
-- Shuah

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

end of thread, other threads:[~2019-12-11 17:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 11:42 [PATCH 1/2] kselftest/runner: Print new line in print of timeout log SeongJae Park
2019-12-02 11:42 ` [PATCH 2/2] kselftest: Support old perl versions SeongJae Park
2019-12-07 18:47   ` Kees Cook
2019-12-11 17:20     ` shuah
2019-12-06 19:31 ` [PATCH 1/2] kselftest/runner: Print new line in print of timeout log SeongJae Park
2019-12-07 18:47 ` Kees Cook
2019-12-11 17:19   ` shuah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).