aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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