summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2020-11-30 16:32:55 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-30 11:25:41 +0100
commit013a9ef37f8497915979bd6a17d5a0af79f4c10d (patch)
tree6781d302ee264185feb2b4a7b3ad654ca8b12f6c /tools
parente64cc462703f209ff0db62e5c75b7019df0cac97 (diff)
downloadlinux-stable-013a9ef37f8497915979bd6a17d5a0af79f4c10d.tar.gz
linux-stable-013a9ef37f8497915979bd6a17d5a0af79f4c10d.tar.bz2
linux-stable-013a9ef37f8497915979bd6a17d5a0af79f4c10d.zip
ktest.pl: If size of log is too big to email, email error message
commit 8cd6bc0359deebd8500e6de95899a8a78d3ec4ba upstream. If the size of the error log is too big to send via email, and the sending fails, it wont email any result. This can be confusing for the user who is waiting for an email on the completion of the tests. If it fails to send email, then try again without the log file stating that it failed to send an email. Obviously this will not be of use if the sending of email failed for some other reasons, but it will at least give the user some information when it fails for the most common reason. Cc: stable@vger.kernel.org Fixes: c2d84ddb338c8 ("ktest.pl: Add MAIL_COMMAND option to define how to send email") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/ktest/ktest.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 3118fc0d149b..406401f1acc2 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -4177,7 +4177,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 {