public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 07/10] ktest: Add check for bug or panic during reboot
Date: Mon, 30 Jul 2012 15:23:21 -0400	[thread overview]
Message-ID: <20120730192657.468497891@goodmis.org> (raw)
In-Reply-To: 20120730192314.144253843@goodmis.org

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

From: Steven Rostedt <srostedt@redhat.com>

Usually the target is booted into a dependable kernel when a test
starts. The test will install the test kernel and reboot the box. But
there may be a time that the kernel is running an unreliable kernel and
the reboot may crash.

Have ktest detect crashes on a reboot and force a power-cycle instead.

This can usually happen if a test kernel was installed to run manual
tests, but the user forgot to reboot to the known good kernel.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |   28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index d10fff1..c8a42d5 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1138,6 +1138,7 @@ sub reboot {
     if (defined($time)) {
 	if (wait_for_monitor($time, $reboot_success_line)) {
 	    # reboot got stuck?
+	    doprint "Reboot did not finish. Forcing power cycle\n";
 	    run_command "$power_cycle";
 	}
 	end_monitor;
@@ -1235,6 +1236,9 @@ sub wait_for_monitor {
     my $line;
     my $booted = 0;
     my $start_time = time;
+    my $skip_call_trace = 0;
+    my $bug = 0;
+    my $bug_ignored = 0;
     my $now;
 
     doprint "** Wait for monitor to settle down **\n";
@@ -1251,6 +1255,28 @@ sub wait_for_monitor {
 	    $booted = 1;
 	}
 
+	if ($full_line =~ /\[ backtrace testing \]/) {
+	    $skip_call_trace = 1;
+	}
+
+	if ($full_line =~ /call trace:/i) {
+	    if (!$bug && !$skip_call_trace) {
+		if ($ignore_errors) {
+		    $bug_ignored = 1;
+		} else {
+		    $bug = 1;
+		}
+	    }
+	}
+
+	if ($full_line =~ /\[ end of backtrace testing \]/) {
+	    $skip_call_trace = 0;
+	}
+
+	if ($full_line =~ /Kernel panic -/) {
+	    $bug = 1;
+	}
+
 	if ($line =~ /\n/) {
 	    $full_line = "";
 	}
@@ -1261,7 +1287,7 @@ sub wait_for_monitor {
 	}
     }
     print "** Monitor flushed **\n";
-    return 0;
+    return $bug;
 }
 
 sub save_logs {
-- 
1.7.10.4



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

  parent reply	other threads:[~2012-07-30 19:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 19:23 [PATCH 00/10] [GIT PULL] ktest: changes for v3.6 Steven Rostedt
2012-07-30 19:23 ` [PATCH 01/10] ktest: Remove commented exit Steven Rostedt
2012-07-30 19:23 ` [PATCH 02/10] ktest: Add PRE/POST_KTEST and TEST options Steven Rostedt
2012-07-30 19:23 ` [PATCH 03/10] ktest: Add PRE_INSTALL option Steven Rostedt
2012-07-30 19:23 ` [PATCH 04/10] ktest: Add CONFIG_BISECT_CHECK option Steven Rostedt
2012-07-30 19:23 ` [PATCH 05/10] ktest: Fix config bisect with how make oldnoconfig works Steven Rostedt
2012-07-30 19:23 ` [PATCH 06/10] ktest: Add MAX_MONITOR_WAIT option Steven Rostedt
2012-07-30 19:23 ` Steven Rostedt [this message]
2012-07-30 19:23 ` [PATCH 08/10] ktest: Reset saved min (force) configs for each test Steven Rostedt
2012-07-30 19:23 ` [PATCH 09/10] ktest: Ignore errors it tests if IGNORE_ERRORS is set Steven Rostedt
2012-07-30 19:23 ` [PATCH 10/10] ktest: Allow perl regex expressions in conditional statements 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=20120730192657.468497891@goodmis.org \
    --to=rostedt@goodmis.org \
    --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