Commit 9b1d367dbbeb6646f04a8865ecc2bc454f7dd88f

Authored by Steven Rostedt
Committed by Steven Rostedt
1 parent c1434dcc57

ktest: Ignore errors it tests if IGNORE_ERRORS is set

The option IGNORE_ERRORS is used to allow a test to succeed even if a
warning appears from the kernel. Sometimes kernels will produce warnings
that are not associated with a test, and the user wants to test
something else.

The IGNORE_ERRORS works for boot up, but was not preventing test runs to
succeed if the kernel produced a warning.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Showing 1 changed file with 10 additions and 1 deletions Side-by-side Diff

tools/testing/ktest/ktest.pl
... ... @@ -2074,6 +2074,7 @@
2074 2074 my $line;
2075 2075 my $full_line;
2076 2076 my $bug = 0;
  2077 + my $bug_ignored = 0;
2077 2078  
2078 2079 wait_for_monitor 1;
2079 2080  
... ... @@ -2098,7 +2099,11 @@
2098 2099 doprint $line;
2099 2100  
2100 2101 if ($full_line =~ /call trace:/i) {
2101   - $bug = 1;
  2102 + if ($ignore_errors) {
  2103 + $bug_ignored = 1;
  2104 + } else {
  2105 + $bug = 1;
  2106 + }
2102 2107 }
2103 2108  
2104 2109 if ($full_line =~ /Kernel panic -/) {
... ... @@ -2110,6 +2115,10 @@
2110 2115 }
2111 2116 }
2112 2117 } while (!$child_done && !$bug);
  2118 +
  2119 + if (!$bug && $bug_ignored) {
  2120 + doprint "WARNING: Call Trace detected but ignored due to IGNORE_ERRORS=1\n";
  2121 + }
2113 2122  
2114 2123 if ($bug) {
2115 2124 my $failure_start = time;