]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-64-UDEV-STORAGE: mdadm --zero-superblock seems to not support symlink
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Aug 2025 18:48:55 +0000 (03:48 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 5 Aug 2025 11:19:54 +0000 (12:19 +0100)
On CentOS 9:
```
TEST-64-UDEV-STORAGE.sh[522]: + mdadm -v --zero-superblock --force /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadmlvm0 ...
TEST-64-UDEV-STORAGE.sh[1014]: mdadm: Unrecognised md component device - /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadmlvm4
```

This also adds `udevadm settle` before clearing superblocks for safety.

Follow-up for 5ad6fe9850e0ecad7415bfbdd547d07b9b1177c7.

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

index b9769b0ff1565657047e7d82149e1b99bf9c54ed..7ee606e6975955e96e3f98c276be9fbf9803fccb 100755 (executable)
@@ -1259,7 +1259,9 @@ EOF
 
     # Clear superblocks to make the MD device will not be restarted even if the VM is restarted.
     # This is a workaround for issue #38240.
-    mdadm -v --zero-superblock --force "${devices[@]}"
+    udevadm settle --timeout=30
+    # shellcheck disable=SC2046
+    mdadm -v --zero-superblock --force $(readlink -f "${devices[@]}")
     udevadm settle --timeout=30
 
     # Check if all expected symlinks were removed after the cleanup
@@ -1322,7 +1324,9 @@ testcase_mdadm_lvm() {
 
     # Clear superblocks to make the MD device will not be restarted even if the VM is restarted.
     # This is a workaround for issue #38240.
-    mdadm -v --zero-superblock --force "${devices[@]}"
+    udevadm settle --timeout=30
+    # shellcheck disable=SC2046
+    mdadm -v --zero-superblock --force $(readlink -f "${devices[@]}")
     udevadm settle --timeout=30
 
     # Check if all expected symlinks were removed after the cleanup