test-data: Use another name for boot and root MD devices.

mdadm 4.0 no longer lets you create devices called literally "boot" or
"root", giving a very obscure error message:

https://bugzilla.redhat.com/show_bug.cgi?id=1433575

Work around this by calling them something else.
This commit is contained in:
Richard W.M. Jones
2017-03-18 10:11:13 +00:00
parent b6adf66628
commit 327caa1f08
2 changed files with 8 additions and 8 deletions

View File

@@ -83,7 +83,7 @@ LABEL=ROOT / ext2 default 0 0
EOF EOF
close ($fstab) or die; close ($fstab) or die;
$bootdev = '/dev/md/boot'; $bootdev = '/dev/md/bootdev';
foreach my $img (@images) { foreach my $img (@images) {
$g->disk_create ($img, "raw", $IMAGE_SIZE); $g->disk_create ($img, "raw", $IMAGE_SIZE);
@@ -100,8 +100,8 @@ EOF
} }
} }
$g->md_create ('boot', ['/dev/sda1', '/dev/sdb1']); $g->md_create ('bootdev', ['/dev/sda1', '/dev/sdb1']);
$g->md_create ('root', ['/dev/sda2', '/dev/sdb2']); $g->md_create ('rootdev', ['/dev/sda2', '/dev/sdb2']);
open (my $mdadm, '>', "fedora.mdadm") or die; open (my $mdadm, '>', "fedora.mdadm") or die;
print $mdadm <<EOF; print $mdadm <<EOF;
@@ -110,7 +110,7 @@ AUTO +imsm +1.x -all
EOF EOF
my $i = 0; my $i = 0;
foreach ('boot', 'root') { foreach ('bootdev', 'rootdev') {
my %detail = $g->md_detail ("/dev/md/$_"); my %detail = $g->md_detail ("/dev/md/$_");
print $mdadm "ARRAY /dev/md$i level=raid1 num-devices=2 UUID=", print $mdadm "ARRAY /dev/md$i level=raid1 num-devices=2 UUID=",
$detail{uuid}, "\n"; $detail{uuid}, "\n";
@@ -119,7 +119,7 @@ EOF
close ($mdadm) or die; close ($mdadm) or die;
init_lvm_root ('/dev/md/root'); init_lvm_root ('/dev/md/rootdev');
} }
elsif ($ENV{LAYOUT} eq 'btrfs') { elsif ($ENV{LAYOUT} eq 'btrfs') {

View File

@@ -40,10 +40,10 @@ if [ "$(cat inspect-fstab-md.output)" != "true" ]; then
exit 1 exit 1
fi fi
# Test inspection when /boot is specfied as /dev/md/boot # Test inspection when /boot is specfied as /dev/md/bootdev
cat <<'EOF' > inspect-fstab-md.fstab cat <<'EOF' > inspect-fstab-md.fstab
/dev/VG/Root / ext2 default 0 0 /dev/VG/Root / ext2 default 0 0
/dev/md/boot /boot ext2 default 0 0 /dev/md/bootdev /boot ext2 default 0 0
EOF EOF
guestfish --format=raw -a inspect-fstab-md-1.img --format=raw -a inspect-fstab-md-2.img <<'EOF' guestfish --format=raw -a inspect-fstab-md-1.img --format=raw -a inspect-fstab-md-2.img <<'EOF'
@@ -57,7 +57,7 @@ guestfish -i --format=raw -a inspect-fstab-md-1.img --format=raw -a inspect-fsta
EOF EOF
if [ "$(cat inspect-fstab-md.output)" != "true" ]; then if [ "$(cat inspect-fstab-md.output)" != "true" ]; then
echo "$0: error: /boot not correctly mounted (/dev/md/boot)" echo "$0: error: /boot not correctly mounted (/dev/md/bootdev)"
cat inspect-fstab-md.output cat inspect-fstab-md.output
exit 1 exit 1
fi fi