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 2008 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/cachefile/cachefile.cfg . $STF_SUITE/tests/functional/cachefile/cachefile.kshlib --- 24,34 ---- # Copyright 2008 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/cachefile/cachefile.cfg . $STF_SUITE/tests/functional/cachefile/cachefile.kshlib
*** 54,70 **** destroy_pool $TESTPOOL fi for file in $CPATH1 $CPATH2 ; do if [[ -f $file ]] ; then ! log_must $RM $file fi done if [ -d $TESTDIR ] then ! $RMDIR $TESTDIR fi } verify_runnable "global" --- 54,70 ---- destroy_pool $TESTPOOL fi for file in $CPATH1 $CPATH2 ; do if [[ -f $file ]] ; then ! log_must rm $file fi done if [ -d $TESTDIR ] then ! rmdir $TESTDIR fi } verify_runnable "global"
*** 78,88 **** "$CPATH1" "$CPATH1" \ "$CPATH2" "$CPATH2" while (( i < ${#opts[*]} )); do ! log_must $ZPOOL create -o altroot=$TESTDIR -o cachefile=${opts[i]} \ $TESTPOOL $DISKS if [[ ${opts[i]} != none ]]; then log_must pool_in_cache $TESTPOOL ${opts[i]} else log_mustnot pool_in_cache $TESTPOOL --- 78,88 ---- "$CPATH1" "$CPATH1" \ "$CPATH2" "$CPATH2" while (( i < ${#opts[*]} )); do ! log_must zpool create -o altroot=$TESTDIR -o cachefile=${opts[i]} \ $TESTPOOL $DISKS if [[ ${opts[i]} != none ]]; then log_must pool_in_cache $TESTPOOL ${opts[i]} else log_mustnot pool_in_cache $TESTPOOL
*** 91,100 **** PROP=$(get_pool_prop cachefile $TESTPOOL) if [[ $PROP != ${opts[((i+1))]} ]]; then log_fail "cachefile property not set as expected. " \ "Expect: ${opts[((i+1))]}, Current: $PROP" fi ! log_must $ZPOOL destroy $TESTPOOL (( i = i + 2 )) done log_pass "Setting altroot=path and cachefile=$CPATH for zpool create succeed." --- 91,100 ---- PROP=$(get_pool_prop cachefile $TESTPOOL) if [[ $PROP != ${opts[((i+1))]} ]]; then log_fail "cachefile property not set as expected. " \ "Expect: ${opts[((i+1))]}, Current: $PROP" fi ! log_must zpool destroy $TESTPOOL (( i = i + 2 )) done log_pass "Setting altroot=path and cachefile=$CPATH for zpool create succeed."