_choose_id function has changed slightly, run setquota once user is inited.

This commit is contained in:
Nathan Scott
2001-04-11 06:10:08 +00:00
parent 9304ea122b
commit ae9a37dbb5
7 changed files with 152 additions and 73 deletions
+5 -5
View File
@@ -85,16 +85,16 @@ _qmount
# setup exactly what it is we'll be testing # setup exactly what it is we'll be testing
if src/feature -u $SCRATCH_DEV if src/feature -u $SCRATCH_DEV
then then
type=u ; id=`_choose_uid`; ln $seq.usrquota $seq.out type=u ; eval `_choose_uid`; ln $seq.usrquota $seq.out
elif src/feature -g $SCRATCH_DEV elif src/feature -g $SCRATCH_DEV
then then
type=g ; id=`_choose_gid`; ln $seq.grpquota $seq.out type=g ; eval `_choose_gid`; ln $seq.grpquota $seq.out
elif src/feature -U $SCRATCH_DEV elif src/feature -U $SCRATCH_DEV
then then
type=u ; id=`_choose_uid`; ln $seq.uqnoenforce $seq.out type=u ; eval `_choose_uid`; ln $seq.uqnoenforce $seq.out
elif src/feature -G $SCRATCH_DEV elif src/feature -G $SCRATCH_DEV
then then
type=g ; id=`_choose_gid`; ln $seq.gqnoenforce $seq.out type=g ; eval `_choose_gid`; ln $seq.gqnoenforce $seq.out
else else
_notrun "No quota support at mount time" _notrun "No quota support at mount time"
fi fi
@@ -108,8 +108,8 @@ repquota -$type $SCRATCH_DEV | _filter_repquota
echo echo
echo "*** report initial settings" | tee -a $seq.full echo "*** report initial settings" | tee -a $seq.full
setquota -$type $id 100 500 4 10 $SCRATCH_DEV
_file_as_id $SCRATCH_MNT/initme $id $type 1024 0 _file_as_id $SCRATCH_MNT/initme $id $type 1024 0
setquota -$type $id 100 500 4 10 $SCRATCH_DEV
repquota -$type $SCRATCH_DEV | _filter_repquota repquota -$type $SCRATCH_DEV | _filter_repquota
echo echo
+36 -18
View File
@@ -7,50 +7,68 @@ log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
*** report no quota settings *** report no quota settings
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
*** report initial settings *** report initial settings
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 1 4 10 [NAME] -- 0 100 500 1 4 10
*** push past the soft inode limit *** push past the soft inode limit
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 3 4 10 [NAME] -- 0 100 500 3 4 10
*** push past the soft block limit *** push past the soft block limit
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] +- 140 100 500 4 4 10 [NAME] +- 140 100 500 4 4 10
*** push past the hard inode limit (expect EDQUOT) *** push past the hard inode limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 4 0 0 3 0 0 [NAME] -- 4 0 0 3 0 0
[NAME] ++ 140 100 500 16 4 10 [NAME] ++ 140 100 500 16 4 10
*** push past the hard block limit (expect EDQUOT) *** push past the hard block limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 4 0 0 3 0 0 [NAME] -- 4 0 0 3 0 0
[NAME] ++ 540 100 500 16 4 10 [NAME] ++ 540 100 500 16 4 10
*** unmount *** unmount
+36 -18
View File
@@ -7,50 +7,68 @@ log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
*** report no quota settings *** report no quota settings
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
*** report initial settings *** report initial settings
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 1 4 10 [NAME] -- 0 100 500 1 4 10
*** push past the soft inode limit *** push past the soft inode limit
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 3 4 10 [NAME] -- 0 100 500 3 4 10
*** push past the soft block limit *** push past the soft block limit
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] +- 140 100 500 7days 4 4 10 7days [NAME] +- 140 100 500 7days 4 4 10 7days
*** push past the hard inode limit (expect EDQUOT) *** push past the hard inode limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] ++ 140 100 500 7days 10 4 10 7days [NAME] ++ 140 100 500 7days 10 4 10 7days
*** push past the hard block limit (expect EDQUOT) *** push past the hard block limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for group quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] ++ 448 100 500 7days 10 4 10 7days [NAME] ++ 448 100 500 7days 10 4 10 7days
*** unmount *** unmount
+30 -12
View File
@@ -8,49 +8,67 @@ realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
*** report no quota settings *** report no quota settings
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
*** report initial settings *** report initial settings
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 1 4 10 [NAME] -- 0 100 500 1 4 10
*** push past the soft inode limit *** push past the soft inode limit
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 3 4 10 [NAME] -- 0 100 500 3 4 10
*** push past the soft block limit *** push past the soft block limit
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] +- 140 100 500 4 4 10 [NAME] +- 140 100 500 4 4 10
*** push past the hard inode limit (expect EDQUOT) *** push past the hard inode limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 4 0 0 3 0 0 [NAME] -- 4 0 0 3 0 0
[NAME] ++ 140 100 500 16 4 10 [NAME] ++ 140 100 500 16 4 10
*** push past the hard block limit (expect EDQUOT) *** push past the hard block limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 4 0 0 3 0 0 [NAME] -- 4 0 0 3 0 0
[NAME] ++ 540 100 500 16 4 10 [NAME] ++ 540 100 500 16 4 10
*** unmount *** unmount
+30 -12
View File
@@ -8,49 +8,67 @@ realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
*** report no quota settings *** report no quota settings
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
*** report initial settings *** report initial settings
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 1 4 10 [NAME] -- 0 100 500 1 4 10
*** push past the soft inode limit *** push past the soft inode limit
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] -- 0 100 500 3 4 10 [NAME] -- 0 100 500 3 4 10
*** push past the soft block limit *** push past the soft block limit
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] +- 140 100 500 7days 4 4 10 7days [NAME] +- 140 100 500 7days 4 4 10 7days
*** push past the hard inode limit (expect EDQUOT) *** push past the hard inode limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] ++ 140 100 500 7days 10 4 10 7days [NAME] ++ 140 100 500 7days 10 4 10 7days
*** push past the hard block limit (expect EDQUOT) *** push past the hard block limit (expect EDQUOT)
*** Report for user quotas on device [DEVICE] *** Report for user quotas on device [DEVICE]
Block grace time: 7days Inode grace time: 7days Block grace time: 7days; Inode grace time: 7days
Block limits File limits Block limits File limits
User used soft hard grace used soft hard grace User used soft hard grace used soft hard grace
----------------------------------------------------------------------
[NAME] -- 0 0 0 3 0 0 [NAME] -- 0 0 0 3 0 0
[NAME] ++ 448 100 500 7days 10 4 10 7days [NAME] ++ 448 100 500 7days 10 4 10 7days
*** unmount *** unmount
+11 -6
View File
@@ -60,7 +60,7 @@ _cleanup()
rm -f $tmp.* rm -f $tmp.*
} }
trap "_cleanup; exit \$status" 0 1 2 3 15 trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $seq.full $seq.out rm -f $seq.full
_require_scratch _require_scratch
_require_quota _require_quota
@@ -82,9 +82,9 @@ _qmount
# setup user/group to test # setup user/group to test
if src/feature -U $SCRATCH_DEV ; then if src/feature -U $SCRATCH_DEV ; then
type=u ; id=`_choose_uid` type=u ; eval `_choose_uid`
elif src/feature -G $SCRATCH_DEV ; then elif src/feature -G $SCRATCH_DEV ; then
type=g ; id=`_choose_gid` type=g ; eval `_choose_gid`
else else
_notrun "No quota support at mount time" _notrun "No quota support at mount time"
fi fi
@@ -94,14 +94,19 @@ _file_as_id $SCRATCH_MNT/foo $id $type $dbsize 220
sync sync
# set limit at 1001 (1k) blocks # set limit at 1001 (1k) blocks
setquota -n -$type $id $SCRATCH_DEV 1001 1001 10 10 setquota -$type $id 1001 1001 10 10 $SCRATCH_DEV
# cross check blks, softblks, hardblks <-> quota, xfs_db # cross check blks, softblks, hardblks <-> quota, xfs_db
quota $type -n $id | tee -a $seq.full | perl -ne ' quota -$type $id | tee -a $seq.full | perl -ne '
if (m,^\s*'$SCRATCH_DEV'\s+(\d+)\s+(\d+)\s+(\d+),) { if (m,^\s*'$SCRATCH_DEV'\s+(\d+)\s+(\d+)\s+(\d+), ||
($next == 1 && m,^\s+(\d+)\s+(\d+)\s+(\d+),)) {
print "used_blocks=", $1, "\n"; print "used_blocks=", $1, "\n";
print "soft_blocks=", $2, "\n"; print "soft_blocks=", $2, "\n";
print "hard_blocks=", $3, "\n"; print "hard_blocks=", $3, "\n";
$next = 0;
}
elsif (m,^\s*'$SCRATCH_DEV',) { # devfs (long) names
$next = 1;
}' | LC_COLLATE=POSIX sort >$tmp.quota }' | LC_COLLATE=POSIX sort >$tmp.quota
echo ===quota output >> $seq.full echo ===quota output >> $seq.full
+4 -2
View File
@@ -74,12 +74,14 @@ EOF
_choose_uid() _choose_uid()
{ {
perl -ne '@a = split(/:/); END { print $a[2]; }' /etc/passwd perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }' \
/etc/passwd
} }
_choose_gid() _choose_gid()
{ {
perl -ne '@a = split(/:/); END { print $a[2]; }' /etc/group perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }' \
/etc/group
} }
_filter_repquota() _filter_repquota()