summaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zfs-tests/include')
-rw-r--r--tests/zfs-tests/include/blkdev.shlib7
-rw-r--r--tests/zfs-tests/include/default.cfg.in7
-rw-r--r--tests/zfs-tests/include/libtest.shlib7
3 files changed, 11 insertions, 10 deletions
diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib
index 5a750bf1b..2269131a4 100644
--- a/tests/zfs-tests/include/blkdev.shlib
+++ b/tests/zfs-tests/include/blkdev.shlib
@@ -89,8 +89,8 @@ function block_device_wait
#
function is_physical_device #device
{
- typeset device=${1#$DEV_DSKDIR}
- device=${device#$DEV_RDSKDIR}
+ typeset device=${1#$DEV_DSKDIR/}
+ device=${device#$DEV_RDSKDIR/}
if is_linux; then
is_disk_device "$DEV_DSKDIR/$device" && \
@@ -216,9 +216,6 @@ function set_slice_prefix
fi
(( i = i + 1))
done
- elif is_freebsd; then
- export SLICE_PREFIX="p"
- return 0
fi
}
diff --git a/tests/zfs-tests/include/default.cfg.in b/tests/zfs-tests/include/default.cfg.in
index 1281176cb..741c0d3b2 100644
--- a/tests/zfs-tests/include/default.cfg.in
+++ b/tests/zfs-tests/include/default.cfg.in
@@ -173,6 +173,7 @@ if is_linux; then
ZVOL_DEVDIR="/dev/zvol"
ZVOL_RDEVDIR="/dev/zvol"
+ DEV_DSKDIR="/dev"
DEV_RDSKDIR="/dev"
DEV_MPATHDIR="/dev/mapper"
@@ -182,8 +183,8 @@ if is_linux; then
VDEVID_CONF="$ZEDLET_DIR/vdev_id.conf"
VDEVID_CONF_ETC="/etc/zfs/vdev_id.conf"
-
NEWFS_DEFAULT_FS="ext2"
+ SLICE_PREFIX=""
elif is_freebsd; then
unpack_opts="xv"
pack_opts="cf"
@@ -198,6 +199,7 @@ elif is_freebsd; then
DEV_MPATHDIR="/dev/multipath"
NEWFS_DEFAULT_FS="ufs"
+ SLICE_PREFIX="p"
else
unpack_opts="xv"
pack_opts="cf"
@@ -211,8 +213,9 @@ else
DEV_RDSKDIR="/dev/rdsk"
NEWFS_DEFAULT_FS="ufs"
+ SLICE_PREFIX="s"
fi
export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
ZVOL_DEVDIR ZVOL_RDEVDIR DEV_DSKDIR DEV_RDSKDIR DEV_MPATHDIR \
ZEDLET_DIR ZED_LOG ZED_DEBUG_LOG VDEVID_CONF VDEVID_CONF_ETC \
- NEWFS_DEFAULT_FS
+ NEWFS_DEFAULT_FS SLICE_PREFIX
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib
index 4ad3ee9bf..ac9ff6183 100644
--- a/tests/zfs-tests/include/libtest.shlib
+++ b/tests/zfs-tests/include/libtest.shlib
@@ -914,14 +914,15 @@ function set_partition
typeset -i slicenum=$1
typeset start=$2
typeset size=$3
- typeset disk=$4
+ typeset disk=${4#$DEV_DSKDIR/}
+ disk=${disk#$DEV_RDSKDIR/}
case "$(uname)" in
Linux)
if [[ -z $size || -z $disk ]]; then
log_fail "The size or disk name is unspecified."
fi
- [[ -n $DEV_DSKDIR ]] && disk=$DEV_DSKDIR/$disk
+ disk=$DEV_DSKDIR/$disk
typeset size_mb=${size%%[mMgG]}
size_mb=${size_mb%%[mMgG][bB]}
@@ -969,7 +970,7 @@ function set_partition
if [[ -z $size || -z $disk ]]; then
log_fail "The size or disk name is unspecified."
fi
- [[ -n $DEV_DSKDIR ]] && disk=$DEV_DSKDIR/$disk
+ disk=$DEV_DSKDIR/$disk
if [[ $slicenum -eq 0 ]] || ! gpart show $disk >/dev/null 2>&1; then
gpart destroy -F $disk >/dev/null 2>&1