action #28027
closedAdd function to account for the unexpected in serial output
90%
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.
Updated by coolo about 7 years ago
- Has duplicate action #18286: Catch CPU lockups added
Updated by coolo about 7 years ago
- Has duplicate action #18416: [tools][openqa][backend] Catch kernel opps on serial console / journal added
Updated by coolo almost 7 years ago
- Target version changed from Ready to Current Sprint
Updated by szarate almost 7 years ago
- Status changed from In Progress to Resolved
Updated by szarate almost 7 years ago
- Target version changed from Current Sprint to Done
Updated by okurz almost 7 years ago
Hi, can you say what fixed it and how we can make use of it in tests?
Updated by szarate almost 7 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.
Updated by dasantiago almost 7 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.