[1/2] kselftest/runner: Print new line in print of timeout log
diff mbox series

Message ID 20191202114221.827-1-sjpark@amazon.com
State Mainlined
Commit d187801d1a46519d2a322f879f7c8f85c685372e
Headers show
Series
  • [1/2] kselftest/runner: Print new line in print of timeout log
Related show

Commit Message

SeongJae Park Dec. 2, 2019, 11:42 a.m. UTC
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(+)

Comments

SeongJae Park Dec. 6, 2019, 7:31 p.m. UTC | #1
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
>
Kees Cook Dec. 7, 2019, 6:47 p.m. UTC | #2
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
>
shuah Dec. 11, 2019, 5:19 p.m. UTC | #3
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

Patch
diff mbox series

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"