linux/tools/testing
Ricardo B. Marlière a93127766f ktest: Run POST_KTEST hooks on failure and cancellation
[ Upstream commit bc6e165a45 ]

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: 921ed4c720 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-06-01 17:35:32 +02:00
..
fault-injection docs: fault-injection: convert docs to ReST and rename to *.rst 2019-06-14 14:21:07 -06:00
ktest ktest: Run POST_KTEST hooks on failure and cancellation 2026-06-01 17:35:32 +02:00
kunit kunit: tool: Import missing importlib.abc 2022-02-23 12:03:04 +01:00
nvdimm tools/testing/nvdimm: Use per-DIMM device handle 2026-01-19 13:09:52 +01:00
radix-tree idr: fix idr_alloc() returning an ID out of range 2026-01-19 13:10:02 +01:00
scatterlist Merge branch 'akpm' (patches from Andrew) 2021-09-03 10:08:28 -07:00
selftests selftest: memcg: skip memcg_sock test if address family not supported 2026-06-01 17:35:32 +02:00
vsock vsock/test: add a final full barrier after run all tests 2026-02-06 16:41:46 +01:00