aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include/libtest.shlib
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-01-31 11:51:23 -0500
committerGitHub <[email protected]>2020-01-31 08:51:23 -0800
commita3bddd49f8397b3e10872a793d60c8bbbdbe2a80 (patch)
treea354b56374aeb3fe7121e856485869e7fed9aaca /tests/zfs-tests/include/libtest.shlib
parent9d8ce2457d67e112552ac20b9408464bc246b727 (diff)
ZTS: Fix a few defaults
Linux was missing a default value for DEV_DSKDIR. Set it to /dev. Fix resulting fallout. SLICE_PREFIX seems like a good candidate for including in the defaults. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9898
Diffstat (limited to 'tests/zfs-tests/include/libtest.shlib')
-rw-r--r--tests/zfs-tests/include/libtest.shlib7
1 files changed, 4 insertions, 3 deletions
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