Commit 2728be41 authored by Andrew Jones's avatar Andrew Jones Committed by Steven Rostedt

ktest: Include monitor in reboot code

Several places that call reboot do the same thing with respect to the
monitor. By adding this code into the reboot code, redundant code is
removed and it paves the way for the the reset time patch.
Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
Link: http://lkml.kernel.org/r/1313155932-20092-4-git-send-email-drjones@redhat.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 13488231
...@@ -603,8 +603,13 @@ sub doprint { ...@@ -603,8 +603,13 @@ sub doprint {
} }
sub run_command; sub run_command;
sub start_monitor;
sub end_monitor;
sub wait_for_monitor;
sub reboot { sub reboot {
my ($time) = @_;
# try to reboot normally # try to reboot normally
if (run_command $reboot) { if (run_command $reboot) {
if (defined($powercycle_after_reboot)) { if (defined($powercycle_after_reboot)) {
...@@ -615,6 +620,12 @@ sub reboot { ...@@ -615,6 +620,12 @@ sub reboot {
# nope? power cycle it. # nope? power cycle it.
run_command "$power_cycle"; run_command "$power_cycle";
} }
if (defined($time)) {
start_monitor;
wait_for_monitor $time;
end_monitor;
}
} }
sub do_not_reboot { sub do_not_reboot {
...@@ -719,10 +730,7 @@ sub fail { ...@@ -719,10 +730,7 @@ sub fail {
# no need to reboot for just building. # no need to reboot for just building.
if (!do_not_reboot) { if (!do_not_reboot) {
doprint "REBOOTING\n"; doprint "REBOOTING\n";
reboot; reboot $sleep_time;
start_monitor;
wait_for_monitor $sleep_time;
end_monitor;
} }
my $name = ""; my $name = "";
...@@ -1356,10 +1364,7 @@ sub success { ...@@ -1356,10 +1364,7 @@ sub success {
if ($i != $opt{"NUM_TESTS"} && !do_not_reboot) { if ($i != $opt{"NUM_TESTS"} && !do_not_reboot) {
doprint "Reboot and wait $sleep_time seconds\n"; doprint "Reboot and wait $sleep_time seconds\n";
reboot; reboot $sleep_time;
start_monitor;
wait_for_monitor $sleep_time;
end_monitor;
} }
} }
...@@ -1500,10 +1505,7 @@ sub run_git_bisect { ...@@ -1500,10 +1505,7 @@ sub run_git_bisect {
sub bisect_reboot { sub bisect_reboot {
doprint "Reboot and sleep $bisect_sleep_time seconds\n"; doprint "Reboot and sleep $bisect_sleep_time seconds\n";
reboot; reboot $bisect_sleep_time;
start_monitor;
wait_for_monitor $bisect_sleep_time;
end_monitor;
} }
# returns 1 on success, 0 on failure, -1 on skip # returns 1 on success, 0 on failure, -1 on skip
...@@ -2066,10 +2068,7 @@ sub config_bisect { ...@@ -2066,10 +2068,7 @@ sub config_bisect {
sub patchcheck_reboot { sub patchcheck_reboot {
doprint "Reboot and sleep $patchcheck_sleep_time seconds\n"; doprint "Reboot and sleep $patchcheck_sleep_time seconds\n";
reboot; reboot $patchcheck_sleep_time;
start_monitor;
wait_for_monitor $patchcheck_sleep_time;
end_monitor;
} }
sub patchcheck { sub patchcheck {
...@@ -2659,10 +2658,7 @@ sub make_min_config { ...@@ -2659,10 +2658,7 @@ sub make_min_config {
} }
doprint "Reboot and wait $sleep_time seconds\n"; doprint "Reboot and wait $sleep_time seconds\n";
reboot; reboot $sleep_time;
start_monitor;
wait_for_monitor $sleep_time;
end_monitor;
} }
success $i; success $i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment