aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2011-08-12 09:32:05 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-10-17 11:54:10 -0400
commit2728be418db65aa873ee354168b56f028845e956 (patch)
tree4b63f0846642128540e1ac8f65f35e64c56d9ca7
parent134882311cb9c2dca2ffadeabc5f8f9faa0fca81 (diff)
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: Andrew Jones <drjones@redhat.com> Link: http://lkml.kernel.org/r/1313155932-20092-4-git-send-email-drjones@redhat.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rwxr-xr-xtools/testing/ktest/ktest.pl36
1 files changed, 16 insertions, 20 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 20b0e736b98b..debc6898e60b 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -603,8 +603,13 @@ sub doprint {
603} 603}
604 604
605sub run_command; 605sub run_command;
606sub start_monitor;
607sub end_monitor;
608sub wait_for_monitor;
606 609
607sub reboot { 610sub reboot {
611 my ($time) = @_;
612
608 # try to reboot normally 613 # try to reboot normally
609 if (run_command $reboot) { 614 if (run_command $reboot) {
610 if (defined($powercycle_after_reboot)) { 615 if (defined($powercycle_after_reboot)) {
@@ -615,6 +620,12 @@ sub reboot {
615 # nope? power cycle it. 620 # nope? power cycle it.
616 run_command "$power_cycle"; 621 run_command "$power_cycle";
617 } 622 }
623
624 if (defined($time)) {
625 start_monitor;
626 wait_for_monitor $time;
627 end_monitor;
628 }
618} 629}
619 630
620sub do_not_reboot { 631sub do_not_reboot {
@@ -719,10 +730,7 @@ sub fail {
719 # no need to reboot for just building. 730 # no need to reboot for just building.
720 if (!do_not_reboot) { 731 if (!do_not_reboot) {
721 doprint "REBOOTING\n"; 732 doprint "REBOOTING\n";
722 reboot; 733 reboot $sleep_time;
723 start_monitor;
724 wait_for_monitor $sleep_time;
725 end_monitor;
726 } 734 }
727 735
728 my $name = ""; 736 my $name = "";
@@ -1356,10 +1364,7 @@ sub success {
1356 1364
1357 if ($i != $opt{"NUM_TESTS"} && !do_not_reboot) { 1365 if ($i != $opt{"NUM_TESTS"} && !do_not_reboot) {
1358 doprint "Reboot and wait $sleep_time seconds\n"; 1366 doprint "Reboot and wait $sleep_time seconds\n";
1359 reboot; 1367 reboot $sleep_time;
1360 start_monitor;
1361 wait_for_monitor $sleep_time;
1362 end_monitor;
1363 } 1368 }
1364} 1369}
1365 1370
@@ -1500,10 +1505,7 @@ sub run_git_bisect {
1500 1505
1501sub bisect_reboot { 1506sub bisect_reboot {
1502 doprint "Reboot and sleep $bisect_sleep_time seconds\n"; 1507 doprint "Reboot and sleep $bisect_sleep_time seconds\n";
1503 reboot; 1508 reboot $bisect_sleep_time;
1504 start_monitor;
1505 wait_for_monitor $bisect_sleep_time;
1506 end_monitor;
1507} 1509}
1508 1510
1509# returns 1 on success, 0 on failure, -1 on skip 1511# returns 1 on success, 0 on failure, -1 on skip
@@ -2066,10 +2068,7 @@ sub config_bisect {
2066 2068
2067sub patchcheck_reboot { 2069sub patchcheck_reboot {
2068 doprint "Reboot and sleep $patchcheck_sleep_time seconds\n"; 2070 doprint "Reboot and sleep $patchcheck_sleep_time seconds\n";
2069 reboot; 2071 reboot $patchcheck_sleep_time;
2070 start_monitor;
2071 wait_for_monitor $patchcheck_sleep_time;
2072 end_monitor;
2073} 2072}
2074 2073
2075sub patchcheck { 2074sub patchcheck {
@@ -2659,10 +2658,7 @@ sub make_min_config {
2659 } 2658 }
2660 2659
2661 doprint "Reboot and wait $sleep_time seconds\n"; 2660 doprint "Reboot and wait $sleep_time seconds\n";
2662 reboot; 2661 reboot $sleep_time;
2663 start_monitor;
2664 wait_for_monitor $sleep_time;
2665 end_monitor;
2666 } 2662 }
2667 2663
2668 success $i; 2664 success $i;