From 7d68900af367ca4ce2922207b19c97a4261c703d Mon Sep 17 00:00:00 2001 From: VaibhavB <88050553+vaibhav-delphix@users.noreply.github.com> Date: Wed, 29 Nov 2023 23:04:29 +0530 Subject: [PATCH] ZTS: get_persistent_disk_name can return truncated names Instead of using only the 3rd element return the entire string after the split to handle device names with dashes. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Vaibhav Bhanawat Closes #15567 --- tests/zfs-tests/include/blkdev.shlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib index 6b83b10d60..51eff3023e 100644 --- a/tests/zfs-tests/include/blkdev.shlib +++ b/tests/zfs-tests/include/blkdev.shlib @@ -289,7 +289,7 @@ function get_persistent_disk_name #device if is_linux; then if is_real_device $device; then udevadm info -q all -n $DEV_DSKDIR/$device \ - | awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3 + | awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3- elif is_mpath_device $device; then udevadm info -q all -n $DEV_DSKDIR/$device \ | awk '/disk\/by-id\/dm-uuid/ {print $2; exit}' \