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
. $STF_SUITE/tests/functional/reservation/reservation.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
. $STF_SUITE/tests/functional/reservation/reservation.shlib
*** 54,67 ****
"at same level except for consuming space from common pool"
function cleanup
{
datasetexists $TESTPOOL/$TESTFS2 && \
! log_must $ZFS destroy -f $TESTPOOL/$TESTFS2
datasetexists $TESTPOOL/$TESTFS1 && \
! log_must $ZFS destroy -f $TESTPOOL/$TESTFS1
}
log_onexit cleanup
space_avail=`get_prop available $TESTPOOL`
--- 54,67 ----
"at same level except for consuming space from common pool"
function cleanup
{
datasetexists $TESTPOOL/$TESTFS2 && \
! log_must zfs destroy -f $TESTPOOL/$TESTFS2
datasetexists $TESTPOOL/$TESTFS1 && \
! log_must zfs destroy -f $TESTPOOL/$TESTFS1
}
log_onexit cleanup
space_avail=`get_prop available $TESTPOOL`
*** 82,108 ****
args1=$1
dataset1=$2
args2=$3
dataset2=$4
! log_must $ZFS create $args1 $dataset1
! log_must $ZFS set reservation=$RESV_SIZE $dataset1
avail_aft_dset1=`get_prop available $TESTPOOL`
used_aft_dset1=`get_prop used $TESTPOOL`
! log_must $ZFS create $args2 $dataset2
! log_must $ZFS set reservation=$RESV_SIZE $dataset2
#
# After destroying the second dataset the space used and
# available totals should revert back to the values they
# had after creating the first dataset.
#
! log_must $ZFS destroy -f $dataset2
avail_dest_dset2=`get_prop available $TESTPOOL`
used_dest_dset2=`get_prop used $TESTPOOL`
log_must within_limits $avail_aft_dset1 $avail_dest_dset2 $RESV_TOLERANCE
--- 82,108 ----
args1=$1
dataset1=$2
args2=$3
dataset2=$4
! log_must zfs create $args1 $dataset1
! log_must zfs set reservation=$RESV_SIZE $dataset1
avail_aft_dset1=`get_prop available $TESTPOOL`
used_aft_dset1=`get_prop used $TESTPOOL`
! log_must zfs create $args2 $dataset2
! log_must zfs set reservation=$RESV_SIZE $dataset2
#
# After destroying the second dataset the space used and
# available totals should revert back to the values they
# had after creating the first dataset.
#
! log_must zfs destroy -f $dataset2
avail_dest_dset2=`get_prop available $TESTPOOL`
used_dest_dset2=`get_prop used $TESTPOOL`
log_must within_limits $avail_aft_dset1 $avail_dest_dset2 $RESV_TOLERANCE
*** 110,120 ****
# After destroying the first dataset the space used and
# space available totals should revert back to the values
# they had when the pool was first created.
! log_must $ZFS destroy -f $dataset1
avail_dest_dset1=`get_prop available $TESTPOOL`
used_dest_dset1=`get_prop used $TESTPOOL`
log_must within_limits $avail_dest_dset1 $space_avail $RESV_TOLERANCE
--- 110,120 ----
# After destroying the first dataset the space used and
# space available totals should revert back to the values
# they had when the pool was first created.
! log_must zfs destroy -f $dataset1
avail_dest_dset1=`get_prop available $TESTPOOL`
used_dest_dset1=`get_prop used $TESTPOOL`
log_must within_limits $avail_dest_dset1 $space_avail $RESV_TOLERANCE