Commit 6ca996cc7cee88a6153158455a0ba8e1e79dcd2e

Authored by Steven Rostedt
Committed by Steven Rostedt
1 parent 627977d83a

ktest: Add warning when bugs are ignored

When IGNORE_ERRORS is set, ktest will not fail a test if a backtrace
is detected. But this can be an issue if the user added it in the
config but forgot to remove it. They may be left wondering why their
test did not fail, or even worse, why their bisect gave the wrong
commit.

Add a warning in the output if IGNORE_WARNINGS is set, and ktest detects
a kernel error.

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

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

tools/testing/ktest/ktest.pl
... ... @@ -1460,6 +1460,7 @@
1460 1460 sub monitor {
1461 1461 my $booted = 0;
1462 1462 my $bug = 0;
  1463 + my $bug_ignored = 0;
1463 1464 my $skip_call_trace = 0;
1464 1465 my $loops;
1465 1466  
... ... @@ -1531,9 +1532,13 @@
1531 1532 }
1532 1533  
1533 1534 if ($full_line =~ /call trace:/i) {
1534   - if (!$ignore_errors && !$bug && !$skip_call_trace) {
1535   - $bug = 1;
1536   - $failure_start = time;
  1535 + if (!$bug && !$skip_call_trace) {
  1536 + if ($ignore_errors) {
  1537 + $bug_ignored = 1;
  1538 + } else {
  1539 + $bug = 1;
  1540 + $failure_start = time;
  1541 + }
1537 1542 }
1538 1543 }
1539 1544  
... ... @@ -1593,6 +1598,10 @@
1593 1598 if (!$booted) {
1594 1599 return 0 if ($in_bisect);
1595 1600 fail "failed - never got a boot prompt." and return 0;
  1601 + }
  1602 +
  1603 + if ($bug_ignored) {
  1604 + doprint "WARNING: Call Trace detected but ignored due to IGNORE_ERRORS=1\n";
1596 1605 }
1597 1606  
1598 1607 return 1;