Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add raid validation test #7182

Merged
merged 1 commit into from
Apr 5, 2019
Merged

Conversation

jknphy
Copy link
Contributor

@jknphy jknphy commented Apr 1, 2019

@jknphy jknphy changed the title Add raid validation test [WIP] Add raid validation test Apr 1, 2019
@jknphy jknphy force-pushed the add_raid_validation branch 12 times, most recently from 82cf6dc to 3a0bbe2 Compare April 3, 2019 11:45
@jknphy jknphy changed the title [WIP] Add raid validation test Add raid validation test Apr 3, 2019
@jknphy jknphy force-pushed the add_raid_validation branch 2 times, most recently from 34b3cfa to add66af Compare April 4, 2019 09:31
# RAID level from settings
my $level = get_required_var('RAIDLEVEL');
# RAID array with corresponding RAID level
my $raid_level = qr/\/dev\/md0:.*?Raid Level : raid$level/s;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, our idea with named regexp will require too many changes to the PR. But for your info, here is how it could look like.

my $raid_level = qr/\/dev\/md0:.*Raid Level : raid(?<raid_level>\d+)/s;
 assert_matches($level, $+{raid_level}, "Raid level check for md0 failed");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for those cases it would work but most of the regex are taking into account repetition. I didn't find in perl the way to capture in cases like this:
(md(?<number>\d).*){8} Basically .* matches until the end of the full output, the break line is treated as another character with /s modifier and not sure how to call it later in case it would be possible unless hash $+{number} could contain an array, but this is also bad example as "md" would remain out of the match, but just to explain what I found tricky. We'll figure out all together, thanks! :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, we don't have answer yet, but your PR shows us that there is a question we need to answer =)

@rwx788 rwx788 merged commit 2099205 into os-autoinst:master Apr 5, 2019
@rwx788
Copy link
Member

rwx788 commented Apr 5, 2019

Please, adjust test suites settings accordingly ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants