summaryrefslogtreecommitdiffstats
path: root/test/units/testsuite-64.sh
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-03-09 13:50:15 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-03-09 13:50:15 +0100
commitb3ba7d6274aff864a80dc9b1ff7d88ad376da451 (patch)
tree9a0cf4d7757b3f7cc4dad9d8d02ed24e3ab2e475 /test/units/testsuite-64.sh
parenttest: don't fail if we can't remove the scsi_debug module (diff)
downloadsystemd-b3ba7d6274aff864a80dc9b1ff7d88ad376da451.tar.xz
systemd-b3ba7d6274aff864a80dc9b1ff7d88ad376da451.zip
test: force mkfs.btrfs to overwrite any existing file systems
mkfs.btrfs (unlike mkfs.ext4) checks if the target already contains a file system and refuses to continue if so. This causes spurious fails in case the random garbage on the temporary device matches a valid FS header: [ 19.723806] testsuite-64.sh[355]: + udevadm lock --device=/dev/mapper/encbtrfs0 --device=/dev/mapper/encbtrfs1 --device=/dev/mapper/encbtrfs2 --device=/dev/mapper/encbtrfs3 mkfs.btrfs -M -d raid1 -m raid1 -L btrfs_mencdisk -U deadbeef-dead-dead-beef-000000000003 /dev/mapper/encbtrfs0 /dev/mapper/encbtrfs1 /dev/mapper/encbtrfs2 /dev/mapper/encbtrfs3 [ 19.918934] testsuite-64.sh[2494]: ERROR: /dev/mapper/encbtrfs0 appears to contain an existing filesystem (hfsplus) [ 19.920490] testsuite-64.sh[2494]: ERROR: use the -f option to force overwrite of /dev/mapper/encbtrfs0 Let's force mkfs.btrfs to overwrite the file system in such case.
Diffstat (limited to 'test/units/testsuite-64.sh')
-rwxr-xr-xtest/units/testsuite-64.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh
index 4d73c57aeb..fbab282334 100755
--- a/test/units/testsuite-64.sh
+++ b/test/units/testsuite-64.sh
@@ -646,7 +646,7 @@ testcase_btrfs_basic() {
echo "Single device: default settings"
uuid="deadbeef-dead-dead-beef-000000000000"
label="btrfs_root"
- udevadm lock --device="${devices[0]}" mkfs.btrfs -L "$label" -U "$uuid" "${devices[0]}"
+ udevadm lock --device="${devices[0]}" mkfs.btrfs -f -L "$label" -U "$uuid" "${devices[0]}"
udevadm wait --settle --timeout=30 "${devices[0]}" "/dev/disk/by-uuid/$uuid" "/dev/disk/by-label/$label"
btrfs filesystem show
helper_check_device_symlinks
@@ -664,7 +664,7 @@ name="diskpart3", size=85M
name="diskpart4", size=85M
EOF
udevadm wait --settle --timeout=30 /dev/disk/by-partlabel/diskpart{1..4}
- udevadm lock --device="${devices[0]}" mkfs.btrfs -d single -m raid1 -L "$label" -U "$uuid" /dev/disk/by-partlabel/diskpart{1..4}
+ udevadm lock --device="${devices[0]}" mkfs.btrfs -f -d single -m raid1 -L "$label" -U "$uuid" /dev/disk/by-partlabel/diskpart{1..4}
udevadm wait --settle --timeout=30 "/dev/disk/by-uuid/$uuid" "/dev/disk/by-label/$label"
btrfs filesystem show
helper_check_device_symlinks
@@ -680,7 +680,7 @@ EOF
--device=/dev/disk/by-id/ata-foobar_deadbeefbtrfs1 \
--device=/dev/disk/by-id/ata-foobar_deadbeefbtrfs2 \
--device=/dev/disk/by-id/ata-foobar_deadbeefbtrfs3 \
- mkfs.btrfs -M -d raid10 -m raid10 -L "$label" -U "$uuid" "${devices[@]}"
+ mkfs.btrfs -f -M -d raid10 -m raid10 -L "$label" -U "$uuid" "${devices[@]}"
udevadm wait --settle --timeout=30 "/dev/disk/by-uuid/$uuid" "/dev/disk/by-label/$label"
btrfs filesystem show
helper_check_device_symlinks
@@ -720,7 +720,7 @@ EOF
--device=/dev/mapper/encbtrfs1 \
--device=/dev/mapper/encbtrfs2 \
--device=/dev/mapper/encbtrfs3 \
- mkfs.btrfs -M -d raid1 -m raid1 -L "$label" -U "$uuid" /dev/mapper/encbtrfs{0..3}
+ mkfs.btrfs -f -M -d raid1 -m raid1 -L "$label" -U "$uuid" /dev/mapper/encbtrfs{0..3}
udevadm wait --settle --timeout=30 "/dev/disk/by-uuid/$uuid" "/dev/disk/by-label/$label"
btrfs filesystem show
helper_check_device_symlinks