]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: net: exit cleanly on SIGTERM / timeout
authorJakub Kicinski <kuba@kernel.org>
Sat, 3 May 2025 01:18:56 +0000 (18:18 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 6 May 2025 09:04:58 +0000 (11:04 +0200)
commit8f0ae19346ce1cadf17f5ea6b01e7b6eb815e2fd
tree73236520deefbcac4b77715cc57af708a4b63f59
parent90131a9b064b9e8a41d919a5ff43470b5a3faf0d
selftests: net: exit cleanly on SIGTERM / timeout

ksft runner sends 2 SIGTERMs in a row if a test runs out of time.
Handle this in a similar way we handle SIGINT - cleanup and stop
running further tests.

Because we get 2 signals we need a bit of logic to ignore
the subsequent one, they come immediately one after the other
(due to commit 9616cb34b08e ("kselftest/runner.sh: Propagate SIGTERM
to runner child")).

This change makes sure we run cleanup (scheduled defer()s)
and also print a stack trace on SIGTERM, which doesn't happen
by default. Tests occasionally hang in NIPA and it's impossible
to tell what they are waiting from or doing.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250503011856.46308-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/lib/py/ksft.py