Message ID | 20250311050327.4889-4-xni@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mdadm: regression tests fix | expand |
diff --git a/tests/env-ddf-template b/tests/env-ddf-template index 4f4ad0f32c0c..ebc0ebf3ab1e 100644 --- a/tests/env-ddf-template +++ b/tests/env-ddf-template @@ -3,8 +3,7 @@ sha1_sum() { } get_rootdev() { - local part=$(grep ' / ' /proc/mounts | awk '{print $1}') - local bd=/dev/$(lsblk -no PKNAME $part) + local bd=$(grep ' / ' /proc/mounts | awk '{print $1}') [ -b $bd ] || exit 1 echo $bd }
If it's a device mapper device, bd is null. So use the result from /proc/mounts directly. For example: grep ' / ' /proc/mounts | awk '{print }' -> /dev/mapper/rhel_storageqe--104-root lsblk -no PKNAME /dev/mapper/rhel_storageqe--104-root -> null Signed-off-by: Xiao Ni <xni@redhat.com> --- tests/env-ddf-template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)