ktest: Store failure logs also in fatal paths
PATCH 1/1 ktest: Store failure logs also in fatal paths
STORE_FAILURES was only saved from fail(), so paths that reached dodie() could exit without preserving failure logs.
That includes fatal hook paths such as:
POST_BUILD_DIE = 1
and ordinary failures when:
DIE_ON_FAILURE = 1
Call save_logs("fail", ...) from dodie() too so fatal failures keep the same STORE_FAILURES artifacts as non-fatal fail() paths.
--- tools/testing/ktest/ktest.pl | 5 +++++ 1 file changed, 5 insertions(+)
tools/testing/ktest/ktest.pl +5 -0
@@ -1635,6 +1635,11 @@ sub dodie { print " See $opt{LOG_FILE} for more info.\n"; } + # Fatal paths bypass fail(), so STORE_FAILURES needs to be handled here. + if (defined($store_failures)) { + save_logs("fail", $store_failures); + } + if ($email_on_error) { my $name = get_test_name; my $log_file;
---
base-commit: 229517449879b3ca8ca5588593cbea6a67ba0ad2
change-id: 20260318-ktest-fixes-564376c0c56f
Best regards,
Signature · 1 line
Ricardo B. Marlière <[email protected]>
Steven Rostedt
maintainerQuoted 7 lines · On Wed, 18 Mar 2026 16:00:43 -0300 Ricardo B. Marlière <[email protected]> wrote:
STORE_FAILURESwas only saved fromfail(), so paths that reacheddodie()could exit without preserving failure logs.That includes fatal hook paths such as:
POST_BUILD_DIE= 1
Quoted 8 lines
and ordinary failures when:
DIE_ON_FAILURE= 1Call
save_logs("fail", ...)fromdodie()too so fatal failures keep the sameSTORE_FAILURESartifacts as non-fatalfail()paths.Signed-off-by Ricardo B. Marlière <[email protected]>
Applied, pending testing.
Thanks!
-- Steve