linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests/harness: Handle timeouts cleanly
@ 2020-03-11 21:17 Kees Cook
  2020-03-11 21:17 ` [PATCH 1/2] selftests/seccomp: Move test child waiting logic Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kees Cook @ 2020-03-11 21:17 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Kees Cook, Andy Lutomirski, Will Drewry, linux-kselftest, linux-kernel

When a selftest would timeout before, the program would just fall over
and no accounting of failures would be reported (i.e. it would result in
an incomplete TAP report). Instead, add an explicit SIGALRM handler to
cleanly catch and report the timeout.

Before:

        [==========] Running 2 tests from 2 test cases.
        [ RUN      ] timeout.finish
        [       OK ] timeout.finish
        [ RUN      ] timeout.too_long
        Alarm clock

After:

        [==========] Running 2 tests from 2 test cases.
        [ RUN      ] timeout.finish
        [       OK ] timeout.finish
        [ RUN      ] timeout.too_long
        timeout.too_long: Test terminated by timeout
        [     FAIL ] timeout.too_long
        [==========] 1 / 2 tests passed.
        [  FAILED  ]

-Kees

Kees Cook (2):
  selftests/seccomp: Move test child waiting logic
  selftests/harness: Handle timeouts cleanly

 tools/testing/selftests/kselftest_harness.h | 144 ++++++++++++++------
 1 file changed, 99 insertions(+), 45 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2020-03-13 23:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 21:17 [PATCH 0/2] selftests/harness: Handle timeouts cleanly Kees Cook
2020-03-11 21:17 ` [PATCH 1/2] selftests/seccomp: Move test child waiting logic Kees Cook
2020-03-12  4:52   ` Kees Cook
2020-03-11 21:17 ` [PATCH 2/2] selftests/harness: Handle timeouts cleanly Kees Cook
2020-03-13 17:25 ` [PATCH 0/2] " shuah
2020-03-13 23:10   ` Kees Cook

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).