Skip to content

Commit 9b1d367

Browse files
Steven Rostedtrostedt
authored andcommitted
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>
1 parent c1434dc commit 9b1d367

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎tools/testing/ktest/ktest.pl‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,7 @@ sub do_run_test {
20742074
my $line;
20752075
my $full_line;
20762076
my $bug = 0;
2077+
my $bug_ignored = 0;
20772078

20782079
wait_for_monitor 1;
20792080

@@ -2098,7 +2099,11 @@ sub do_run_test {
20982099
doprint $line;
20992100

21002101
if ($full_line =~ /call trace:/i) {
2101-
$bug = 1;
2102+
if ($ignore_errors) {
2103+
$bug_ignored = 1;
2104+
} else {
2105+
$bug = 1;
2106+
}
21022107
}
21032108

21042109
if ($full_line =~ /Kernel panic -/) {
@@ -2111,6 +2116,10 @@ sub do_run_test {
21112116
}
21122117
} while (!$child_done && !$bug);
21132118

2119+
if (!$bug && $bug_ignored) {
2120+
doprint "WARNING: Call Trace detected but ignored due to IGNORE_ERRORS=1\n";
2121+
}
2122+
21142123
if ($bug) {
21152124
my $failure_start = time;
21162125
my $now;

0 commit comments

Comments
 (0)