linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrew Jones <drjones@redhat.com>
Subject: [PATCH 04/21] ktest: Include monitor in reboot code
Date: Fri, 28 Oct 2011 07:16:02 -0400	[thread overview]
Message-ID: <20111028112009.453946163@goodmis.org> (raw)
In-Reply-To: 20111028111558.173726794@goodmis.org

[-- Attachment #1: Type: text/plain, Size: 2674 bytes --]

From: Andrew Jones <drjones@redhat.com>

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>
---
 tools/testing/ktest/ktest.pl |   36 ++++++++++++++++--------------------
 1 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 20b0e73..debc689 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -603,8 +603,13 @@ sub doprint {
 }
 
 sub run_command;
+sub start_monitor;
+sub end_monitor;
+sub wait_for_monitor;
 
 sub reboot {
+    my ($time) = @_;
+
     # try to reboot normally
     if (run_command $reboot) {
 	if (defined($powercycle_after_reboot)) {
@@ -615,6 +620,12 @@ sub reboot {
 	# nope? power cycle it.
 	run_command "$power_cycle";
     }
+
+    if (defined($time)) {
+	start_monitor;
+	wait_for_monitor $time;
+	end_monitor;
+    }
 }
 
 sub do_not_reboot {
@@ -719,10 +730,7 @@ sub fail {
 	# no need to reboot for just building.
 	if (!do_not_reboot) {
 	    doprint "REBOOTING\n";
-	    reboot;
-	    start_monitor;
-	    wait_for_monitor $sleep_time;
-	    end_monitor;
+	    reboot $sleep_time;
 	}
 
 	my $name = "";
@@ -1356,10 +1364,7 @@ sub success {
 
     if ($i != $opt{"NUM_TESTS"} && !do_not_reboot) {
 	doprint "Reboot and wait $sleep_time seconds\n";
-	reboot;
-	start_monitor;
-	wait_for_monitor $sleep_time;
-	end_monitor;
+	reboot $sleep_time;
     }
 }
 
@@ -1500,10 +1505,7 @@ sub run_git_bisect {
 
 sub bisect_reboot {
     doprint "Reboot and sleep $bisect_sleep_time seconds\n";
-    reboot;
-    start_monitor;
-    wait_for_monitor $bisect_sleep_time;
-    end_monitor;
+    reboot $bisect_sleep_time;
 }
 
 # returns 1 on success, 0 on failure, -1 on skip
@@ -2066,10 +2068,7 @@ sub config_bisect {
 
 sub patchcheck_reboot {
     doprint "Reboot and sleep $patchcheck_sleep_time seconds\n";
-    reboot;
-    start_monitor;
-    wait_for_monitor $patchcheck_sleep_time;
-    end_monitor;
+    reboot $patchcheck_sleep_time;
 }
 
 sub patchcheck {
@@ -2659,10 +2658,7 @@ sub make_min_config {
 	}
 
 	doprint "Reboot and wait $sleep_time seconds\n";
-	reboot;
-	start_monitor;
-	wait_for_monitor $sleep_time;
-	end_monitor;
+	reboot $sleep_time;
     }
 
     success $i;
-- 
1.7.6.3



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2011-10-28 11:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 11:15 [PATCH 00/21] [GIT PULL] ktest: lots of nice new features Steven Rostedt
2011-10-28 11:15 ` [PATCH 01/21] ktest: Add TEST_TYPE install option Steven Rostedt
2011-10-28 11:16 ` [PATCH 02/21] ktest: Create outputdir if it does not exist Steven Rostedt
2011-10-28 11:16 ` [PATCH 03/21] ktest: Only need to save .config when doing mrproper Steven Rostedt
2011-10-28 11:16 ` Steven Rostedt [this message]
2011-10-28 11:16 ` [PATCH 05/21] ktest: Fail when grub menu not found Steven Rostedt
2011-10-28 11:16 ` [PATCH 06/21] ktest: Add NO_INSTALL option to not install for a test Steven Rostedt
2011-10-28 11:16 ` [PATCH 07/21] ktest: Add option REBOOT_SUCCESS_LINE to stop waiting after a reboot Steven Rostedt
2011-10-28 11:16 ` [PATCH 08/21] ktest: Do not reboot on config or build issues Steven Rostedt
2011-10-28 11:16 ` [PATCH 09/21] ktest: Add IF and ELSE to config sections Steven Rostedt
2011-10-28 11:16 ` [PATCH 10/21] ktest: Let IF keyword take comparisons Steven Rostedt
2011-10-28 11:16 ` [PATCH 11/21] ktest: Add INCLUDE keyword to include other config files Steven Rostedt
2011-10-28 11:16 ` [PATCH 12/21] ktest: Consolidate TEST_TYPE and DEFAULT code Steven Rostedt
2011-10-28 11:16 ` [PATCH 13/21] ktest: Add OVERRIDE keyword to DEFAULTS section Steven Rostedt
2011-10-28 11:16 ` [PATCH 14/21] ktest: Add DEFINED keyword for IF statements Steven Rostedt
2011-10-28 11:16 ` [PATCH 15/21] ktest: Sort make_min_config configs by dependecies Steven Rostedt
2011-10-28 11:16 ` [PATCH 16/21] ktest: Fix parsing of config section lines Steven Rostedt
2011-10-28 11:16 ` [PATCH 17/21] ktest: Add processing of complex conditionals Steven Rostedt
2011-10-28 11:16 ` [PATCH 18/21] ktest: Do not opencode reboot in grub setting Steven Rostedt
2011-10-28 11:16 ` [PATCH 19/21] ktest: Add another monitor flush before installing kernel Steven Rostedt
2011-10-28 11:16 ` [PATCH 20/21] ktest: Add variable ${PWD} Steven Rostedt
2011-10-28 11:16 ` [PATCH 21/21] ktest: Evaluate variables entered on the command line Steven Rostedt
2011-11-08  1:23 ` [PATCH 00/21] [GIT PULL] ktest: lots of nice new features Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111028112009.453946163@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=drjones@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).