linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tim Tianyang Chen <tianyang.chen@oracle.com>
Cc: linux-kernel@vger.kernel.org, dhaval.giani@oracle.com
Subject: Re: [PATCH 2/3] Ktest: use dodie for critical falures
Date: Wed, 21 Mar 2018 11:16:08 -0400	[thread overview]
Message-ID: <20180321111608.31c712a2@gandalf.local.home> (raw)
In-Reply-To: <1513380011-15274-3-git-send-email-tianyang.chen@oracle.com>

On Fri, 15 Dec 2017 15:20:10 -0800
Tim Tianyang Chen <tianyang.chen@oracle.com> wrote:

> Users should get emails when the script dies because of a critical failure. Critical
> failures are defined as any errors that could abnormally terminate the script.
> 
> In order to add email support, this patch converts all die() to dodie() except:
>  * when '-v' is used as an option to get the version of the script.
>  * in Sig-Int handeler because it's not a fatal error to cancel the script.
>  * errors happen during parsing config

I would say you don't need it for parsing the config either. It doesn't
make sense, as you wouldn't have the mailto defined yet.


> @@ -4132,7 +4132,7 @@ if ($#ARGV == 0) {
>  if (! -f $ktest_config) {
>      $newconfig = 1;
>      get_test_case;
> -    open(OUT, ">$ktest_config") or die "Can not create $ktest_config";
> +    open(OUT, ">$ktest_config") or dodie "Can not create $ktest_config";

Here, no config was specified, and so no configs either.


>      print OUT << "EOF"
>  # Generated by ktest.pl
>  #
> @@ -4167,7 +4167,7 @@ if (defined($opt{"LOG_FILE"})) {
>  my @new_configs = keys %entered_configs;
>  if ($#new_configs >= 0) {
>      print "\nAppending entered in configs to $ktest_config\n";
> -    open(OUT, ">>$ktest_config") or die "Can not append to $ktest_config";
> +    open(OUT, ">>$ktest_config") or dodie "Can not append to $ktest_config";

Here too.


-- Steve


>      foreach my $config (@new_configs) {
>  	print OUT "$config = $entered_configs{$config}\n";
>  	$opt{$config} = process_variables($entered_configs{$config});

  reply	other threads:[~2018-03-21 15:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 23:20 [PATCH 0/3] Ktest: add email support Tim Tianyang Chen
2017-12-15 23:20 ` [PATCH 1/3] " Tim Tianyang Chen
2018-03-21 15:09   ` Steven Rostedt
2017-12-15 23:20 ` [PATCH 2/3] Ktest: use dodie for critical falures Tim Tianyang Chen
2018-03-21 15:16   ` Steven Rostedt [this message]
2018-03-26 18:48     ` Tim Tianyang Chen
2017-12-15 23:20 ` [PATCH 3/3] Ktest: add email options to sample.config Tim Tianyang Chen
2018-03-21 15:17   ` Steven Rostedt
2018-01-02 19:08 ` [PATCH 0/3] Ktest: add email support Tim Tianyang Chen
2018-01-02 19:29   ` Steven Rostedt

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=20180321111608.31c712a2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=dhaval.giani@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tianyang.chen@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).