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/snapshot/snapshot.cfg
--- 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/snapshot/snapshot.cfg
*** 47,78 ****
verify_runnable "both"
function cleanup
{
[[ -e $TESTDIR1 ]] && \
! log_must $RM -rf $TESTDIR1/* > /dev/null 2>&1
snapexists $SNAPCTR && \
! log_must $ZFS destroy $SNAPCTR
datasetexists $TESTPOOL/$TESTCTR/$TESTFS1 && \
! log_must $ZFS set quota=none $TESTPOOL/$TESTCTR/$TESTFS1
}
log_assert "Verify creating/destroying snapshots do things clean"
log_onexit cleanup
! log_must $ZFS set quota=$FSQUOTA $TESTPOOL/$TESTCTR/$TESTFS1
! log_must $MKFILE $FILESIZE $TESTDIR1/$TESTFILE
! log_must $ZFS snapshot $SNAPCTR
! log_must $ZFS destroy $SNAPCTR
log_note "Make the quota of filesystem is reached"
! log_mustnot $MKFILE $FILESIZE1 $TESTDIR1/$TESTFILE1
log_note "Verify removing the first file should succeed after the snapshot is \
removed"
! log_must $RM $TESTDIR1/$TESTFILE
log_pass "Verify creating/destroying snapshots do things clean"
--- 47,78 ----
verify_runnable "both"
function cleanup
{
[[ -e $TESTDIR1 ]] && \
! log_must rm -rf $TESTDIR1/* > /dev/null 2>&1
snapexists $SNAPCTR && \
! log_must zfs destroy $SNAPCTR
datasetexists $TESTPOOL/$TESTCTR/$TESTFS1 && \
! log_must zfs set quota=none $TESTPOOL/$TESTCTR/$TESTFS1
}
log_assert "Verify creating/destroying snapshots do things clean"
log_onexit cleanup
! log_must zfs set quota=$FSQUOTA $TESTPOOL/$TESTCTR/$TESTFS1
! log_must mkfile $FILESIZE $TESTDIR1/$TESTFILE
! log_must zfs snapshot $SNAPCTR
! log_must zfs destroy $SNAPCTR
log_note "Make the quota of filesystem is reached"
! log_mustnot mkfile $FILESIZE1 $TESTDIR1/$TESTFILE1
log_note "Verify removing the first file should succeed after the snapshot is \
removed"
! log_must rm $TESTDIR1/$TESTFILE
log_pass "Verify creating/destroying snapshots do things clean"