Received: by 10.213.65.68 with SMTP id h4csp1337846imn; Wed, 21 Mar 2018 08:17:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELsf4ulwPfU3okiqzRl5GauMq5Z6ilM59eRfPOSbrkuU+HwjwZzYLxKgtLY24BsPyzxFHPwU X-Received: by 10.98.226.23 with SMTP id a23mr4302618pfi.157.1521645476875; Wed, 21 Mar 2018 08:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521645476; cv=none; d=google.com; s=arc-20160816; b=0rsrwvoDVqQorF+LPYJwOS4gwFrmBnpeFGPEf6zg88LvpAzJFaq+ILR/Pu4GSTal63 sd7kaUVnfTxKG5wUYBYySHSNxTD1zDEqgNTCa+ogjC7zSPWeuSjfoeYgoN/EhJhy63tW 5Wa4Hk+1ZcmAqOxYFZNzmRtOEX3a0CGwmyDWmJHTuEbMZlZdVBxGOg4j5c5lcdAT24z7 ksM0C1VKyzuMo+ll/YysrdOcmkryLmOFLCCyJ4QEbqe3vP+R17UJ0vbtImP2cLowf4TB UiYEmPrQ6/PqEUMsyvQu/YgLxAXXQ5nQounX3pwzJ8HE0oAJyIaNHSQySXn0n09kcH/6 DLTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=f5BVDGdgq82hnKTsQ3g9Qx5NKnN2sHfDAZQX6CKa7DU=; b=qE6tU5miz7idVMhlA3+PsGwIwbxFFAipQiArMgxROphpgQ6vNl9H2z8kUAY12ywzmU jgtAOEfGQ58X/wSE3sCt8516PqnCnaor86U96/+93KrHEb4CEd9QD8s936lPdhUtKq45 +hq1jP1WKQn/ErvcDs+mE5vfaCYc5MyzmYGTZiaUsYxoqpndG+Y15ewqCFsstrjzabN5 I+PIAXtpLSI7kNjYgVo7VxnIxTlf2yVKd/HMmRe0Zw9usRWG2IaDC3LWlq4Y4Lp8pPFM 0yzB6DGdi4GvPn5rEa2Efv51hWTXPFLilIiK9mPYfL7Vvl7ORolXagYdz4kZAKlmrBtG wSGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd3-v6si4452641plb.392.2018.03.21.08.17.42; Wed, 21 Mar 2018 08:17:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbeCUPQO (ORCPT + 99 others); Wed, 21 Mar 2018 11:16:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:60500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbeCUPQL (ORCPT ); Wed, 21 Mar 2018 11:16:11 -0400 Received: from gandalf.local.home (cpe-172-100-180-131.stny.res.rr.com [172.100.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5DB442177B; Wed, 21 Mar 2018 15:16:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DB442177B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Wed, 21 Mar 2018 11:16:08 -0400 From: Steven Rostedt To: Tim Tianyang Chen Cc: linux-kernel@vger.kernel.org, dhaval.giani@oracle.com Subject: Re: [PATCH 2/3] Ktest: use dodie for critical falures Message-ID: <20180321111608.31c712a2@gandalf.local.home> In-Reply-To: <1513380011-15274-3-git-send-email-tianyang.chen@oracle.com> References: <1513380011-15274-1-git-send-email-tianyang.chen@oracle.com> <1513380011-15274-3-git-send-email-tianyang.chen@oracle.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Dec 2017 15:20:10 -0800 Tim Tianyang Chen 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});