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/reservation/reservation.shlib
--- 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/reservation/reservation.shlib
*** 55,67 ****
function cleanup
{
typeset -i loop=0
while (($loop < $RESV_NUM_FS)); do
datasetexists $TESTPOOL/${TESTFS}$loop && \
! log_must $ZFS destroy -f $TESTPOOL/${TESTFS}$loop
! [[ -d ${TESTDIR}$loop ]] && log_must $RM -r ${TESTDIR}$loop
((loop = loop + 1))
done
}
--- 55,67 ----
function cleanup
{
typeset -i loop=0
while (($loop < $RESV_NUM_FS)); do
datasetexists $TESTPOOL/${TESTFS}$loop && \
! log_must zfs destroy -f $TESTPOOL/${TESTFS}$loop
! [[ -d ${TESTDIR}$loop ]] && log_must rm -r ${TESTDIR}$loop
((loop = loop + 1))
done
}
*** 90,100 ****
# Note we don't set a reservation on the first filesystem we created,
# hence num=1 rather than zero below.
#
typeset -i num=1
while (($num < $RESV_NUM_FS)); do
! log_must $ZFS set reservation=$resv_size_set $TESTPOOL/$TESTFS$num
((num = num + 1))
done
space_avail_still=`get_prop available $TESTPOOL`
--- 90,100 ----
# Note we don't set a reservation on the first filesystem we created,
# hence num=1 rather than zero below.
#
typeset -i num=1
while (($num < $RESV_NUM_FS)); do
! log_must zfs set reservation=$resv_size_set $TESTPOOL/$TESTFS$num
((num = num + 1))
done
space_avail_still=`get_prop available $TESTPOOL`
*** 104,124 ****
# Now fill up the first filesystem (which doesn't have a reservation set
# and thus will use up whatever free space is left in the pool).
num=0
log_note "Writing to $TESTDIR$num/$TESTFILE1"
! $FILE_WRITE -o create -f $TESTDIR$num/$TESTFILE1 -b $BLOCK_SIZE \
-c $write_count -d 0
ret=$?
if (($ret != $ENOSPC)); then
log_fail "Did not get ENOSPC as expected (got $ret)."
fi
# Remove the reservation on one of the other filesystems and verify
# can write more data to the original non-reservation filesystem.
num=1
! log_must $ZFS set reservation=none $TESTPOOL/${TESTFS}$num
num=0
! log_must $FILE_WRITE -o create -f ${TESTDIR}$num/$TESTFILE2 -b $PAGESIZE \
-c 1000 -d 0
log_pass "reducing reservation allows other datasets to use space"
--- 104,124 ----
# Now fill up the first filesystem (which doesn't have a reservation set
# and thus will use up whatever free space is left in the pool).
num=0
log_note "Writing to $TESTDIR$num/$TESTFILE1"
! file_write -o create -f $TESTDIR$num/$TESTFILE1 -b $BLOCK_SIZE \
-c $write_count -d 0
ret=$?
if (($ret != $ENOSPC)); then
log_fail "Did not get ENOSPC as expected (got $ret)."
fi
# Remove the reservation on one of the other filesystems and verify
# can write more data to the original non-reservation filesystem.
num=1
! log_must zfs set reservation=none $TESTPOOL/${TESTFS}$num
num=0
! log_must file_write -o create -f ${TESTDIR}$num/$TESTFILE2 -b pagesize \
-c 1000 -d 0
log_pass "reducing reservation allows other datasets to use space"