diff options
Diffstat (limited to 'tools/testing/ktest/ktest.pl')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 95d6a6f7c33a..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 |
184 | my $no_reboot = 1; | 184 | my $no_reboot = 1; |
185 | 185 | ||
186 | # reboot on success | ||
187 | my $reboot_success = 0; | ||
188 | |||
186 | my %option_map = ( | 189 | my %option_map = ( |
187 | "MACHINE" => \$machine, | 190 | "MACHINE" => \$machine, |
188 | "SSH_USER" => \$ssh_user, | 191 | "SSH_USER" => \$ssh_user, |
@@ -2192,7 +2195,7 @@ sub run_bisect { | |||
2192 | } | 2195 | } |
2193 | 2196 | ||
2194 | # Are we looking for where it worked, not failed? | 2197 | # Are we looking for where it worked, not failed? |
2195 | if ($reverse_bisect) { | 2198 | if ($reverse_bisect && $ret >= 0) { |
2196 | $ret = !$ret; | 2199 | $ret = !$ret; |
2197 | } | 2200 | } |
2198 | 2201 | ||
@@ -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 | ||
3601 | if ($opt{"POWEROFF_ON_SUCCESS"}) { | 3607 | if ($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 |