Commit b821861b905a79f71746945237968c3382d99adc
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
Merge tag 'ktest-for-v3.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
Pull two bug fixes in ktest from Steven Rostedt. * tag 'ktest-for-v3.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Fix reboot on success stopping all reboots ktest.pl: Fix combined usage of BISECT_REVERSE and BISECT_SKIP
Showing 1 changed file Side-by-side Diff
tools/testing/ktest/ktest.pl
... | ... | @@ -183,6 +183,9 @@ |
183 | 183 | # do not force reboots on config problems |
184 | 184 | my $no_reboot = 1; |
185 | 185 | |
186 | +# reboot on success | |
187 | +my $reboot_success = 0; | |
188 | + | |
186 | 189 | my %option_map = ( |
187 | 190 | "MACHINE" => \$machine, |
188 | 191 | "SSH_USER" => \$ssh_user, |
... | ... | @@ -2192,7 +2195,7 @@ |
2192 | 2195 | } |
2193 | 2196 | |
2194 | 2197 | # Are we looking for where it worked, not failed? |
2195 | - if ($reverse_bisect) { | |
2198 | + if ($reverse_bisect && $ret >= 0) { | |
2196 | 2199 | $ret = !$ret; |
2197 | 2200 | } |
2198 | 2201 | |
... | ... | @@ -3469,6 +3472,7 @@ |
3469 | 3472 | |
3470 | 3473 | # Do not reboot on failing test options |
3471 | 3474 | $no_reboot = 1; |
3475 | + $reboot_success = 0; | |
3472 | 3476 | |
3473 | 3477 | $iteration = $i; |
3474 | 3478 | |
3475 | 3479 | |
... | ... | @@ -3554,9 +3558,11 @@ |
3554 | 3558 | die "failed to checkout $checkout"; |
3555 | 3559 | } |
3556 | 3560 | |
3561 | + $no_reboot = 0; | |
3562 | + | |
3557 | 3563 | # A test may opt to not reboot the box |
3558 | 3564 | if ($reboot_on_success) { |
3559 | - $no_reboot = 0; | |
3565 | + $reboot_success = 1; | |
3560 | 3566 | } |
3561 | 3567 | |
3562 | 3568 | if ($test_type eq "bisect") { |
... | ... | @@ -3600,7 +3606,7 @@ |
3600 | 3606 | |
3601 | 3607 | if ($opt{"POWEROFF_ON_SUCCESS"}) { |
3602 | 3608 | halt; |
3603 | -} elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot) { | |
3609 | +} elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot && $reboot_success) { | |
3604 | 3610 | reboot_to_good; |
3605 | 3611 | } elsif (defined($switch_to_good)) { |
3606 | 3612 | # still need to get to the good kernel |