aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-05-01 08:20:12 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-05-01 08:25:48 -0400
commit759a3cc625e77161ae457459489178dd0921524e (patch)
tree7b39db0c257978d79b1819f518171e839c2629e0 /tools
parent5158ba3ea7fc8c3deafec769a32bc6eb869c3608 (diff)
ktest: Fix reboot on success stopping all reboots
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>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/ktest/ktest.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index d2ede59b9a3c..4915408f6a98 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -183,6 +183,9 @@ my %force_config;
183# do not force reboots on config problems 183# do not force reboots on config problems
184my $no_reboot = 1; 184my $no_reboot = 1;
185 185
186# reboot on success
187my $reboot_success = 0;
188
186my %option_map = ( 189my %option_map = (
187 "MACHINE" => \$machine, 190 "MACHINE" => \$machine,
188 "SSH_USER" => \$ssh_user, 191 "SSH_USER" => \$ssh_user,
@@ -3469,6 +3472,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
3469 3472
3470 # Do not reboot on failing test options 3473 # Do not reboot on failing test options
3471 $no_reboot = 1; 3474 $no_reboot = 1;
3475 $reboot_success = 0;
3472 3476
3473 $iteration = $i; 3477 $iteration = $i;
3474 3478
@@ -3554,9 +3558,11 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
3554 die "failed to checkout $checkout"; 3558 die "failed to checkout $checkout";
3555 } 3559 }
3556 3560
3561 $no_reboot = 0;
3562
3557 # A test may opt to not reboot the box 3563 # A test may opt to not reboot the box
3558 if ($reboot_on_success) { 3564 if ($reboot_on_success) {
3559 $no_reboot = 0; 3565 $reboot_success = 1;
3560 } 3566 }
3561 3567
3562 if ($test_type eq "bisect") { 3568 if ($test_type eq "bisect") {
@@ -3600,7 +3606,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
3600 3606
3601if ($opt{"POWEROFF_ON_SUCCESS"}) { 3607if ($opt{"POWEROFF_ON_SUCCESS"}) {
3602 halt; 3608 halt;
3603} elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot) { 3609} elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot && $reboot_success) {
3604 reboot_to_good; 3610 reboot_to_good;
3605} elsif (defined($switch_to_good)) { 3611} elsif (defined($switch_to_good)) {
3606 # still need to get to the good kernel 3612 # still need to get to the good kernel