Skip to content

Commit 133b50d

Browse files
committed
test: answer 2nd mdadm --create question for compat with new version
New version of mdadm now asks a second question, so send 'y' twice to it in the test scripts [ 5.253483] TEST-64-UDEV-STORAGE.sh[684]: + echo y [ 5.254412] TEST-64-UDEV-STORAGE.sh[685]: + mdadm --create /dev/md/mdmirror --name mdmirror --uuid aaaaaaaa:bbbbbbbb:cccccccc:00000001 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm0 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm1 -v -f --level=1 --raid-devices=2 [ 5.254759] TEST-64-UDEV-STORAGE.sh[685]: To optimalize recovery speed, it is recommended to enable write-indent bitmap, do you want to enable it now? [y/N]? mdadm: Note: this array has metadata at the start and [ 5.255085] TEST-64-UDEV-STORAGE.sh[685]: may not be suitable as a boot device. If you plan to [ 5.255418] TEST-64-UDEV-STORAGE.sh[685]: store '/boot' on this device please ensure that [ 5.255745] TEST-64-UDEV-STORAGE.sh[685]: your boot-loader understands md/v1.x metadata, or use [ 5.256285] TEST-64-UDEV-STORAGE.sh[685]: --metadata=0.90 [ 5.256672] TEST-64-UDEV-STORAGE.sh[685]: mdadm: size set to 64512K [ 5.257063] TEST-64-UDEV-STORAGE.sh[685]: Continue creating array [y/N]? mdadm: create aborted. This is backward compatible with the older version that asks just one question (cherry picked from commit 1640642) (cherry picked from commit b2320ce) (cherry picked from commit 8127259)
1 parent b030bfb commit 133b50d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/units/testsuite-64.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ testcase_mdadm_basic() {
10101010
"/dev/disk/by-label/$part_name" # ext4 partition
10111011
)
10121012
# Create a simple RAID 1 with an ext4 filesystem
1013-
echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..1} -v -f --level=1 --raid-devices=2
1013+
printf 'y\ny\n' | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..1} -v -f --level=1 --raid-devices=2
10141014
udevadm wait --settle --timeout=30 "$raid_dev"
10151015
mkfs.ext4 -L "$part_name" "$raid_dev"
10161016
udevadm wait --settle --timeout=30 "${expected_symlinks[@]}"
@@ -1039,7 +1039,7 @@ testcase_mdadm_basic() {
10391039
"/dev/disk/by-label/$part_name" # ext4 partition
10401040
)
10411041
# Create a simple RAID 5 with an ext4 filesystem
1042-
echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..2} -v -f --level=5 --raid-devices=3
1042+
printf 'y\ny\n' | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..2} -v -f --level=5 --raid-devices=3
10431043
udevadm wait --settle --timeout=30 "$raid_dev"
10441044
mkfs.ext4 -L "$part_name" "$raid_dev"
10451045
udevadm wait --settle --timeout=30 "${expected_symlinks[@]}"
@@ -1079,7 +1079,7 @@ testcase_mdadm_basic() {
10791079
"/dev/disk/by-id/md-uuid-$uuid-part3"
10801080
)
10811081
# Create a simple RAID 10 with an ext4 filesystem
1082-
echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..3} -v -f --level=10 --raid-devices=4
1082+
printf 'y\ny\n' | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..3} -v -f --level=10 --raid-devices=4
10831083
udevadm wait --settle --timeout=30 "$raid_dev"
10841084
# Partition the raid device
10851085
# Here, 'udevadm lock' is meaningless, as udevd does not lock MD devices.
@@ -1132,7 +1132,7 @@ testcase_mdadm_lvm() {
11321132
"/dev/disk/by-label/$part_name" # ext4 partition
11331133
)
11341134
# Create a RAID 10 with LVM + ext4
1135-
echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadmlvm{0..3} -v -f --level=10 --raid-devices=4
1135+
printf 'y\ny\n' | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadmlvm{0..3} -v -f --level=10 --raid-devices=4
11361136
udevadm wait --settle --timeout=30 "$raid_dev"
11371137
# Create an LVM on the MD
11381138
lvm pvcreate -y "$raid_dev"

test/units/testsuite-74.bootctl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ EOF
215215

216216
udevadm settle
217217

218-
echo y | mdadm --create /dev/md/raid-esp --name "raid-esp" "${LOOPDEV1}p1" "${LOOPDEV2}p1" -v -f --level=1 --raid-devices=2
218+
printf 'y\ny\n' | mdadm --create /dev/md/raid-esp --name "raid-esp" "${LOOPDEV1}p1" "${LOOPDEV2}p1" -v -f --level=1 --raid-devices=2
219219
mkfs.vfat /dev/md/raid-esp
220-
echo y | mdadm --create /dev/md/raid-root --name "raid-root" "${LOOPDEV1}p2" "${LOOPDEV2}p2" -v -f --level=1 --raid-devices=2
220+
printf 'y\ny\n' | mdadm --create /dev/md/raid-root --name "raid-root" "${LOOPDEV1}p2" "${LOOPDEV2}p2" -v -f --level=1 --raid-devices=2
221221
mkfs.ext4 /dev/md/raid-root
222222
mkfs.btrfs -f -M -d raid1 -m raid1 -L "raid-boot" "${LOOPDEV1}p3" "${LOOPDEV2}p3"
223223

0 commit comments

Comments
 (0)