Commit bc6e165
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 <[email protected]>
Cc: Andrea Righi <[email protected]>
Cc: Marcos Paulo de Souza <[email protected]>
Cc: Matthieu Baerts <[email protected]>
Cc: Fernando Fernandez Mancera <[email protected]>
Cc: Pedro Falcato <[email protected]>
Link: https://patch.msgid.link/[email protected]
Fixes: 921ed4c ("ktest: Add PRE/POST_KTEST and TEST options")
Signed-off-by: Ricardo B. Marlière <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>1 parent 972816d commit bc6e165
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 | | |
| |||
1586 | 1587 | | |
1587 | 1588 | | |
1588 | 1589 | | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1589 | 1608 | | |
1590 | 1609 | | |
1591 | 1610 | | |
| |||
1645 | 1664 | | |
1646 | 1665 | | |
1647 | 1666 | | |
| 1667 | + | |
1648 | 1668 | | |
1649 | 1669 | | |
1650 | 1670 | | |
| |||
4314 | 4334 | | |
4315 | 4335 | | |
4316 | 4336 | | |
| 4337 | + | |
4317 | 4338 | | |
4318 | 4339 | | |
4319 | 4340 | | |
| |||
4679 | 4700 | | |
4680 | 4701 | | |
4681 | 4702 | | |
4682 | | - | |
4683 | | - | |
4684 | | - | |
4685 | | - | |
4686 | | - | |
| 4703 | + | |
4687 | 4704 | | |
4688 | 4705 | | |
4689 | 4706 | | |
| |||
0 commit comments