]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kunit: tool: Terminate kernel under test on SIGINT
authorDavid Gow <david@davidgow.net>
Sat, 28 Feb 2026 10:07:22 +0000 (18:07 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 Apr 2026 20:09:04 +0000 (14:09 -0600)
commit8f260b02eeeffbf2263c2b82b6e3e32fd73cde2b
tree9af7e8d481abf2a8bd71ec62988a532c81126e69
parente42c349f4cdfa43cb39a68c8f764f8cafc23a9a9
kunit: tool: Terminate kernel under test on SIGINT

kunit.py will attempt to catch SIGINT / ^C in order to ensure the TTY isn't
messed up, but never actually attempts to terminate the running kernel (be
it UML or QEMU). This can lead to a bit of frustration if the kernel has
crashed or hung.

Terminate the kernel process in the signal handler, if it's running. This
requires plumbing through the process handle in a few more places (and
having some checks to see if the kernel is still running in places where it
may have already been killed).

Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Closes: https://lore.kernel.org/all/aaFmiAmg9S18EANA@smile.fi.intel.com/
Signed-off-by: David Gow <david@davidgow.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/kunit/kunit_kernel.py