[PATCH 1/3] Test basic quota enforcement
Dave Chinner
david at fromorbit.com
Tue May 18 19:55:35 CDT 2010
On Wed, May 19, 2010 at 01:36:14AM +0200, Jan Kara wrote:
> Add a test which checks whether basic quota enforcement works.
Couple of quick things:
- we have ${qa_user} for running stuff under a specific user
- sudo is not installed or configured for this sort of usage
on many systems - typically su is used instead (e.g. see
test 193)
> +# real QA test starts here
> +rm -f $seq.full
> +
> +user=nobody
> +group=`sudo -u $user id -g`
> +grace=2
> +
> +umount $SCRATCH_DEV 2>/dev/null
The scratch device should already be unmounted. if it isn't something
went wrong in a previous test and unmounting it here isn't going to
help.
> +_scratch_mkfs >> $seq.full 2>&1
> +_scratch_mount "-o usrquota,grpquota"
> +quotacheck -u -g $SCRATCH_MNT 2>/dev/null
> +quotaon $SCRATCH_MNT 2>/dev/null
> +setquota -u $user 4 12 2 4 $SCRATCH_MNT
> +setquota -u -t $grace $grace $SCRATCH_MNT
> +setquota -g $group 4 12 2 4 $SCRATCH_MNT
> +setquota -g -t $grace $grace $SCRATCH_MNT
> +umount $SCRATCH_DEV
> +
> +echo; echo "### test user limit enforcement"
> +export MOUNT_OPTIONS="-o usrquota"
> +_qmount
That will overwrite any mount options specified on the command line.
perhaps better is to use:
scratch_mount -o usrquota
Cheers,
Dave.
--
Dave Chinner
david at fromorbit.com
More information about the xfs
mailing list