Skip to content

Instantly share code, notes, and snippets.

@foursixnine
Last active December 17, 2018 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foursixnine/0adecc8a72ec44fc55b5def70c5f5fb3 to your computer and use it in GitHub Desktop.
Save foursixnine/0adecc8a72ec44fc55b5def70c5f5fb3 to your computer and use it in GitHub Desktop.
pairprogramming
use strict;
use warnings;
use feature 'say';
use Data::Dump qw(pp);
my $serial_failures = [];
push @$serial_failures, {type => 'hard', message => 'welcome screen found', pattern => quotemeta 'Welcome'};
push @$serial_failures, {type => 'soft', message => 'Linux thingie found', pattern => quotemeta 'Linux version'};
push @$serial_failures, {type => 'soft', message => 'bsc#1112109', pattern => qr/serial-getty.*service: Service RestartSec=.*ms expired, scheduling restart/};
say pp($serial_failures);
[
{ message => "welcome screen found", pattern => "Welcome", type => "hard" },
{
message => "Linux thingie found",
pattern => "Linux\\ version",
type => "soft",
},
{
message => "bsc#1112109",
pattern => qr/serial-getty.*service: Service RestartSec=.*ms expired, scheduling restart/,
type => "soft",
},
]
# in known_bugs module
sub prepare_list_of_failures {
my $serial_failures = [];
push @$serial_failures, {type => 'hard', message => 'welcome screen found', pattern => quotemeta 'Welcome'};
push @$serial_failures, {type => 'soft', message => 'Linux thingie found', pattern => quotemeta 'Linux version'};
push @$serial_failures, {type => 'soft', message => 'bsc#1112109', pattern => qr/serial-getty.*service: Service RestartSec=.*ms expired, scheduling restart/};
return $serial_failures;
}
## in the main.pm
$testapi::distri->set_expected_serial_failures(prepare_list_of_failures());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment