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 over 6 years ago
- Target version changed from Ready to Current Sprint
Updated by szarate over 6 years ago
- Target version changed from Current Sprint to Done
Updated by okurz over 6 years ago
Hi, can you say what fixed it and how we can make use of it in tests?
Updated by szarate over 6 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 over 6 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.