* [for-linus][PATCH 0/2] ktest: Fixes for v7.1
@ 2026-04-20 19:32 Steven Rostedt
2026-04-20 19:32 ` [for-linus][PATCH 1/2] ktest: Fix the month in the name of the failure directory Steven Rostedt
2026-04-20 19:32 ` [for-linus][PATCH 2/2] ktest: Add logfile to " Steven Rostedt
0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2026-04-20 19:32 UTC (permalink / raw)
To: linux-kernel; +Cc: John Warthog9 Hawley
ktest updates for v7.1:
- Fix date timestamp of failure directory
When a ktest fails, if STORE_FAILURES is set, then if a test fails, it
copies various files to a created directory in the STORE_FAILURES
location (like the .config used, and some other files). To create the
timestamp portion of the directory name, the Perl function localtime() is
used. The month field starts from 0 and the code does not account for
this. That is, the date of April 20, 2026 will be displayed as 20260320
instead of 20260420. Add one to the month to have the date be more
accurate.
- Save the entire log file in the failure directory
The logfile that keeps track of all tests contains boot messages, error
messages, dmesg, etc. This information is very useful in figuring out why
a test failed. Save the logfile in the failure directory as well.
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
for-next
Head SHA1: 932cdaf3e273a2727e77af97f79f12577174c5a0
Steven Rostedt (2):
ktest: Fix the month in the name of the failure directory
ktest: Add logfile to failure directory
----
tools/testing/ktest/ktest.pl | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [for-linus][PATCH 1/2] ktest: Fix the month in the name of the failure directory
2026-04-20 19:32 [for-linus][PATCH 0/2] ktest: Fixes for v7.1 Steven Rostedt
@ 2026-04-20 19:32 ` Steven Rostedt
2026-04-20 19:32 ` [for-linus][PATCH 2/2] ktest: Add logfile to " Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2026-04-20 19:32 UTC (permalink / raw)
To: linux-kernel; +Cc: John Warthog9 Hawley, stable
From: Steven Rostedt <rostedt@goodmis.org>
The Perl localtime() function returns the month starting at 0 not 1. This
caused the date produced to create the directory for saving files of a
failed run to have the month off by one.
machine-test-useconfig-fail-20260314073628
The above happened in April, not March. The correct name should have been:
machine-test-useconfig-fail-20260414073628
This was somewhat confusing.
Cc: stable@vger.kernel.org
Cc: John 'Warthog9' Hawley <warthog9@kernel.org>
Link: https://patch.msgid.link/20260420142426.33ad0293@fedora
Fixes: 7faafbd69639b ("ktest: Add open and close console and start stop monitor")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 112f9ca2444b..dd55eea15070 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1855,7 +1855,7 @@ sub save_logs {
my ($result, $basedir) = @_;
my @t = localtime;
my $date = sprintf "%04d%02d%02d%02d%02d%02d",
- 1900+$t[5],$t[4],$t[3],$t[2],$t[1],$t[0];
+ 1900+$t[5],$t[4]+1,$t[3],$t[2],$t[1],$t[0];
my $type = $build_type;
if ($type =~ /useconfig/) {
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [for-linus][PATCH 2/2] ktest: Add logfile to failure directory
2026-04-20 19:32 [for-linus][PATCH 0/2] ktest: Fixes for v7.1 Steven Rostedt
2026-04-20 19:32 ` [for-linus][PATCH 1/2] ktest: Fix the month in the name of the failure directory Steven Rostedt
@ 2026-04-20 19:32 ` Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2026-04-20 19:32 UTC (permalink / raw)
To: linux-kernel; +Cc: John Warthog9 Hawley
From: Steven Rostedt <rostedt@goodmis.org>
The logfile contains a lot of useful information about the tests being
run. Add it to the stored failure directory when the test fails.
Cc: John 'Warthog9' Hawley <warthog9@kernel.org>
Link: https://patch.msgid.link/20260420142315.7bbc3624@fedora
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index dd55eea15070..f94ed2e98887 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1878,6 +1878,12 @@ sub save_logs {
"testlog" => $testlog,
);
+ if (defined($opt{"LOG_FILE"})) {
+ if (-f $opt{"LOG_FILE"}) {
+ cp $opt{"LOG_FILE"}, "$dir/logfile";
+ }
+ }
+
while (my ($name, $source) = each(%files)) {
if (-f "$source") {
cp "$source", "$dir/$name" or
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-20 19:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 19:32 [for-linus][PATCH 0/2] ktest: Fixes for v7.1 Steven Rostedt
2026-04-20 19:32 ` [for-linus][PATCH 1/2] ktest: Fix the month in the name of the failure directory Steven Rostedt
2026-04-20 19:32 ` [for-linus][PATCH 2/2] ktest: Add logfile to " Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox