mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tim Tianyang Chen <tianyang.chen@oracle.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, dhaval.giani@oracle.com
Subject: Re: [PATCH v3 1/4] Ktest: add email support
Date: Fri, 6 Apr 2018 16:12:21 -0700	[thread overview]
Message-ID: <81730b00-fcd9-3ccc-bb84-51f69e7364c9@oracle.com> (raw)
In-Reply-To: <20180406184130.6809805c@gandalf.local.home>

> I just fixed them up and pulled them in myself. ;-)
>
> I also added the following on top of them (and testing this, live while
> testing ftrace patches and other builds).
Thanks Steve!
> diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
> index 30a4c053f98b..837fa75cbb47 100755
> --- a/tools/testing/ktest/ktest.pl
> +++ b/tools/testing/ktest/ktest.pl
> @@ -23,7 +23,7 @@ my %evals;
>   
>   #default opts
>   my %default = (
> -    "MAILER"				=> "sendmail",  # default mailer
> +    "MAILER"			=> "sendmail",  # default mailer
Noticed this when I sent the new version.

>       "EMAIL_ON_ERROR"		=> 1,
>       "EMAIL_WHEN_FINISHED"	=> 1,
>       "EMAIL_WHEN_CANCELED"	=> 0,
> @@ -218,6 +218,7 @@ my $dirname = $FindBin::Bin;
>   
>   my $mailto;
>   my $mailer;
> +my $mail_exec;
>   my $email_on_error;
>   my $email_when_finished;
>   my $email_when_started;
> @@ -1431,7 +1433,14 @@ sub do_not_reboot {
>   	($test_type eq "config_bisect" && $opt{"CONFIG_BISECT_TYPE[$i]"} eq "build");
>   }
>   
> +my $in_die = 0;
> +
>   sub dodie {
> +
> +    # avoid recusion
> +    return if ($in_die);
> +    $in_die = 1;
> +
>       doprint "CRITICAL FAILURE... ", @_, "\n";
Good idea.
>   
>       my $i = $iteration;
> @@ -4126,21 +4135,31 @@ sub set_test_option {
>   
>   sub _mailx_send {
>       my ($subject, $message) = @_;
> -    system("$mailer -s \'$subject\' $mailto <<< \'$message\'");
> +
> +    if (!defined($mail_exec)) {
> +	$mail_exec = $mailer;
> +    }
> +    run_command "$mail_exec -s \'$subject\' $mailto <<< \'$message\'";
>   }
>   
>   sub _sendmail_send {
>       my ($subject, $message) = @_;
> -    system("echo -e \"Subject: $subject\n\n$message\" | sendmail -t $mailto");
> +
> +    if (!defined($mail_exec)) {
> +	$mail_exec = "/usr/sbin/sendmail";
> +    }
> +    run_command "echo \'Subject: $subject\n\n$message\' | $mail_exec -t $mailto";
>   }
>   
Not sure if I understand why $mail_exec is necessary. Doesn't $mailer 
already have a default? Wouldn't people just use $mailer to define the 
executable they want to use? What if the $mailx_exec specified doesn't 
use '-t' option?

Thanks,
Tim

  reply	other threads:[~2018-04-06 23:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 20:08 [PATCH v3 0/4] " Tim Tianyang Chen
2018-03-26 20:08 ` [PATCH v3 1/4] " Tim Tianyang Chen
2018-04-06 18:24   ` Steven Rostedt
2018-04-06 22:19     ` Tim Tianyang Chen
2018-04-06 22:41       ` Steven Rostedt
2018-04-06 23:12         ` Tim Tianyang Chen [this message]
     [not found]         ` <d9720e54-4207-abf6-2ac2-b94ac847674e@oracle.com>
2018-04-07 22:51           ` Steven Rostedt
2018-03-26 20:08 ` [PATCH v3 2/4] Ktest: add SigInt handling Tim Tianyang Chen
2018-03-26 20:08 ` [PATCH v3 3/4] Ktest: use dodie for critical falures Tim Tianyang Chen
2018-03-26 20:08 ` [PATCH v3 4/4] Ktest: add email options to sample.config Tim Tianyang Chen
2018-04-03 19:06 ` [PATCH v3 0/4] Ktest: add email support Dhaval Giani
2018-04-03 19:52   ` Tim Tianyang Chen
2018-04-03 22:38     ` Steven Rostedt
2018-04-04 19:50       ` Steven Rostedt
2018-04-06 22:17 [PATCH v3 0/4] ktest: " Tim Tianyang Chen
2018-04-06 22:17 ` [PATCH v3 1/4] " Tim Tianyang Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81730b00-fcd9-3ccc-bb84-51f69e7364c9@oracle.com \
    --to=tianyang.chen@oracle.com \
    --cc=dhaval.giani@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®