[Top] [All Lists]

Re: [PATCH 1/3] Test basic quota enforcement

To: Jan Kara <jack@xxxxxxx>
Subject: Re: [PATCH 1/3] Test basic quota enforcement
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 19 May 2010 10:55:35 +1000
Cc: xfs@xxxxxxxxxxx, hch@xxxxxxxxxxxxx
In-reply-to: <1274225776-26987-2-git-send-email-jack@xxxxxxx>
References: <1274225776-26987-1-git-send-email-jack@xxxxxxx> <1274225776-26987-2-git-send-email-jack@xxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
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

> +_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


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>