summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-03-08 09:44:35 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-03-08 09:52:59 -0500
commit8ea0e063a78df91b1ca4d23ea8d4e2e3047f6950 (patch)
tree475c92fd474b353f59c6c63fe99c7396b39595ef /tools/testing
parent4651920e0ac7a596c1123a8efdcc2f6d2249deb3 (diff)
ktest: Monitor kernel while running of user tests
Record the console of tests to both the console and the log. Also, record the bug reports afte the test has completed. Currently, if a kernel bug happens while running the userland test, the test stops and will not record the kernel bug. This makes it difficult to solve what happened. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/ktest/ktest.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 125ab94e729..8bbfceedfdb 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1110,6 +1110,7 @@ sub do_run_test {
# we are not guaranteed to get a full line
$full_line .= $line;
+ doprint $line;
if ($full_line =~ /call trace:/i) {
$bug = 1;
@@ -1126,6 +1127,19 @@ sub do_run_test {
} while (!$child_done && !$bug);
if ($bug) {
+ my $failure_start = time;
+ my $now;
+ do {
+ $line = wait_for_input($monitor_fp, 1);
+ if (defined($line)) {
+ doprint $line;
+ }
+ $now = time;
+ if ($now - $failure_start >= $stop_after_failure) {
+ last;
+ }
+ } while (defined($line));
+
doprint "Detected kernel crash!\n";
# kill the child with extreme prejudice
kill 9, $child_pid;