Skip to content

Commit

Permalink
Merge pull request #8438 from jknphy/fix_validate_raid
Browse files Browse the repository at this point in the history
Fix false positive in validate_raid
  • Loading branch information
Rodion Iafarov committed Sep 13, 2019
2 parents d444103 + e60dbd8 commit 6774c33
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions tests/console/validate_raid.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use strict;
use warnings;
use base "opensusebasetest";
use testapi;
use version_utils 'is_sle';
use version_utils qw(is_sle is_leap is_tumbleweed);
use Test::Assert ':all';

#
Expand Down Expand Up @@ -52,8 +52,10 @@ my $raid_level = qr/\/dev\/md0:.*?Raid Level : raid$level/s;
# RAID array always with level 0
my $raid0 = qr/\/dev\/md(1|2):.*?Raid Level : raid0/s;
# RAID array always with level 1? why?
my $raid1 = qr/\/dev\/md1:.*?Raid Level : raid1/s;
my @raid_detail = (
my $raid1 = qr/\/dev\/md1:.*?Raid Level : raid1/s;
# RAID arrays both with the same level
my $raid_both_same_level = qr/(\/dev\/md(0|1):.*?Raid Level : raid$level.*){2}/s;
my @raid_detail = (
# 4 RAID devices per RAID array
/(Raid Devices : 4.*){$num_raid_arrays}/s,
# 4 active RAID devices per RAID array
Expand Down Expand Up @@ -93,6 +95,13 @@ sub prepare_test_data {
$vfat_efi,
$btrfs, $swap,
);
if (is_sle('>=15-SP2') || is_sle('=12-SP5')) {
@raid = ($raid_both_same_level, @raid_detail);
}
else {
# raid0 for swap is required in some products
@raid = (($raid_level, $raid0), @raid_detail);
}
}
elsif (check_var('ARCH', 'x86_64')) {
if (is_sle('<15')) {
Expand All @@ -105,13 +114,20 @@ sub prepare_test_data {
$num_raid_arrays = @raid_arrays;
@raid = (($raid_level, $raid0, $raid1), @raid_detail);
}
}
else {
@partitioning = (
$raid_partitions_2_arrays, $hard_disks, $linux_raid_member_2_arrays,
$btrfs, $swap,
);
@raid = (($raid_level, $raid0), @raid_detail);
else {
@partitioning = (
$raid_partitions_2_arrays, $hard_disks, $linux_raid_member_2_arrays,
$btrfs, $swap,
);
if (is_sle('<=15-SP1') || get_var('STAGING') ||
is_leap() || (is_tumbleweed() && check_var('FLAVOR', 'NET'))) {
# raid0 for swap is required in some products
@raid = (($raid_level, $raid0), @raid_detail);
}
else {
@raid = ($raid_both_same_level, @raid_detail);
}
}
}
}

Expand Down

0 comments on commit 6774c33

Please sign in to comment.