]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-64-UDEV-STORAGE: forcibly create new physical volume
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Sep 2025 12:45:56 +0000 (21:45 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 Oct 2025 09:48:58 +0000 (11:48 +0200)
When the test VM is accidentally rebooted, there exists the previously
created volume, and the command fails with the following:
```
TEST-64-UDEV-STORAGE.sh[282]: + lvm pvcreate -y /dev/md/mdlvm
TEST-64-UDEV-STORAGE.sh[442]:   Can't initialize physical volume "/dev/md127" of volume group "mdlvm_vg" without -ff
TEST-64-UDEV-STORAGE.sh[442]:   /dev/md127: physical volume not initialized.
[FAILED] Failed to start TEST-64-UDEV-STORAGE-mdadm_lvm.service.
```
Let's ignore the existence of previous volume and forcibly create new one.

Workaround for issue #38240.

(cherry picked from commit 8685f8edd17a5e465bf05d733ac22c010c464938)

test/units/TEST-64-UDEV-STORAGE.sh

index 7ee606e6975955e96e3f98c276be9fbf9803fccb..c29731e62324255df63fd6c079a3bdf2d85ee01f 100755 (executable)
@@ -1295,7 +1295,7 @@ testcase_mdadm_lvm() {
     printf 'y\ny\n' | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadmlvm{0..3} -v -f --level=10 --raid-devices=4
     udevadm wait --settle --timeout=30 "$raid_dev"
     # Create an LVM on the MD
-    lvm pvcreate -y "$raid_dev"
+    lvm pvcreate -y -ff "$raid_dev"
     lvm pvs
     lvm vgcreate "$vgroup" -y "$raid_dev"
     lvm vgs