[GIT PULL] ktest: Update for v6.15

Steven Rostedt posted 1 patch 8 months, 3 weeks ago
tools/testing/ktest/ktest.pl | 8 ++++++++
1 file changed, 8 insertions(+)
[GIT PULL] ktest: Update for v6.15
Posted by Steven Rostedt 8 months, 3 weeks ago

Linus,

ktest update for v6.15:

- Fix failure of directory of log file not existing

  If a LOG_FILE option is set for ktest to log its messages, and the
  directory path does not exist. Then ktest fails. Have ktest attempt
  to create the directory where the log file exists and if that succeeds
  continue on testing.


Please pull the latest ktest-v6.15 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
ktest-v6.15

Tag SHA1: 9da964b26614545e269dd9cce44e4af1070d91c5
Head SHA1: 5a1bed232781d356f842576daacc260f0d0c8d2e


Ayush Jain (1):
      ktest: Fix Test Failures Due to Missing LOG_FILE Directories

----
 tools/testing/ktest/ktest.pl | 8 ++++++++
 1 file changed, 8 insertions(+)
---------------------------
commit 5a1bed232781d356f842576daacc260f0d0c8d2e
Author: Ayush Jain <Ayush.jain3@amd.com>
Date:   Fri Mar 7 04:38:54 2025 +0000

    ktest: Fix Test Failures Due to Missing LOG_FILE Directories
    
    Handle missing parent directories for LOG_FILE path to prevent test
    failures. If the parent directories don't exist, create them to ensure
    the tests proceed successfully.
    
    Cc: <warthog9@eaglescrag.net>
    Link: https://lore.kernel.org/20250307043854.2518539-1-Ayush.jain3@amd.com
    Signed-off-by: Ayush Jain <Ayush.jain3@amd.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 8c8da966c641..a5f7fdd0c1fb 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -4303,6 +4303,14 @@ if (defined($opt{"LOG_FILE"})) {
     if ($opt{"CLEAR_LOG"}) {
 	unlink $opt{"LOG_FILE"};
     }
+
+    if (! -e $opt{"LOG_FILE"} && $opt{"LOG_FILE"} =~ m,^(.*/),) {
+        my $dir = $1;
+        if (! -d $dir) {
+            mkpath($dir) or die "Failed to create directories '$dir': $!";
+            print "\nThe log directory $dir did not exist, so it was created.\n";
+        }
+    }
     open(LOG, ">> $opt{LOG_FILE}") or die "Can't write to $opt{LOG_FILE}";
     LOG->autoflush(1);
 }
Re: [GIT PULL] ktest: Update for v6.15
Posted by pr-tracker-bot@kernel.org 8 months, 3 weeks ago
The pull request you sent on Thu, 27 Mar 2025 12:58:14 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git ktest-v6.15

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/68f090f09b7241a2f019191c5c737741f13a5c17

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html