aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include/blkdev.shlib
diff options
context:
space:
mode:
authorPaul Zuchowski <[email protected]>2018-03-07 20:03:33 -0500
committerBrian Behlendorf <[email protected]>2018-03-07 17:03:33 -0800
commit8e5d14844d2f22997b3a41d8e2357e8f30c5d5dd (patch)
treef6435948dbb50287f614279d49a32736ae9b1db7 /tests/zfs-tests/include/blkdev.shlib
parent0e85048f53e46f30f26540fe3f6ae755d4d52ad1 (diff)
zdb and inuse tests don't pass with real disks
Due to zpool create auto-partioning in Linux (i.e. sdb1), certain utilities need to use the parition (sdb1) while others use the whole disk name (sdb). Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Paul Zuchowski <[email protected]> Closes #6939 Closes #7261
Diffstat (limited to 'tests/zfs-tests/include/blkdev.shlib')
-rw-r--r--tests/zfs-tests/include/blkdev.shlib16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib
index 28ac1052c..87ffa8560 100644
--- a/tests/zfs-tests/include/blkdev.shlib
+++ b/tests/zfs-tests/include/blkdev.shlib
@@ -423,3 +423,19 @@ function get_debug_device
{
lsscsi | nawk '/scsi_debug/ {print $6; exit}' | cut -d / -f3
}
+
+#
+# Get actual devices used by the pool (i.e. linux sdb1 not sdb).
+#
+function get_pool_devices #testpool #devdir
+{
+ typeset testpool=$1
+ typeset devdir=$2
+ typeset out=""
+
+ if is_linux; then
+ out=$(zpool status -P $testpool |grep ${devdir} | awk '{print $1}')
+ out=$(echo $out | sed -e "s|${devdir}/||g" | tr '\n' ' ')
+ fi
+ echo $out
+}