Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp50809yba; Wed, 17 Apr 2019 19:23:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZG/+KLHnLq2dwZnqWpMSj+1x5q/p8C11xWfETTczccPd3yAf5c2XDeMrMQiuBsFOS7RO2 X-Received: by 2002:a63:2983:: with SMTP id p125mr87592980pgp.262.1555554195134; Wed, 17 Apr 2019 19:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555554195; cv=none; d=google.com; s=arc-20160816; b=x2s356RezII5RWamzZKUCZwLZTIGONEqTFKPLYIUKapKpfyUYi8RuW2wSiGmPAmn5a erRJ9GwADzJ0ets56rDbhrysP2OBtkTsribhnrTIwaiJvl5tEmE+FZnNPoczReJ71PS+ 3IFGFh9psomj0J4IlN6YYQfwk/QPsNnmNAiXGb/Q/dW/suz4WFf6/0sYDKApq6Fj11A6 NkqTys3kRg3jwVJ9K47/0QG6r36onkfH1Z0jt3RvCLZXjGZA1mDRiKSLmbM4y+v9Cooq jMKJJq99Oyxu5W8EJQVuUb7PrtX+EXVbzLCRNMJ6PdPdEB8+SDyF4ucpjklyYSUEqNsh VGdA== 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; bh=ohrap9iEAyTP3k/og33poJAjFa2AgkaOZ+Xl9SHLrf0=; b=Vtyh7jdzP8YuXxdUVY57URTG453pyEGlo2latI3KGk+GgHV+AdleyNE8zUIhy/P4DQ J9a/NgVidpOKf6BWQshtuuIGWu0962pEZlKEL3ChoF6KYcfUjYBFV872oWDWuD6TdNV6 pTdLIRNuczBrgCl1Rt3V9ejYWefy67tEyI3CuPmeGYnT3UIW9ID/0y35ji2ZZD/uq1Rc Ahv4vQp7/DOacNrqNPyb4oFF09KIFrTHLRkL8T2R82JSgIz6Jb9qYdWm9hr4ILx98hMt 1fcPrGaiwifUDasUo7MFY1K8DfXEBMmWqF4fkfZITVwXrcUJuZqfKN3WdmBiCD9YOXbf CeEQ== 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 p16si887004pff.85.2019.04.17.19.22.59; Wed, 17 Apr 2019 19:23:15 -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 S2387859AbfDRCWJ (ORCPT + 99 others); Wed, 17 Apr 2019 22:22:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:52310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729189AbfDRCWI (ORCPT ); Wed, 17 Apr 2019 22:22:08 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 AD063217FA; Thu, 18 Apr 2019 02:22:07 +0000 (UTC) Date: Wed, 17 Apr 2019 22:22:05 -0400 From: Steven Rostedt To: Masayoshi Mizuma Cc: Masayoshi Mizuma , linux-kernel@vger.kernel.org Subject: Re: [PATCH] ktest: Add workaround to avoid unexpected power cycle Message-ID: <20190417222205.71650f42@oasis.local.home> In-Reply-To: <20190417205912.pqwzbrrm6435mqqu@gabell> References: <20190417201442.15030-1-msys.mizuma@gmail.com> <20190417162942.375b3e3f@gandalf.local.home> <20190417205912.pqwzbrrm6435mqqu@gabell> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; 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 Wed, 17 Apr 2019 16:59:13 -0400 Masayoshi Mizuma wrote: > > > diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl > > > index ea07d43856b8..765c6bc83ab4 100755 > > > --- a/tools/testing/ktest/ktest.pl > > > +++ b/tools/testing/ktest/ktest.pl > > > @@ -1737,6 +1737,11 @@ sub run_command { > > > my $dord = 0; > > > my $dostdout = 0; > > > my $pid; > > > + my $is_default_reboot = 0; > > > + > > > + if ($command eq $default{REBOOT}) { > > > + $is_default_reboot = 1; > > > + } > > > > Do we really need to add this variable? > > > > > > > > > $command =~ s/\$SSH_USER/$ssh_user/g; > > > $command =~ s/\$MACHINE/$machine/g; > > $command is modified here, so... Ah thanks. This is what I get for reviewing patches without looking at the code it touches ;-) > > > > @@ -1791,6 +1796,10 @@ sub run_command { > > > # shift 8 for real exit status > > > $run_command_status = $? >> 8; > > > > > > + if ($run_command_status == 255 && $is_default_reboot) { > > > > Instead can we have: > > > > if ($command eq $default{REBOOT} && > > $run_command_status == $reboot_return_code) { > > > > ? > > How about the following? > > @@ -1737,6 +1740,7 @@ sub run_command { > my $dord = 0; > my $dostdout = 0; > my $pid; > + my $command_orig = $command; > > $command =~ s/\$SSH_USER/$ssh_user/g; > $command =~ s/\$MACHINE/$machine/g; > @@ -1791,6 +1795,11 @@ sub run_command { > # shift 8 for real exit status > $run_command_status = $? >> 8; > > + if ($command_orig eq $default{REBOOT} && > + $run_command_status == $reboot_return_code) { > + $run_command_status = 0; > + } > + Looks fine to me. Thanks! -- Steve > close(CMD); > close(LOG) if ($dolog); > close(RD) if ($dord); > > Thanks! > Masa