]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: force mkfs.btrfs to overwrite any existing file systems
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 9 Mar 2023 12:50:15 +0000 (13:50 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 9 Mar 2023 12:50:15 +0000 (13:50 +0100)
commitb3ba7d6274aff864a80dc9b1ff7d88ad376da451
tree9a0cf4d7757b3f7cc4dad9d8d02ed24e3ab2e475
parentcca295ab7ac32ddc9626c0e3a935d54630445050
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.
test/units/testsuite-64.sh