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>
*** 23,33 ****
# 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
export USEDTEST=$TESTPOOL/$TESTFS/usedtest-snapused
--- 23,33 ----
# 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
export USEDTEST=$TESTPOOL/$TESTFS/usedtest-snapused
*** 53,63 ****
}
function check_used # dataset
{
typeset dataset=$1
! for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
do
_check_used $child
done
}
--- 53,63 ----
}
function check_used # dataset
{
typeset dataset=$1
! for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
do
_check_used $child
done
}
*** 64,74 ****
function check_usedbychildren # dataset
{
typeset dataset=$1
typeset -i usedbychildren_sum=0
typeset -i parent_usedbychildren=0
! for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
do
if [[ "$(get_prop type $child)" == "snapshot" ]]; then
continue
fi
--- 64,74 ----
function check_usedbychildren # dataset
{
typeset dataset=$1
typeset -i usedbychildren_sum=0
typeset -i parent_usedbychildren=0
! for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
do
if [[ "$(get_prop type $child)" == "snapshot" ]]; then
continue
fi
*** 118,128 ****
}
function check_usedbydataset # dataset
{
typeset dataset=$1
! for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
do
_check_usedbydataset $child
done
}
--- 118,128 ----
}
function check_usedbydataset # dataset
{
typeset dataset=$1
! for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
do
_check_usedbydataset $child
done
}
*** 144,154 ****
}
function check_usedbyrefreservation # dataset
{
typeset dataset=$1
! for child in $($ZFS list -rH -t filesystem,volume -o name $dataset)
do
_check_usedbyrefreservation $child
done
}
--- 144,154 ----
}
function check_usedbyrefreservation # dataset
{
typeset dataset=$1
! for child in $(zfs list -rH -t filesystem,volume -o name $dataset)
do
_check_usedbyrefreservation $child
done
}
*** 155,165 ****
function check_usedbysnapshots # dataset
{
typeset dataset=$1
typeset -i usedbysnapshots_sum=0
typeset -i parent_usedbysnapshots=0
! for child in $($ZFS list -rH -t filesystem,volume,snapshot -o name $dataset)
do
# parent
if [[ "$child" == "$dataset" ]]; then
parent_usedbysnapshots=$(get_prop usedbysnapshots $child)
continue
--- 155,165 ----
function check_usedbysnapshots # dataset
{
typeset dataset=$1
typeset -i usedbysnapshots_sum=0
typeset -i parent_usedbysnapshots=0
! for child in $(zfs list -rH -t filesystem,volume,snapshot -o name $dataset)
do
# parent
if [[ "$child" == "$dataset" ]]; then
parent_usedbysnapshots=$(get_prop usedbysnapshots $child)
continue