ktest.pl: Use run_command to execute sending mail
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 6 Apr 2018 21:46:27 +0000 (17:46 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 8 Apr 2018 00:19:42 +0000 (20:19 -0400)
Instead of open coding system() call, use run_command which will log the
sending of email as well.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index ac6750b..f487f91 100755 (executable)
@@ -4135,12 +4135,12 @@ sub set_test_option {
 
 sub _mailx_send {
     my ($subject, $message) = @_;
-    system("$mail_path/$mailer -s \'$subject\' $mailto <<< \'$message\'");
+    run_command "$mail_path/$mailer -s \'$subject\' $mailto <<< \'$message\'";
 }
 
 sub _sendmail_send {
     my ($subject, $message) = @_;
-    system("echo -e \"Subject: $subject\n\n$message\" | $mail_path/sendmail -t $mailto");
+    run_command "echo \'Subject: $subject\n\n$message\' | $mail_path/sendmail -t $mailto";
 }
 
 sub find_mailer {