Dont hard code paths ni test 050, and fix common.quota macros on Debian setups.

Merge of master-melb:xfs-cmds:26021a by kenmcd.
This commit is contained in:
Nathan Scott
2006-05-25 06:13:27 +00:00
parent 4d9847210e
commit cce5a421c8
2 changed files with 12 additions and 14 deletions
+8 -10
View File
@@ -83,10 +83,8 @@ _exercise()
# keep the blocksize and data size for dd later # keep the blocksize and data size for dd later
. $tmp.mkfs . $tmp.mkfs
_qmount _qmount
# Figure out whether we're doing large allocations # Figure out whether we're doing large allocations
# (bail out if they're so large they stuff the test up) # (bail out if they're so large they stuff the test up)
_test_inode_flag extsz-inherit $SCRATCH_MNT _test_inode_flag extsz-inherit $SCRATCH_MNT
@@ -121,13 +119,13 @@ _exercise()
_file_as_id $SCRATCH_MNT/softie2 $id $type 1024 0 _file_as_id $SCRATCH_MNT/softie2 $id $type 1024 0
_qmount _qmount
xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report
echo echo
echo "*** push past the soft block limit" | tee -a $seq.full echo "*** push past the soft block limit" | tee -a $seq.full
_file_as_id $SCRATCH_MNT/softie $id $type 1024 140 _file_as_id $SCRATCH_MNT/softie $id $type 1024 140
_qmount _qmount
xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report
echo echo
# Note: for quota accounting (not enforcement), EDQUOT is not expected # Note: for quota accounting (not enforcement), EDQUOT is not expected
echo "*** push past the hard inode limit (expect EDQUOT)" | tee -a $seq.full echo "*** push past the hard inode limit (expect EDQUOT)" | tee -a $seq.full
@@ -174,8 +172,8 @@ _qmount_option()
[ "$?" -eq 0 ] || export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $1" [ "$?" -eq 0 ] || export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $1"
} }
cat >$tmp.projects <<EOF cat >$tmp.projects <<EOF
1:/mnt/scratch 1:$SCRATCH_MNT
EOF EOF
cat >$tmp.projid <<EOF cat >$tmp.projid <<EOF
@@ -198,7 +196,7 @@ echo "*** group"
_qmount_option "gquota" _qmount_option "gquota"
_exercise _exercise
echo "*** uqnoenforce" echo "*** uqnoenforce"
if [ "$HOSTOS" == "IRIX" ] if [ "$HOSTOS" == "IRIX" ]
then then
_qmount_option "qnoenforce" _qmount_option "qnoenforce"
@@ -207,15 +205,15 @@ else
fi fi
_exercise _exercise
echo "*** gqnoenforce" echo "*** gqnoenforce"
_qmount_option "gqnoenforce" _qmount_option "gqnoenforce"
_exercise _exercise
echo "*** pquota" echo "*** pquota"
_qmount_option "pquota" _qmount_option "pquota"
_exercise _exercise
echo "*** pqnoenforce" echo "*** pqnoenforce"
_qmount_option "pqnoenforce" _qmount_option "pqnoenforce"
_exercise _exercise
+4 -4
View File
@@ -34,8 +34,8 @@ _require_nobody()
grep -q '^nobody' /etc/passwd grep -q '^nobody' /etc/passwd
[ $? -ne 0 ] && _notrun "/etc/passwd does not contain user nobody." [ $? -ne 0 ] && _notrun "/etc/passwd does not contain user nobody."
grep -q '^nobody' /etc/group egrep -q '^no(body|group)' /etc/group
[ $? -ne 0 ] && _notrun "/etc/group does not contain user nobody." [ $? -ne 0 ] && _notrun "/etc/group does not contain nobody/nogroup."
} }
# create a file as a specific user (uid) # create a file as a specific user (uid)
@@ -81,7 +81,7 @@ _choose_uid()
_choose_gid() _choose_gid()
{ {
grep '^nobody' /etc/group | perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }' egrep '^no(body|group)' /etc/group | perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }'
} }
_choose_prid() _choose_prid()
@@ -110,7 +110,7 @@ _qsetup()
enforce=1 enforce=1
if src/feature -u $SCRATCH_DEV if src/feature -u $SCRATCH_DEV
then then
type=u ; type=u ;
eval `_choose_uid` eval `_choose_uid`
[ ! -f $seq.out ] && ln -s $seq.usrquota $seq.out [ ! -f $seq.out ] && ln -s $seq.usrquota $seq.out
elif src/feature -g $SCRATCH_DEV elif src/feature -g $SCRATCH_DEV