Real disk partitioning now enabled in test suite for Linux

When using real devices, specify DISKS="sdb sdc sdd" opposed to
/dev/sdb in zfs-tests.sh - otherwise errors with directory names and
disk names registering as "/dev//dev/sdb" for some tests.  The same
goes for mpath: DISK="mpatha mpathad mpathb"

Expected Usage:

$ DISKS="sdb sdc sdd" zfs-tests.sh

SLICE_PREFIX is now set as "p" for a loop device (ie loop0p2) or
"" for a real device (ie sdb2), or either for multipath devices
(ie mpatha1 or mpath1p1) instead of only "p" by default.  Note that
kpartx partitioning is not currently supported in this patch
(ie "partx") and may need to be disabled on Debian distributions.
Functions added for determining test directory (/dev or /dev/mapper)
as well as slice prefix are determined and exported mostly in the cfg
file of each test group directory.

Currently zpools cannot be created on whole mpath devices that have
been partitioned. In order to fix this tests have either been revised
to use a partition instead, or if there is a size constraint and the
pool needs to be created on the whole disk, partitions are then deleted
if the device is a multipath device.  This functionality is added to
default_cleanup() or to individual cleanup scripts if a non-default
cleanup method is used.

The max partitions is currently set at 8 to account for all of the
tests thus far.

Patch changes are generally encompassed in "if is_linux" construct.

Signed-off-by: Sydney Vanda <sydney.m.vanda@intel.com>
Reviewed-by: John Salinas <John.Salinas@intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: David Quigley <david.quigley@intel.com>
Closes #4447
Closes #4964
Closes #5074
This commit is contained in:
Sydney Vanda 2016-07-22 15:07:04 +00:00 committed by Brian Behlendorf
parent 178acea364
commit 7050a65d5c
64 changed files with 774 additions and 56 deletions

View File

@ -99,9 +99,11 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_LINUX], [
AC_PATH_TOOL(COMPRESS, gzip, "")
AC_PATH_TOOL(FORMAT, parted, "")
AC_PATH_TOOL(LOCKFS, lsof, "")
AC_PATH_TOOL(LSBLK, lsblk, "")
AC_PATH_TOOL(MODUNLOAD, rmmod, "")
AC_PATH_TOOL(NEWFS, mke2fs, "")
AC_PATH_TOOL(PFEXEC, sudo, "")
AC_PATH_TOOL(READLINK, readlink, "")
AC_PATH_TOOL(SHARE, exportfs, "")
AC_PATH_TOOL(SWAP, swapon, "")
AC_PATH_TOOL(SWAPADD, swapon, "")

View File

@ -52,6 +52,7 @@ export LOCKFS="@LOCKFS@"
export LOFIADM="@LOFIADM@"
export LOGNAME="@LOGNAME@"
export LS="@LS@"
export LSBLK="@LSBLK@"
export MD5SUM="@MD5SUM@"
export MKDIR="@MKDIR@"
export MKNOD="@MKNOD@"
@ -75,6 +76,7 @@ export PRTVTOC="@PRTVTOC@"
export PS="@PS@"
export PSRINFO="@PSRINFO@"
export PYTHON="@PYTHON@"
export READLINK="@READLINK@"
export REBOOT="@REBOOT@"
export RM="@RM@"
export RMDIR="@RMDIR@"

View File

@ -171,6 +171,8 @@ for i in $ZFS_ALL_VERSIONS; do
eval 'export ZFS_VERSION_$i="v${i}-fs"'
done
export MAX_PARTITIONS=8
if is_linux; then
unpack_opts="--sparse -xf"
pack_opts="--sparse -cf"
@ -180,8 +182,8 @@ if is_linux; then
ZVOL_DEVDIR="/dev/zvol"
ZVOL_RDEVDIR="/dev/zvol"
DEV_DSKDIR="/dev"
DEV_RDSKDIR="/dev"
DEV_MPATHDIR="/dev/mapper"
NEWFS_DEFAULT_FS="ext2"
else
@ -199,4 +201,4 @@ else
NEWFS_DEFAULT_FS="ufs"
fi
export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_DSKDIR DEV_RDSKDIR
ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_RDSKDIR DEV_MPATHDIR

View File

@ -456,6 +456,11 @@ function default_cleanup_noexit
[[ -d $TESTDIR ]] && \
log_must $RM -rf $TESTDIR
disk1=${DISKS%% *}
if is_mpath_device $disk1; then
delete_partitions
fi
}
@ -733,6 +738,69 @@ function set_partition #<slice_num> <slice_start> <size_plus_units> <whole_disk
return 0
}
#
# Delete all partitions on all disks - this is specifically for the use of multipath
# devices which currently can only be used in the test suite as raw/un-partitioned
# devices (ie a zpool cannot be created on a whole mpath device that has partitions)
#
function delete_partitions
{
typeset -i j=1
if [[ -z $DISK_ARRAY_NUM ]]; then
DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
fi
if [[ -z $DISKSARRAY ]]; then
DISKSARRAY=$DISKS
fi
if is_linux; then
if (( $DISK_ARRAY_NUM == 1 )); then
while ((j < MAX_PARTITIONS)); do
$FORMAT $DEV_DSKDIR/$DISK -s rm $j > /dev/null 2>&1
if (( $? == 1 )); then
$LSBLK | $EGREP ${DISK}${SLICE_PREFIX}${j} > /dev/null
if (( $? == 1 )); then
log_note "Partitions for $DISK should be deleted"
else
log_fail "Partition for ${DISK}${SLICE_PREFIX}${j} not deleted"
fi
return 0
else
$LSBLK | $EGREP ${DISK}${SLICE_PREFIX}${j} > /dev/null
if (( $? == 0 )); then
log_fail "Partition for ${DISK}${SLICE_PREFIX}${j} not deleted"
fi
fi
((j = j+1))
done
else
for disk in `$ECHO $DISKSARRAY`; do
while ((j < MAX_PARTITIONS)); do
$FORMAT $DEV_DSKDIR/$disk -s rm $j > /dev/null 2>&1
if (( $? == 1 )); then
$LSBLK | $EGREP ${disk}${SLICE_PREFIX}${j} > /dev/null
if (( $? == 1 )); then
log_note "Partitions for $disk should be deleted"
else
log_fail "Partition for ${disk}${SLICE_PREFIX}${j} not deleted"
fi
j=7
else
$LSBLK | $EGREP ${disk}${SLICE_PREFIX}${j} > /dev/null
if (( $? == 0 )); then
log_fail "Partition for ${disk}${SLICE_PREFIX}${j} not deleted"
fi
fi
((j = j+1))
done
j=1
done
fi
fi
return 0
}
#
# Get the end cyl of the given slice
#
@ -2482,6 +2550,113 @@ function is_physical_device #device
fi
}
#
# Check if the given device is a real device (ie SCSI device)
#
function is_real_device #disk
{
typeset disk=$1
[[ -z $disk ]] && log_fail "No argument for disk given."
if is_linux; then
$LSBLK $DEV_RDSKDIR/$disk -o TYPE | $EGREP disk > /dev/null 2>&1
return $?
fi
}
#
# Check if the given device is a loop device
#
function is_loop_device #disk
{
typeset disk=$1
[[ -z $disk ]] && log_fail "No argument for disk given."
if is_linux; then
$LSBLK $DEV_RDSKDIR/$disk -o TYPE | $EGREP loop > /dev/null 2>&1
return $?
fi
}
#
# Check if the given device is a multipath device and if there is a sybolic
# link to a device mapper and to a disk
# Currently no support for dm devices alone without multipath
#
function is_mpath_device #disk
{
typeset disk=$1
[[ -z $disk ]] && log_fail "No argument for disk given."
if is_linux; then
$LSBLK $DEV_MPATHDIR/$disk -o TYPE | $EGREP mpath > /dev/null 2>&1
if (($? == 0)); then
$READLINK $DEV_MPATHDIR/$disk > /dev/null 2>&1
return $?
else
return $?
fi
fi
}
# Set the slice prefix for disk partitioning depending
# on whether the device is a real, multipath, or loop device.
# Currently all disks have to be of the same type, so only
# checks first disk to determine slice prefix.
#
function set_slice_prefix
{
typeset disk
typeset -i i=0
if is_linux; then
while (( i < $DISK_ARRAY_NUM )); do
disk="$($ECHO $DISKS | $NAWK '{print $(i + 1)}')"
if ( is_mpath_device $disk ) && [[ -z $($ECHO $disk | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $disk ); then
export SLICE_PREFIX=""
return 0
elif ( is_mpath_device $disk || is_loop_device $disk ); then
export SLICE_PREFIX="p"
return 0
else
log_fail "$disk not supported for partitioning."
fi
(( i = i + 1))
done
fi
}
#
# Set the directory path of the listed devices in $DISK_ARRAY_NUM
# Currently all disks have to be of the same type, so only
# checks first disk to determine device directory
# default = /dev (linux)
# real disk = /dev (linux)
# multipath device = /dev/mapper (linux)
#
function set_device_dir
{
typeset disk
typeset -i i=0
if is_linux; then
while (( i < $DISK_ARRAY_NUM )); do
disk="$($ECHO $DISKS | $NAWK '{print $(i + 1)}')"
if is_mpath_device $disk; then
export DEV_DSKDIR=$DEV_MPATHDIR
return 0
else
export DEV_DSKDIR=$DEV_RDSKDIR
return 0
fi
(( i = i + 1))
done
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
}
#
# Get the directory path of given device
#

View File

@ -30,12 +30,12 @@
. $STF_SUITE/include/libtest.shlib
export DISK_ARRAY_NUM=0
function set_disks
{
set -A disk_array $(find_disks $DISKS)
typeset -i DISK_ARRAY_NUM=0
if (( ${#disk_array[*]} <= 1 )); then
export DISK=${DISKS%% *}
else
@ -58,6 +58,7 @@ function set_disks
}
set_disks
set_device_dir
export SIZE=64M

View File

@ -34,7 +34,7 @@
verify_runnable "global"
if ! $(is_physical_device $LDEV) ; then
if ! is_physical_device $LDEV; then
log_unsupported "Only physical disk could be cache device"
fi

View File

@ -38,6 +38,12 @@ $DF -F zfs -h | $GREP "$TESTFS " >/dev/null
[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
destroy_pool $TESTPOOL
if is_mpath_device $MIRROR_PRIMARY; then
$FORMAT $DEV_DSKDIR/$MIRROR_PRIMARY -s rm 1
fi
if is_mpath_device $MIRROR_SECONDARY; then
$FORMAT $DEV_DSKDIR/$MIRROR_SECONDARY -s rm 1
fi
# recreate and destroy a zpool over the disks to restore the partitions to
# normal
if [[ -n $SINGLE_DISK ]]; then

View File

@ -44,9 +44,23 @@ if [[ -z $MIRROR_SECONDARY ]]; then
SIDE_SECONDARY_PART=1
if is_linux; then
SIDE_PRIMARY=${SINGLE_DISK}p1
SIDE_SECONDARY=${SINGLE_DISK}p2
if is_mpath_device $SINGLE_DISK; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $SINGLE_DISK ) && [[ -z $($ECHO $SINGLE_DISK | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $SINGLE_DISK ); then
SIDE_PRIMARY=${SINGLE_DISK}1
SIDE_SECONDARY=${SINGLE_DISK}2
elif ( is_mpath_device $SINGLE_DISK || is_loop_device $SINGLE_DISK ); then
SIDE_PRIMARY=${SINGLE_DISK}p1
SIDE_SECONDARY=${SINGLE_DISK}p2
else
log_fail "$SINGLE_DISK not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
SIDE_PRIMARY=${SINGLE_DISK}s${SIDE_PRIMARY_PART}
SIDE_SECONDARY=${SINGLE_DISK}s${SIDE_SECONDARY_PART}
fi
@ -54,9 +68,30 @@ else
SIDE_PRIMARY_PART=0
SIDE_SECONDARY_PART=0
if is_linux; then
SIDE_PRIMARY=${MIRROR_PRIMARY}p1
SIDE_SECONDARY=${MIRROR_SECONDARY}p1
if is_mpath_device $MIRROR_PRIMARY; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $MIRROR_PRIMARY ) && [[ -z $($ECHO $MIRROR_PRIMARY | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_PRIMARY ); then
SIDE_PRIMARY=${MIRROR_PRIMARY}1
elif ( is_mpath_device $MIRROR_PRIMARY || is_loop_device $MIRROR_PRIMARY ); then
SIDE_PRIMARY=${MIRROR_PRIMARY}p1
else
log_fail "$MIRROR_PRIMARY not supported for partitioning."
fi
if ( is_mpath_device $MIRROR_SECONDARY ) && [[ -z $($ECHO $MIRROR_SECONDARY | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_SECONDARY ); then
SIDE_SECONDARY=${MIRROR_SECONDARY}1
elif ( is_mpath_device $MIRROR_SECONDARY || is_loop_device $MIRROR_SECONDARY ); then
SIDE_SECONDARY=${MIRROR_SECONDARY}p1
else
log_fail "$MIRROR_SECONDARY not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
SIDE_PRIMARY=${MIRROR_PRIMARY}s${SIDE_PRIMARY_PART}
SIDE_SECONDARY=${MIRROR_SECONDARY}s${SIDE_SECONDARY_PART}
fi

View File

@ -34,7 +34,7 @@
verify_runnable "global"
if ! $(is_physical_device $DISKS) ; then
if ! is_physical_device $DISKS; then
log_unsupported "This directory cannot be run on raw files."
fi

View File

@ -32,6 +32,11 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_add/zpool_add.kshlib
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
delete_partitions
fi
cleanup_devices $DISKS
log_pass

View File

@ -38,6 +38,11 @@ if ! $(is_physical_device $DISKS) ; then
log_unsupported "This directory cannot be run on raw files."
fi
disk1=${DISKS%% *}
if is_mpath_device $disk1; then
delete_partitions
fi
if [[ -n $DISK ]]; then
#
# Use 'zpool create' to clean up the infomation in

View File

@ -72,7 +72,8 @@ export SIZE="150m"
export SIZE1="250m"
if is_linux; then
export SLICE_PREFIX="p"
set_device_dir
set_slice_prefix
export SLICE0=1
export SLICE1=2
export SLICE3=4
@ -80,6 +81,7 @@ if is_linux; then
export SLICE5=6
export SLICE6=7
else
export DEV_DSKDIR="/dev"
export SLICE_PREFIX="s"
export SLICE0=0
export SLICE1=1

View File

@ -32,6 +32,13 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
[[ -z $FORMAT ]] || \
[[ -z $MKDIR ]] || \
[[ -z $LSBLK ]] || \
[[ -z $READLINK ]] || \
[[ -z $TOUCH ]] && \
log_fail "Missing required commands"
verify_runnable "global"
if ! $(is_physical_device $DISKS) ; then

View File

@ -41,6 +41,7 @@ function set_disks
if (( ${#disk_array[*]} <= 1 )); then
export DISK=${DISKS%% *}
export DISK_ARRAY_NUM=1
else
export DISK=""
typeset -i i=0
@ -63,7 +64,8 @@ export SIZE="200m"
export SIZE1="250m"
if is_linux; then
export SLICE_PREFIX="p"
set_device_dir
set_slice_prefix
export SLICE0=1
export SLICE1=2
export SLICE2=3
@ -72,6 +74,10 @@ if is_linux; then
export SLICE5=6
export SLICE6=7
export SLICE7=8
disk1=${DISKS%% *}
if is_mpath_device $disk1; then
delete_partitions
fi
else
export SLICE_PREFIX="s"
export SLICE0=0

View File

@ -51,7 +51,7 @@ function cleanup
tmpfile="/var/tmp/zpool_create_003.tmp$$"
log_assert "'zpool create -n <pool> <vspec> ...' can display the configureation" \
log_assert "'zpool create -n <pool> <vspec> ...' can display the configuration" \
"without actually creating the pool."
log_onexit cleanup
@ -62,6 +62,11 @@ else
disk=$DISK0
fi
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
partition_disk $SIZE $disk 1
fi
#
# Make sure disk is clean before we use it
#

View File

@ -26,6 +26,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
#
# DESCRIPTION:

View File

@ -31,6 +31,7 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
#
# DESCRIPTION:

View File

@ -31,6 +31,7 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
#
# DESCRIPTION:

View File

@ -25,6 +25,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
################################################################################
#

View File

@ -25,6 +25,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
################################################################################
#

View File

@ -25,6 +25,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
################################################################################
#

View File

@ -25,6 +25,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
################################################################################
#

View File

@ -31,7 +31,8 @@
export DISK=${DISKS%% *}
if is_linux; then
export SLICE_PREFIX="p"
set_device_dir
set_slice_prefix
export SLICE0=1
export SLICE1=2
else

View File

@ -2,6 +2,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_expo
dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
zpool_export.cfg \
zpool_export_001_pos.ksh \
zpool_export_002_pos.ksh \
zpool_export_003_neg.ksh \

View File

@ -26,6 +26,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.cfg
DISK=${DISKS%% *}

View File

@ -0,0 +1,59 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2012, 2014 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
export DISK_ARRAY_NUM=0
export DISK_ARRAY_LIMIT=4
export DISKSARRAY=""
export VDEVS_NUM=32
function set_disks
{
typeset -a disk_array=($(find_disks $DISKS))
if (( ${#disk_array[*]} <= 1 )); then
export DISK=${DISKS%% *}
else
export DISK=""
typeset -i i=0
while (( i < ${#disk_array[*]} )); do
export DISK${i}="${disk_array[$i]}"
DISKSARRAY="$DISKSARRAY ${disk_array[$i]}"
(( i = i + 1 ))
(( i>$DISK_ARRAY_LIMIT )) && break
done
export DISK_ARRAY_NUM=$i
export DISKSARRAY
fi
}
set_disks
set_device_dir

View File

@ -25,6 +25,7 @@
# Use is subject to license terms.
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_export/zpool_export.cfg
#
# DESCRIPTION:

View File

@ -48,6 +48,10 @@ for dir in "$TESTDIR" "$TESTDIR1" "$DEVICE_DIR" ; do
log_must $RM -rf $dir
done
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
delete_partitions
fi
# recreate and destroy a zpool over the disks to restore the partitions to
# normal
case $DISK_COUNT in

View File

@ -68,15 +68,27 @@ fi
log_must $ZFS create $TESTPOOL/$TESTFS
log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
log_must set_partition 0 "" $FS_SIZE $ZFS_DISK2
$ECHO "y" | $NEWFS -v $DEV_RDSKDIR/$ZFSSIDE_DISK2 >/dev/null 2>&1
(( $? != 0 )) &&
log_untested "Unable to setup a $NEWFS_DEFAULT_FS file system"
DISK2="$($ECHO $DISKS | $NAWK '{print $2}')"
if is_mpath_device $DISK2; then
$ECHO "y" | $NEWFS -v $DEV_DSKDIR/$DISK2 >/dev/null 2>&1
(( $? != 0 )) &&
log_untested "Unable to setup a $NEWFS_DEFAULT_FS file system"
[[ ! -d $DEVICE_DIR ]] && \
log_must $MKDIR -p $DEVICE_DIR
[[ ! -d $DEVICE_DIR ]] && \
log_must $MKDIR -p $DEVICE_DIR
log_must $MOUNT $DEV_DSKDIR/$ZFSSIDE_DISK2 $DEVICE_DIR
log_must $MOUNT $DEV_DSKDIR/$DISK2 $DEVICE_DIR
else
log_must set_partition 0 "" $FS_SIZE $ZFS_DISK2
$ECHO "y" | $NEWFS -v $DEV_DSKDIR/$ZFSSIDE_DISK2 >/dev/null 2>&1
(( $? != 0 )) &&
log_untested "Unable to setup a $NEWFS_DEFAULT_FS file system"
[[ ! -d $DEVICE_DIR ]] && \
log_must $MKDIR -p $DEVICE_DIR
log_must $MOUNT $DEV_DSKDIR/$ZFSSIDE_DISK2 $DEVICE_DIR
fi
i=0
while (( i < $MAX_NUM )); do

View File

@ -30,6 +30,8 @@
. $STF_SUITE/include/libtest.shlib
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
typeset -a disk_array=($(find_disks $DISKS))
case "${#disk_array[*]}" in
0)
@ -43,10 +45,24 @@ case "${#disk_array[*]}" in
if is_linux; then
DISK_COUNT=1
ZFS_DISK1=${disk_array[0]}
ZFSSIDE_DISK1=${ZFS_DISK1}p1
ZFS_DISK2=${disk_array[0]}
ZFSSIDE_DISK2=${ZFS_DISK2}p2
if is_mpath_device $ZFS_DISK1; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $($ECHO $ZFS_DISK1 | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK1 ); then
ZFSSIDE_DISK1=${ZFS_DISK1}1
ZFSSIDE_DISK2=${ZFS_DISK2}2
elif ( is_mpath_device $ZFS_DISK1 || is_loop_device $ZFS_DISK1 ); then
ZFSSIDE_DISK1=${ZFS_DISK1}p1
ZFSSIDE_DISK2=${ZFS_DISK2}p2
else
log_fail "$ZFS_DISK1 not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
DISK_COUNT=1
ZFS_DISK1=${disk_array[0]}
ZFSSIDE_DISK1=${ZFS_DISK1}s0
@ -59,10 +75,30 @@ case "${#disk_array[*]}" in
if is_linux; then
DISK_COUNT=2
ZFS_DISK1=${disk_array[0]}
ZFSSIDE_DISK1=${ZFS_DISK1}p1
if is_mpath_device $ZFS_DISK1; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $($ECHO $ZFS_DISK1 | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK1 ); then
ZFSSIDE_DISK1=${ZFS_DISK1}1
elif ( is_mpath_device $ZFS_DISK1 || is_loop_device $ZFS_DISK1 ); then
ZFSSIDE_DISK1=${ZFS_DISK1}p1
else
log_fail "$ZFS_DISK1 not supported for partitioning."
fi
ZFS_DISK2=${disk_array[1]}
ZFSSIDE_DISK2=${ZFS_DISK2}p1
if ( is_mpath_device $ZFS_DISK2 ) && [[ -z $($ECHO $ZFS_DISK2 | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK2 ); then
ZFSSIDE_DISK2=${ZFS_DISK2}1
elif ( is_mpath_device $ZFS_DISK2 || is_loop_device $ZFS_DISK2 ); then
ZFSSIDE_DISK2=${ZFS_DISK2}p1
else
log_fail "$ZFS_DISK2 not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
DISK_COUNT=2
ZFS_DISK1=${disk_array[0]}
ZFSSIDE_DISK1=${ZFS_DISK1}s0

View File

@ -26,6 +26,12 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zpool_remove/zpool_remove.cfg
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
delete_partitions
fi
cleanup_devices $DISKS

View File

@ -30,9 +30,12 @@
export DISK=${DISKS%% *}
export SIZE="200m"
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
export DISKSARRAY=$DISKS
if is_linux; then
export SLICE_PREFIX="p"
set_device_dir
set_slice_prefix
export SLICE0=1
export SLICE1=2
export SLICE2=3

View File

@ -28,5 +28,5 @@
# Copyright (c) 2012 by Delphix. All rights reserved.
#
export DISK1=$($ECHO $DISKS | $AWK '{print $1}')
export DISK1=${DISKS%% *}
export DISK2=$($ECHO $DISKS | $AWK '{print $2}')

View File

@ -60,7 +60,8 @@ export TESTFILE1=file$$.1
export WRITE_COUNT=65536000
if is_linux; then
export SLICE_PREFIX="p"
set_device_dir
set_slice_prefix
export SLICE=1
export SLICE0=1
export SLICE1=2

View File

@ -61,7 +61,8 @@ export WRITE_COUNT=65536000
if is_linux; then
export SLICES="0 1 2 3 4"
export SLICE_PREFIX="p"
set_device_dir
set_slice_prefix
export SLICE0=1
export SLICE1=2
export SLICE2=3

View File

@ -31,7 +31,8 @@
. $STF_SUITE/include/libtest.shlib
if is_linux; then
export SLICE_PREFIX="p"
set_device_dir
set_slice_prefix
export SLICE0=1
export SLICE1=2
else

View File

@ -41,6 +41,11 @@ ismounted $TESTPOOL/$TESTFS
[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
destroy_pool $TESTPOOL
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
delete_partitions
fi
# recreate and destroy a zpool over the disks to restore the partitions to
# normal
case $DISK_COUNT in

View File

@ -30,6 +30,8 @@
. $STF_SUITE/include/libtest.shlib
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
set -A disk_array $(find_disks $DISKS)
case "${#disk_array[*]}" in
0)
@ -42,9 +44,23 @@ case "${#disk_array[*]}" in
SINGLE_DISK=$ZFS_DISK
NONZFS_DISK=$ZFS_DISK
if is_linux; then
ZFSSIDE_DISK=${SINGLE_DISK}p1
NONZFSSIDE_DISK=${SINGLE_DISK}p2
if is_mpath_device $ZFS_DISK; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $ZFS_DISK ) && [[ -z $($ECHO $ZFS_DISK | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK ); then
ZFSSIDE_DISK=${SINGLE_DISK}1
NONZFSSIDE_DISK=${SINGLE_DISK}2
elif ( is_mpath_device $ZFS_DISK || is_loop_device $ZFS_DISK ); then
ZFSSIDE_DISK=${SINGLE_DISK}p1
NONZFSSIDE_DISK=${SINGLE_DISK}p2
else
log_fail "$ZFS_DISK not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
ZFSSIDE_DISK=${SINGLE_DISK}s0
NONZFSSIDE_DISK=${SINGLE_DISK}s1
fi
@ -55,9 +71,29 @@ case "${#disk_array[*]}" in
ZFS_DISK=${disk_array[0]}
NONZFS_DISK=${disk_array[1]}
if is_linux; then
ZFSSIDE_DISK=${ZFS_DISK}p1
NONZFSSIDE_DISK=${NONZFS_DISK}p1
if is_mpath_device $ZFS_DISK; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $ZFS_DISK ) && [[ -z $($ECHO $ZFS_DISK | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK ); then
ZFSSIDE_DISK=${ZFS_DISK}1
elif ( is_mpath_device $ZFS_DISK || is_loop_device $ZFS_DISK ); then
ZFSSIDE_DISK=${ZFS_DISK}p1
else
log_fail "$ZFS_DISK not supported for partitioning."
fi
if ( is_mpath_device $NONZFS_DISK ) && [[ -z $($ECHO $NONZFS_DISK | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $NONZFS_DISK ); then
NONZFSSIDE_DISK=${NONZFS_DISK}1
elif ( is_mpath_device $NONZFS_DISK || is_loop_device $NONZFS_DISK ); then
NONZFSSIDE_DISK=${NONZFS_DISK}p1
else
log_fail "$NONZFS_DISK not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
ZFSSIDE_DISK=${ZFS_DISK}s0
NONZFSSIDE_DISK=${NONZFS_DISK}s0
fi

View File

@ -64,7 +64,7 @@ log_must $ZFS set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
$RM -rf $NONZFS_TESTDIR || log_unresolved Could not remove $NONZFS_TESTDIR
$MKDIR -p $NONZFS_TESTDIR || log_unresolved Could not create $NONZFS_TESTDIR
$ECHO "y" | $NEWFS -v ${DEV_RDSKDIR}/$NONZFSSIDE_DISK
$ECHO "y" | $NEWFS -v ${DEV_DSKDIR}/$NONZFSSIDE_DISK
(( $? != 0 )) &&
log_untested "Unable to setup a UFS file system"

View File

@ -2,5 +2,6 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/mmap
dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
mmap.cfg \
mmap_read_001_pos.ksh \
mmap_write_001_pos.ksh

View File

@ -0,0 +1,59 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2012, 2014 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
export DISK_ARRAY_NUM=0
export DISK_ARRAY_LIMIT=4
export DISKSARRAY=""
export VDEVS_NUM=32
function set_disks
{
typeset -a disk_array=($(find_disks $DISKS))
if (( ${#disk_array[*]} <= 1 )); then
export DISK=${DISKS%% *}
else
export DISK=""
typeset -i i=0
while (( i < ${#disk_array[*]} )); do
export DISK${i}="${disk_array[$i]}"
DISKSARRAY="$DISKSARRAY ${disk_array[$i]}"
(( i = i + 1 ))
(( i>$DISK_ARRAY_LIMIT )) && break
done
export DISK_ARRAY_NUM=$i
export DISKSARRAY
fi
}
set_disks
set_device_dir

View File

@ -30,6 +30,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/mmap/mmap.cfg
#
# DESCRIPTION:

View File

@ -29,6 +29,9 @@
#
export DISK=${DISKS%% *}
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
set_device_dir
export TESTFILE=testfile

View File

@ -40,6 +40,11 @@ ismounted "$TESTPOOL/$TESTFS"
log_must $ZFS umount $TESTDIR
destroy_pool $TESTPOOL
if is_mpath_device $DISK; then
delete_partitions
fi
#
# Remove 100mb partition.
#

View File

@ -36,3 +36,7 @@ export ENOSPC=28
export BLOCKSZ=8192
export NUM_WRITES=65536
export DATA=0
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
set_device_dir

View File

@ -43,7 +43,14 @@ DISK=${DISKS%% *}
log_must set_partition 0 "" $SIZE $DISK
if is_linux; then
default_setup $DISK"p1"
if ( is_mpath_device $DISK ) && [[ -z $($ECHO $DISK | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $DISK ); then
default_setup $DISK"1"
elif ( is_mpath_device $DISK || is_loop_device $DISK ); then
default_setup $DISK"p1"
else
log_fail "$DISK not supported for partitioning."
fi
else
default_setup $DISK"s0"
fi

View File

@ -36,3 +36,7 @@ export HOLES_SEED=${HOLES_SEED-""}
export HOLES_FILEOFFSET=${HOLES_FILEOFFSET-""}
export HOLES_COUNT=${HOLES_COUNT-"16384"} # FILESIZE/BLKSIZE/8
export STF_TIMEOUT=3600
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
set_device_dir

View File

@ -29,7 +29,7 @@
export BACKDIR=${TEST_BASE_DIR%%/}/backdir-rsend
export DISK1=$($ECHO $DISKS | $AWK '{print $1}')
export DISK1=${DISKS%% *}
export DISK2=$($ECHO $DISKS | $AWK '{print $2}')
export POOL=$TESTPOOL

View File

@ -39,6 +39,11 @@ $DF -F zfs -h | $GREP "$TESTFS " >/dev/null
[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
destroy_pool $TESTPOOL
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
delete_partitions
fi
# recreate and destroy a zpool over the disks to restore the partitions to
# normal
if [[ -n $SINGLE_DISK ]]; then

View File

@ -28,6 +28,9 @@
# Copyright (c) 2013 by Delphix. All rights reserved.
#
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
typeset -i NUMBER_OF_DISKS=0
for i in $DISKS; do
[[ -n $MIRROR_PRIMARY ]] && MIRROR_SECONDARY=$i
@ -41,9 +44,23 @@ if [[ -z $MIRROR_SECONDARY ]]; then
SIDE_PRIMARY_PART=0
SIDE_SECONDARY_PART=1
if is_linux; then
SIDE_PRIMARY=${SINGLE_DISK}p1
SIDE_SECONDARY=${SINGLE_DISK}p2
if is_mpath_device $MIRROR_PRIMARY; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $SINGLE_DISK ) && [[ -z $($ECHO $SINGLE_DISK | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $SINGLE_DISK ); then
SIDE_PRIMARY=${SINGLE_DISK}1
SIDE_SECONDARY=${SINGLE_DISK}2
elif ( is_mpath_device $SINGLE_DISK || is_loop_device $SINGLE_DISK ); then
SIDE_PRIMARY=${SINGLE_DISK}p1
SIDE_SECONDARY=${SINGLE_DISK}p2
else
log_fail "$SINGLE_DISK not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
SIDE_PRIMARY=${SINGLE_DISK}s${SIDE_PRIMARY_PART}
SIDE_SECONDARY=${SINGLE_DISK}s${SIDE_SECONDARY_PART}
fi
@ -51,9 +68,29 @@ else
SIDE_PRIMARY_PART=0
SIDE_SECONDARY_PART=0
if is_linux; then
SIDE_PRIMARY=${MIRROR_PRIMARY}p1
SIDE_SECONDARY=${MIRROR_SECONDARY}p1
if is_mpath_device $MIRROR_PRIMARY; then
export DEV_DSKDIR=$DEV_MPATHDIR
else
export DEV_DSKDIR=$DEV_RDSKDIR
fi
if ( is_mpath_device $MIRROR_PRIMARY ) && [[ -z $($ECHO $MIRROR_PRIMARY | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_PRIMARY ); then
SIDE_PRIMARY=${MIRROR_PRIMARY}1
elif ( is_mpath_device $MIRROR_PRIMARY || is_loop_device $MIRROR_PRIMARY ); then
SIDE_PRIMARY=${MIRROR_PRIMARY}p1
else
log_fail "$MIRROR_PRIMARY not supported for partitioning."
fi
if ( is_mpath_device $MIRROR_SECONDARY ) && [[ -z $($ECHO $MIRROR_SECONDARY | awk 'substr($1,18,1)\
~ /^[[:digit:]]+$/') ]] || ( is_real_device $MIRROR_SECONDARY ); then
SIDE_SECONDARY=${MIRROR_SECONDARY}1
elif ( is_mpath_device $MIRROR_SECONDARY || is_loop_device $MIRROR_SECONDARY ); then
SIDE_SECONDARY=${MIRROR_SECONDARY}p1
else
log_fail "$MIRROR_SECONDARY not supported for partitioning."
fi
else
export DEV_DSKDIR="/dev"
SIDE_PRIMARY=${MIRROR_PRIMARY}s${SIDE_PRIMARY_PART}
SIDE_SECONDARY=${MIRROR_SECONDARY}s${SIDE_SECONDARY_PART}
fi

View File

@ -28,6 +28,8 @@
# Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
export TESTFILE=testfile.sparse
export HOLES_FILESIZE=${HOLES_FILESIZE-"67108864"} # 64 Mb
export HOLES_BLKSIZE=${HOLES_BLKSIZE-"512"}
@ -35,3 +37,7 @@ export HOLES_SEED=${HOLES_SEED-""}
export HOLES_FILEOFFSET=${HOLES_FILEOFFSET-""}
export HOLES_COUNT=${HOLES_COUNT-"16384"} # FILESIZE/BLKSIZE/8
export STF_TIMEOUT=3600
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
set_device_dir

View File

@ -24,9 +24,16 @@
# Use is subject to license terms.
#
. $STF_SUITE/include/libtest.shlib
export TESTFILE=testfile.$$
export TRUNC_FILESIZE=${TRUNC_FILESIZE-"67108864"} # 64 Mb
export TRUNC_BLKSIZE=${TRUNC_BLKSIZE-"512"}
export TRUNC_SEED=${TRUNC_SEED-""}
export TRUNC_FILEOFFSET=${TRUNC_FILEOFFSET-""}
export TRUNC_COUNT=${TRUNC_COUNT-"16384"} # FILESIZE/BLKSIZE/8
export DISKSARRAY=$DISKS
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
set_device_dir

View File

@ -2,5 +2,6 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/write_dirs
dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
write_dirs.cfg \
write_dirs_001_pos.ksh \
write_dirs_002_pos.ksh

View File

@ -30,5 +30,6 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/write_dirs/write_dirs.cfg
default_cleanup

View File

@ -30,28 +30,18 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/write_dirs/write_dirs.cfg
verify_runnable "global"
export SIZE="1gb"
if is_linux; then
export SLICE_PREFIX="p"
export SLICE=0
else
export SLICE_PREFIX="s"
export SLICE=0
fi
if ! $(is_physical_device $DISKS) ; then
log_unsupported "This directory cannot be run on raw files."
fi
DISK=${DISKS%% *}
log_must set_partition $SLICE "" $SIZE $DISK
if is_linux; then
export SLICE=1
if is_mpath_device $DISK; then
delete_partitions
fi
log_must set_partition 0 "" $SIZE $DISK
default_setup "${DISK}${SLICE_PREFIX}${SLICE}"

View File

@ -0,0 +1,48 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
export SIZE="1gb"
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
export DISKSARRAY=$DISKS
if is_linux; then
set_slice_prefix
set_device_dir
export SLICE=1
else
DEV_DSKDIR="/dev"
export SLICE_PREFIX="s"
export SLICE=0
fi

View File

@ -30,6 +30,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/write_dirs/write_dirs.cfg
#
# DESCRIPTION:

View File

@ -30,6 +30,7 @@
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/write_dirs/write_dirs.cfg
#
# DESCRIPTION:

View File

@ -2,4 +2,5 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/zvol/zvol_ENOSPC
dist_pkgdata_SCRIPTS = \
cleanup.ksh \
setup.ksh \
zvol_ENOSPC.cfg \
zvol_ENOSPC_001_pos.ksh

View File

@ -31,9 +31,15 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/zvol/zvol_common.shlib
. $STF_SUITE/tests/functional/zvol/zvol_ENOSPC/zvol_ENOSPC.cfg
verify_runnable "global"
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
delete_partitions
fi
default_zvol_setup $DISK $VOLSIZE
$ECHO "y" | $NEWFS -v ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL >/dev/null 2>&1

View File

@ -0,0 +1,49 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
#export SIZE="1gb"
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
export DISKSARRAY=$DISKS
if is_linux; then
set_slice_prefix
set_device_dir
# export SLICE=1
else
DEV_DSKDIR="/dev"
export SLICE_PREFIX="s"
# export SLICE=0
fi

View File

@ -2,6 +2,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/zvol/zvol_cli
dist_pkgdata_SCRIPTS = \
cleanup.ksh \
setup.ksh \
zvol_cli.cfg \
zvol_cli_001_pos.ksh \
zvol_cli_002_pos.ksh \
zvol_cli_003_neg.ksh

View File

@ -31,9 +31,15 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/zvol/zvol_common.shlib
. $STF_SUITE/tests/functional/zvol/zvol_cli/zvol_cli.cfg
verify_runnable "global"
DISK=${DISKS%% *}
if is_mpath_device $DISK; then
delete_partitions
fi
default_zvol_setup $DISK $VOLSIZE
log_pass

View File

@ -0,0 +1,46 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
export DISKSARRAY=$DISKS
if is_linux; then
set_slice_prefix
set_device_dir
else
DEV_DSKDIR="/dev"
export SLICE_PREFIX="s"
fi