Skip to content

Commit

Permalink
ktest: Search for linux banner for successful reboot
Browse files Browse the repository at this point in the history
Sometimes when a test kernel passed fine, but on reboot it crashed,
ktest could get stuck and not proceed. This would be frustrating if you
let a test run overnight to find out the next morning that it was stuck
on the first test.

To fix this, I made reboot check for the REBOOT_SUCCESS_LINE. If the
line was not detected, then it would power cycle the box.

What it didn't cover was if the REBOOT_SUCCESS_LINE wasn't defined or if
a 'good' kernel did not display the line. Instead have it search for the
Linux banner "Linux version". The reboot just needs to get to the start
of the next kernel, it does not need to test if the next kernel makes it
to a boot prompt.

After we find the next kernel has booted, then we just wait for either
the REBOOT_SUCCESS_LINE to appear or the timeout.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Feb 5, 2013
1 parent 4283b16 commit d684553
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1212,11 +1212,16 @@ sub reboot {
}

if (defined($time)) {
if (wait_for_monitor($time, $reboot_success_line)) {
# Look for the good kernel to boot
if (wait_for_monitor($time, "Linux version")) {
# reboot got stuck?
doprint "Reboot did not finish. Forcing power cycle\n";
run_command "$power_cycle";
}

# Still need to wait for the reboot to finish
wait_for_monitor($time, $reboot_success_line);

end_monitor;
}
}
Expand Down

0 comments on commit d684553

Please sign in to comment.