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
. $STF_SUITE/tests/functional/userquota/userquota.cfg
--- 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
. $STF_SUITE/tests/functional/userquota/userquota.cfg
*** 35,53 ****
# reset the userquota and groupquota and delete temporary files
#
function cleanup_quota
{
if datasetexists $QFS; then
! log_must $ZFS set userquota@$QUSER1=none $QFS
! log_must $ZFS set userquota@$QUSER2=none $QFS
! log_must $ZFS set groupquota@$QGROUP=none $QFS
recovery_writable $QFS
fi
! [[ -f $QFILE ]] && log_must $RM -f $QFILE
! [[ -f $OFILE ]] && log_must $RM -f $OFILE
! $SYNC
return 0
}
#
--- 35,53 ----
# reset the userquota and groupquota and delete temporary files
#
function cleanup_quota
{
if datasetexists $QFS; then
! log_must zfs set userquota@$QUSER1=none $QFS
! log_must zfs set userquota@$QUSER2=none $QFS
! log_must zfs set groupquota@$QGROUP=none $QFS
recovery_writable $QFS
fi
! [[ -f $QFILE ]] && log_must rm -f $QFILE
! [[ -f $OFILE ]] && log_must rm -f $OFILE
! sync
return 0
}
#
*** 69,89 ****
#
function mkmount_writable
{
typeset fs=$1
typeset mntp=$(get_prop mountpoint $fs)
! log_must $CHMOD 0777 $mntp
}
#
# recovery the directory permission for $QFS
#
function recovery_writable
{
typeset fs=$1
typeset mntp=$(get_prop mountpoint $fs)
! log_must $CHMOD 0755 $mntp
}
#
# check the quota value of a specific FS
#
--- 69,89 ----
#
function mkmount_writable
{
typeset fs=$1
typeset mntp=$(get_prop mountpoint $fs)
! log_must chmod 0777 $mntp
}
#
# recovery the directory permission for $QFS
#
function recovery_writable
{
typeset fs=$1
typeset mntp=$(get_prop mountpoint $fs)
! log_must chmod 0755 $mntp
}
#
# check the quota value of a specific FS
#
*** 106,120 ****
{
typeset prop_val
typeset prop=$1
typeset dataset=$2
! prop_val=$($ZFS get -H -o value $prop $dataset 2>/dev/null)
if [[ $? -ne 0 ]]; then
log_note "Unable to get $prop property for dataset " \
"$dataset"
return 1
fi
! $ECHO $prop_val
return 0
}
--- 106,120 ----
{
typeset prop_val
typeset prop=$1
typeset dataset=$2
! prop_val=$(zfs get -H -o value $prop $dataset 2>/dev/null)
if [[ $? -ne 0 ]]; then
log_note "Unable to get $prop property for dataset " \
"$dataset"
return 1
fi
! echo $prop_val
return 0
}