All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 2/2] ktest: Fix reboot on success stopping all reboots
Date: Tue, 01 May 2012 20:44:41 -0400	[thread overview]
Message-ID: <20120502005415.978821492@goodmis.org> (raw)
In-Reply-To: 20120502004439.965120020@goodmis.org

[-- Attachment #1: 0002-ktest-Fix-reboot-on-success-stopping-all-reboots.patch --]
[-- Type: text/plain, Size: 1975 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The change to let individual tests decide to reboot the machine on
success of the entire test also prevented errors from rebooting
when an error was detected.

The "no_reboot" variable was only cleared if the test had
reboot_on_success set. But the no_reboot variable also prevents the test
rebooting when an error was detected even when REBOOT_ON_ERROR was set.

Add a new "reboot_success" variable that is used to determine if the
test should reboot on success and not touch the no_reboot variable.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index d2ede59..4915408 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -183,6 +183,9 @@ my %force_config;
 # do not force reboots on config problems
 my $no_reboot = 1;
 
+# reboot on success
+my $reboot_success = 0;
+
 my %option_map = (
     "MACHINE"			=> \$machine,
     "SSH_USER"			=> \$ssh_user,
@@ -3469,6 +3472,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
 
     # Do not reboot on failing test options
     $no_reboot = 1;
+    $reboot_success = 0;
 
     $iteration = $i;
 
@@ -3554,9 +3558,11 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
 	    die "failed to checkout $checkout";
     }
 
+    $no_reboot = 0;
+
     # A test may opt to not reboot the box
     if ($reboot_on_success) {
-	$no_reboot = 0;
+	$reboot_success = 1;
     }
 
     if ($test_type eq "bisect") {
@@ -3600,7 +3606,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
 
 if ($opt{"POWEROFF_ON_SUCCESS"}) {
     halt;
-} elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot) {
+} elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot && $reboot_success) {
     reboot_to_good;
 } elsif (defined($switch_to_good)) {
     # still need to get to the good kernel
-- 
1.7.9.5



  parent reply	other threads:[~2012-05-02  0:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02  0:44 [PATCH 0/2] [GIT PULL] ktest: A couple of fixes Steven Rostedt
2012-05-02  0:44 ` [PATCH 1/2] ktest.pl: Fix combined usage of BISECT_REVERSE and BISECT_SKIP Steven Rostedt
2012-05-02  0:44 ` Steven Rostedt [this message]
2012-05-02  2:58 ` [PATCH 0/2] [GIT PULL] ktest: A couple of fixes Linus Torvalds
2012-05-02  3:30   ` Stephen Rothwell
2012-05-02  3:49   ` Junio C Hamano
2012-05-02 13:44     ` Steven Rostedt
2012-05-02 20:14       ` Junio C Hamano
2012-05-03  0:07         ` Steven Rostedt
2012-05-03  0:33           ` Jakub Narebski
2012-05-03  1:52             ` Steven Rostedt
2012-05-03  2:06             ` Nguyen Thai Ngoc Duy

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=20120502005415.978821492@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.