Commit 0a7a4ab
ktest: Run POST_KTEST hooks on failure and cancellation
[ Upstream commit bc6e165 ]
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: 921ed4c ("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>1 parent 9b798ad commit 0a7a4ab
1 file changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
1575 | 1576 | | |
1576 | 1577 | | |
1577 | 1578 | | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
1578 | 1597 | | |
1579 | 1598 | | |
1580 | 1599 | | |
| |||
1634 | 1653 | | |
1635 | 1654 | | |
1636 | 1655 | | |
| 1656 | + | |
1637 | 1657 | | |
1638 | 1658 | | |
1639 | 1659 | | |
| |||
4300 | 4320 | | |
4301 | 4321 | | |
4302 | 4322 | | |
| 4323 | + | |
4303 | 4324 | | |
4304 | 4325 | | |
4305 | 4326 | | |
| |||
4661 | 4682 | | |
4662 | 4683 | | |
4663 | 4684 | | |
4664 | | - | |
4665 | | - | |
4666 | | - | |
4667 | | - | |
4668 | | - | |
| 4685 | + | |
4669 | 4686 | | |
4670 | 4687 | | |
4671 | 4688 | | |
| |||
0 commit comments