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 2007 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 # --- 24,34 ---- # Copyright 2007 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 #
*** 45,55 **** verify_runnable "both" function cleanup { ! $RM -f $TESTDIR/* } function create_free_testing #<file size> <file> { typeset -i fsz=$1 --- 45,55 ---- verify_runnable "both" function cleanup { ! rm -f $TESTDIR/* } function create_free_testing #<file size> <file> { typeset -i fsz=$1
*** 61,74 **** for start in 0 `expr $RANDOM % $fsz` do (( dist = fsz - start )) for len in `expr $RANDOM % $dist` $dist \ `expr $start + $dist`; do ! log_must $RANDFREE_FILE -l fsz -s $start \ -n $len $file [[ -e $file ]] && \ ! log_must $RM -f $file done done } --- 61,74 ---- for start in 0 `expr $RANDOM % $fsz` do (( dist = fsz - start )) for len in `expr $RANDOM % $dist` $dist \ `expr $start + $dist`; do ! log_must randfree_file -l fsz -s $start \ -n $len $file [[ -e $file ]] && \ ! log_must rm -f $file done done }
*** 86,106 **** for propname in "compression" "compress" do for value in $(get_compress_opts zfs_compress) do ! log_must $ZFS set compression=$value $fs real_val=$(get_prop $propname $fs) if [[ $value == "gzip-6" ]]; then value="gzip" fi [[ $real_val != $value ]] && \ log_fail "Set property $propname=$value failed." (( blksize = 512 )) while (( blksize <= 131072 )); do ! log_must $ZFS set recordsize=$blksize $fs # doing single block testing (( fsize = $RANDOM )) if (( fsize > blksize )); then (( fsize = fsize % blksize )) --- 86,106 ---- for propname in "compression" "compress" do for value in $(get_compress_opts zfs_compress) do ! log_must zfs set compression=$value $fs real_val=$(get_prop $propname $fs) if [[ $value == "gzip-6" ]]; then value="gzip" fi [[ $real_val != $value ]] && \ log_fail "Set property $propname=$value failed." (( blksize = 512 )) while (( blksize <= 131072 )); do ! log_must zfs set recordsize=$blksize $fs # doing single block testing (( fsize = $RANDOM )) if (( fsize > blksize )); then (( fsize = fsize % blksize ))