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 <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #9898
This commit is contained in:
Ryan Moeller
2020-01-31 11:51:23 -05:00
committed by GitHub
parent 9d8ce2457d
commit a3bddd49f8
14 changed files with 11 additions and 35 deletions
+2 -5
View File
@@ -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
}
+5 -2
View File
@@ -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
+4 -3
View File
@@ -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