All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] ktest.pl: Updates for 5.11
@ 2020-12-18 16:55 Steven Rostedt
  2020-12-18 20:54 ` pr-tracker-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2020-12-18 16:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: LKML

Linus,

ktest.pl: Updates for 5.11

No new features. Just a couple of fixes that I had in my local repository
that fixed issues with sending the result emails.


Please pull the latest ktest-v5.11 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
ktest-v5.11

Tag SHA1: 1d7125079e919a18b84f3fa180eab57171be730c
Head SHA1: 170f4869e66275f498ae4736106fb54c0fdcd036


Steven Rostedt (VMware) (2):
      ktest.pl: If size of log is too big to email, email error message
      ktest.pl: Fix the logic for truncating the size of the log file for email

----
 tools/testing/ktest/ktest.pl | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
---------------------------
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 54188ee16c48..4e2450964517 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1499,17 +1499,16 @@ sub dodie {
 	my $log_file;
 
 	if (defined($opt{"LOG_FILE"})) {
-	    my $whence = 0; # beginning of file
-	    my $pos = $test_log_start;
+	    my $whence = 2; # End of file
+	    my $log_size = tell LOG;
+	    my $size = $log_size - $test_log_start;
 
 	    if (defined($mail_max_size)) {
-		my $log_size = tell LOG;
-		$log_size -= $test_log_start;
-		if ($log_size > $mail_max_size) {
-		    $whence = 2; # end of file
-		    $pos = - $mail_max_size;
+		if ($size > $mail_max_size) {
+		    $size = $mail_max_size;
 		}
 	    }
+	    my $pos = - $size;
 	    $log_file = "$tmpdir/log";
 	    open (L, "$opt{LOG_FILE}") or die "Can't open $opt{LOG_FILE} to read)";
 	    open (O, "> $tmpdir/log") or die "Can't open $tmpdir/log\n";
@@ -4253,7 +4252,12 @@ sub do_send_mail {
     $mail_command =~ s/\$SUBJECT/$subject/g;
     $mail_command =~ s/\$MESSAGE/$message/g;
 
-    run_command $mail_command;
+    my $ret = run_command $mail_command;
+    if (!$ret && defined($file)) {
+	# try again without the file
+	$message .= "\n\n*** FAILED TO SEND LOG ***\n\n";
+	do_send_email($subject, $message);
+    }
 }
 
 sub send_email {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] ktest.pl: Updates for 5.11
  2020-12-18 16:55 [GIT PULL] ktest.pl: Updates for 5.11 Steven Rostedt
@ 2020-12-18 20:54 ` pr-tracker-bot
  0 siblings, 0 replies; 2+ messages in thread
From: pr-tracker-bot @ 2020-12-18 20:54 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linus Torvalds, LKML

The pull request you sent on Fri, 18 Dec 2020 11:55:32 -0500:

> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git ktest-v5.11

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/4862c741bd440813cabc5e93351f0950c1cb19d9

Thank you!

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-18 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 16:55 [GIT PULL] ktest.pl: Updates for 5.11 Steven Rostedt
2020-12-18 20:54 ` pr-tracker-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.