action #28027

Add function to account for the unexpected in serial output

Added by coolo over 2 years ago. Updated almost 2 years ago.

Status:ResolvedStart date:21/11/2017
Priority:NormalDue date:
Assignee:dasantiago% Done:

90%

Category:-
Target version:Done
Difficulty:
Duration:

Description

We want a test to fail properly if the kernel output OOPS or BUG, but we can't always hook this into specific tests.

So we need a hook in the distribution to check the serial0.txt for regexps given in main.pm - and either generate soft failure or hard failure from the test.

See https://progress.opensuse.org/issues/18286 for a specific use case.


Related issues

Duplicated by openQA Project - action #18286: Catch CPU lockups Rejected 03/04/2017
Duplicated by openQA Project - action #18416: [tools][openqa][backend] Catch kernel opps on serial cons... Rejected 04/04/2017

History

#1 Updated by coolo over 2 years ago

#2 Updated by coolo over 2 years ago

  • Duplicated by action #18416: [tools][openqa][backend] Catch kernel opps on serial console / journal added

#3 Updated by dasantiago almost 2 years ago

  • Assignee set to dasantiago

#4 Updated by dasantiago almost 2 years ago

  • Status changed from New to In Progress

#5 Updated by coolo almost 2 years ago

  • Target version changed from Ready to Current Sprint

#6 Updated by dasantiago almost 2 years ago

  • % Done changed from 0 to 90

#7 Updated by szarate almost 2 years ago

  • Status changed from In Progress to Resolved

#8 Updated by szarate almost 2 years ago

  • Target version changed from Current Sprint to Done

#9 Updated by okurz almost 2 years ago

Hi, can you say what fixed it and how we can make use of it in tests?

#10 Updated by szarate almost 2 years ago

Aloha!:

You can take a look at this pr which is basically allowing you to use two type of regexps, that either will trigger a soft fail or a hard failure of a test based on what's being seen on serial output log file of the SUT if it's present.

#11 Updated by dasantiago almost 2 years ago

szarate wrote:

Aloha!:


You can take a look at this pr which is basically allowing you to use two type of regexps, that either will trigger a soft fail or a hard failure of a test based on what's being seen on serial output log file of the SUT if it's present.

Yes :-)

On the main.pm you can define overall regular expressions for all the current set of tests. Example:

$testapi::distri->set_expected_serial_failures(soft=>[quotemeta 'THIS A PATTERN'], hard=>[qr/pattern.*?matched/])

You can also specify and override patterns specified in the tests:

sub run {
my ($self) = @_;
$self->set_expected_serial_failures(soft=>[quotemeta 'THIS A PATTERN'], hard=>[qr/pattern.*?matched/])

Let me know if you have any question.

Also available in: Atom PDF