From: Steven Rostedt <rostedt@goodmis.org>
To: Masayoshi Mizuma <msys.mizuma@gmail.com>
Cc: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ktest: Add workaround to avoid unexpected power cycle
Date: Wed, 17 Apr 2019 22:22:05 -0400 [thread overview]
Message-ID: <20190417222205.71650f42@oasis.local.home> (raw)
In-Reply-To: <20190417205912.pqwzbrrm6435mqqu@gabell>
On Wed, 17 Apr 2019 16:59:13 -0400
Masayoshi Mizuma <msys.mizuma@gmail.com> 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
prev parent reply other threads:[~2019-04-18 2:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 20:14 Masayoshi Mizuma
2019-04-17 20:29 ` Steven Rostedt
2019-04-17 20:59 ` Masayoshi Mizuma
2019-04-18 2:22 ` Steven Rostedt [this message]
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=20190417222205.71650f42@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.mizuma@jp.fujitsu.com \
--cc=msys.mizuma@gmail.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
all inboxes | Powered by JetHome®