]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
ktest: Notify reason to break out of monitoring boot
authorSteven Rostedt <srostedt@redhat.com>
Mon, 13 Jun 2011 14:26:27 +0000 (10:26 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 13 Jun 2011 14:26:27 +0000 (10:26 -0400)
Different timeouts can cause the ktest monitor to break out of the
loop. It becomes annoying that one does not know the reason why
it exited the monitor loop. Display the cause of the reason why
the loop was exited.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index cef28e6632b98cd4e82426f45805f676c2fc0543..b96d3819c42e9d37a3c8548a1e70d8cc5e885089 100755 (executable)
@@ -841,12 +841,20 @@ sub monitor {
 
        if ($booted) {
            $line = wait_for_input($monitor_fp, $booted_timeout);
+           if (!defined($line)) {
+               my $s = $booted_timeout == 1 ? "" : "s";
+               doprint "Successful boot found: break after $booted_timeout second$s\n";
+               last;
+           }
        } else {
            $line = wait_for_input($monitor_fp);
+           if (!defined($line)) {
+               my $s = $timeout == 1 ? "" : "s";
+               doprint "Timed out after $timeout second$s\n";
+               last;
+           }
        }
 
-       last if (!defined($line));
-
        doprint $line;
        print DMESG $line;