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,64 ****
if poolexists $TESTPOOL ; then
destroy_pool $TESTPOOL
fi
for file in $CPATH1 $CPATH2 ; do
if [[ -f $file ]] ; then
! log_must $RM $file
fi
done
}
verify_runnable "global"
--- 54,64 ----
if poolexists $TESTPOOL ; then
destroy_pool $TESTPOOL
fi
for file in $CPATH1 $CPATH2 ; do
if [[ -f $file ]] ; then
! log_must rm $file
fi
done
}
verify_runnable "global"
*** 72,82 ****
"$CPATH2" "true" "$CPATH2"
typeset -i i=0
while (( i < ${#opts[*]} )); do
! log_must $ZPOOL create -o cachefile=${opts[i]} $TESTPOOL $DISKS
case ${opts[((i+1))]} in
false) log_mustnot pool_in_cache $TESTPOOL
;;
true) log_must pool_in_cache $TESTPOOL ${opts[i]}
;;
--- 72,82 ----
"$CPATH2" "true" "$CPATH2"
typeset -i i=0
while (( i < ${#opts[*]} )); do
! log_must zpool create -o cachefile=${opts[i]} $TESTPOOL $DISKS
case ${opts[((i+1))]} in
false) log_mustnot pool_in_cache $TESTPOOL
;;
true) log_must pool_in_cache $TESTPOOL ${opts[i]}
;;
*** 85,94 ****
PROP=$(get_pool_prop cachefile $TESTPOOL)
if [[ $PROP != ${opts[((i+2))]} ]]; then
log_fail "cachefile property not set as expected. " \
"Expect: ${opts[((i+2))]}, Current: $PROP"
fi
! log_must $ZPOOL destroy $TESTPOOL
(( i = i + 3 ))
done
log_pass "Creating a pool with \"cachefile\" set doesn't update zpool.cache"
--- 85,94 ----
PROP=$(get_pool_prop cachefile $TESTPOOL)
if [[ $PROP != ${opts[((i+2))]} ]]; then
log_fail "cachefile property not set as expected. " \
"Expect: ${opts[((i+2))]}, Current: $PROP"
fi
! log_must zpool destroy $TESTPOOL
(( i = i + 3 ))
done
log_pass "Creating a pool with \"cachefile\" set doesn't update zpool.cache"