]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: get_persistent_disk_name can return truncated names
authorVaibhavB <88050553+vaibhav-delphix@users.noreply.github.com>
Wed, 29 Nov 2023 17:34:29 +0000 (23:04 +0530)
committerGitHub <noreply@github.com>
Wed, 29 Nov 2023 17:34:29 +0000 (09:34 -0800)
Instead of using only the 3rd element return the entire string after
the split to handle device names with dashes.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com>
Closes #15567

tests/zfs-tests/include/blkdev.shlib

index 6b83b10d604d2b4cf329c9fd287520c19acccefe..51eff3023e73201d0cff94b2a69aa4ae0a74b039 100644 (file)
@@ -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}' \