Skip to content

Commit

Permalink
run_ltp.pm: softfail when kernel warning is expected by test
Browse files Browse the repository at this point in the history
Signed-off-by: Avinesh Kumar <[email protected]>
  • Loading branch information
Avinesh committed Oct 31, 2024
1 parent 7732689 commit 5c0d7b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/known_bugs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ sub create_list_of_serial_failures {

if (is_kernel_test()) {
my $type = is_ltp_test() ? 'soft' : 'hard';
push @$serial_failures, {type => $type, message => 'Kernel Ooops found', pattern => quotemeta 'Oops:', post_boot_type => 'hard'};
push @$serial_failures, {type => $type, message => 'Kernel Oops found', pattern => quotemeta 'Oops:', post_boot_type => 'hard'};
push @$serial_failures, {type => $type, message => 'Kernel BUG found', pattern => qr/kernel BUG at/i, post_boot_type => 'hard'};
push @$serial_failures, {type => $type, message => 'WARNING CPU in kernel messages', pattern => quotemeta 'WARNING: CPU', post_boot_type => 'hard'};
push @$serial_failures, {type => $type, message => 'WARNING CPU in kernel messages', pattern => quotemeta 'WARNING: CPU', post_boot_type => 'hard', soft_on_expect_warn => 1};
push @$serial_failures, {type => $type, message => 'Kernel stack is corrupted', pattern => quotemeta 'stack-protector: Kernel stack is corrupted', post_boot_type => 'hard'};
push @$serial_failures, {type => $type, message => 'Kernel BUG found', pattern => quotemeta 'BUG: failure at', post_boot_type => 'hard'};
push @$serial_failures, {type => $type, message => 'Kernel Ooops found', pattern => quotemeta '-[ cut here ]-', post_boot_type => 'hard'};
push @$serial_failures, {type => $type, message => 'Kernel Oops found', pattern => quotemeta '-[ cut here ]-', post_boot_type => 'hard', soft_on_expect_warn => 1};
# bsc#1229025, but must be soft because any LTP test which intentionally triggers OOM killer will produce this call trace as well
push @$serial_failures, {type => 'soft', message => 'Kernel Call Trace found', pattern => quotemeta 'Call Trace:'};
}
Expand Down
5 changes: 4 additions & 1 deletion tests/kernel/run_ltp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ sub pre_run_hook {
# But change them to hard fail in this test module.
for my $pattern (@{$self->{serial_failures}}) {
my %tmp = %$pattern;
$tmp{type} = $tmp{post_boot_type} if defined($tmp{post_boot_type});

# don't switch to hard fail when test is expected to produce kernel warning
$tmp{type} = $tmp{post_boot_type} if defined($tmp{post_boot_type}) && !($tmp{soft_on_expect_warn} && get_var('LTP_WARN_EXPECTED'));

push @pattern_list, \%tmp;
}

Expand Down

0 comments on commit 5c0d7b9

Please sign in to comment.