]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ktest: Run POST_KTEST hooks on failure and cancellation
authorRicardo B. Marlière <rbm@suse.com>
Sat, 7 Mar 2026 22:08:03 +0000 (19:08 -0300)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 9 Mar 2026 15:02:18 +0000 (11:02 -0400)
commitbc6e165a452da909cef0efbc286e6695624db372
tree3aab98a19f0a71466cd0e079adea95e1ae654581
parent972816d21bb1c4eb2e5095aee34eb4b109f4c2e3
ktest: Run POST_KTEST hooks on failure and cancellation

PRE_KTEST can be useful for setting up the environment and POST_KTEST to
tear it down, however POST_KTEST only runs on the normal end-of-run path.
It is skipped when ktest exits through dodie() or cancel_test(). Final
cleanup hooks are skipped.

Factor the final hook execution into run_post_ktest(), call it from the
normal exit path and from the early exit paths, and guard it so the hook
runs at most once.

Cc: John Hawley <warthog9@eaglescrag.net>
Cc: Andrea Righi <arighi@nvidia.com>
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: Pedro Falcato <pfalcato@suse.de>
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-8-565d412f4925@suse.com
Fixes: 921ed4c7208e ("ktest: Add PRE/POST_KTEST and TEST options")
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl