Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

*** 24,34 **** # 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 . $STF_SUITE/tests/functional/inuse/inuse.cfg --- 24,34 ---- # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ! # Copyright (c) 2013, 2016 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/inuse/inuse.cfg
*** 46,59 **** verify_runnable "global" function cleanup { if [[ -n $PREVDUMPDEV ]]; then ! log_must $DUMPADM -u -d $PREVDUMPDEV fi ! poolexists $TESTPOOL1 || $ZPOOL import $TESTPOOL1 >/dev/null 2>&1 poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 # # Tidy up the disks we used. --- 46,59 ---- verify_runnable "global" function cleanup { if [[ -n $PREVDUMPDEV ]]; then ! log_must dumpadm -u -d $PREVDUMPDEV fi ! poolexists $TESTPOOL1 || zpool import $TESTPOOL1 >/dev/null 2>&1 poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 # # Tidy up the disks we used.
*** 64,76 **** function verify_assertion #slices { typeset targets=$1 for t in $targets; do ! log_must $DUMPADM -u -d $t ! log_must $DUMPADM -u -d $PREVDUMPDEV done return 0 } --- 64,76 ---- function verify_assertion #slices { typeset targets=$1 for t in $targets; do ! log_must dumpadm -u -d $t ! log_must dumpadm -u -d $PREVDUMPDEV done return 0 }
*** 80,90 **** set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2" typeset -i i=0 ! PREVDUMPDEV=`$DUMPADM | $GREP "Dump device" | $AWK '{print $3}'` while (( i < ${#vdevs[*]} )); do for num in 0 1 2 3 ; do eval typeset slice=\${FS_SIDE$num} --- 80,90 ---- set -A vdevs "" "mirror" "raidz" "raidz1" "raidz2" typeset -i i=0 ! PREVDUMPDEV=`dumpadm | grep "Dump device" | awk '{print $3}'` while (( i < ${#vdevs[*]} )); do for num in 0 1 2 3 ; do eval typeset slice=\${FS_SIDE$num}
*** 97,109 **** (( i = i + 1 )) continue fi create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices ! log_must $ZPOOL export $TESTPOOL1 verify_assertion "$disktargets" ! log_must $ZPOOL import $TESTPOOL1 destroy_pool $TESTPOOL1 if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then (( i = i + 1 )) continue --- 97,109 ---- (( i = i + 1 )) continue fi create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices ! log_must zpool export $TESTPOOL1 verify_assertion "$disktargets" ! log_must zpool import $TESTPOOL1 destroy_pool $TESTPOOL1 if [[ ( $FS_DISK0 == $FS_DISK2 ) && -n ${vdevs[i]} ]]; then (( i = i + 1 )) continue
*** 113,125 **** (( i = i + 1 )) continue fi create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks ! log_must $ZPOOL export $TESTPOOL1 verify_assertion "$disktargets" ! log_must $ZPOOL import $TESTPOOL1 destroy_pool $TESTPOOL1 (( i = i + 1 )) done --- 113,125 ---- (( i = i + 1 )) continue fi create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks ! log_must zpool export $TESTPOOL1 verify_assertion "$disktargets" ! log_must zpool import $TESTPOOL1 destroy_pool $TESTPOOL1 (( i = i + 1 )) done