]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
get quota stuff working on IRIX as well as Linux
authorTim Shimmin <tes@sgi.com>
Fri, 30 Jul 2004 05:28:14 +0000 (05:28 +0000)
committerTim Shimmin <tes@sgi.com>
Fri, 30 Jul 2004 05:28:14 +0000 (05:28 +0000)
050
050.gqnoenforce
050.grpquota
050.uqnoenforce
050.usrquota
052
054
common.quota

diff --git a/050 b/050
index 55a1c65d7c18ddfc698652ed8b0ff422407a853b..6c2beeb7b9d5a11651be2c9a2e84c4a26e848435 100755 (executable)
--- a/050
+++ b/050
@@ -3,7 +3,7 @@
 #
 # Exercises basic XFS quota functionality
 #      MOUNT_OPTIONS env var switches the test type (uid/gid/acct/enfd)
-#      options are:  (-o) usrquota, grpquota, uqnoenforce, gqnoenforce
+#      options are:  (-o) uquota, gquota, uqnoenforce, gqnoenforce
 #
 #-----------------------------------------------------------------------
 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
@@ -47,8 +47,6 @@ here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
 
-export MOUNT_OPTIONS=-ousrquota
-
 # get standard environment, filters and checks
 . ./common.rc
 . ./common.filter
@@ -66,7 +64,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 # real QA test starts here
 _supported_fs xfs
-_supported_os Linux
+_supported_os Linux IRIX
 
 rm -f $seq.out
 cp /dev/null $seq.full
@@ -75,6 +73,11 @@ chmod a+rwx $seq.full        # arbitrary users will write here
 _require_scratch
 _require_quota
 
+# setup a default run
+if [ -z "$MOUNT_OPTIONS" ]; then
+        export MOUNT_OPTIONS="-o uquota"
+fi
+
 blksoft=100
 blkhard=500
 inosoft=4
@@ -98,7 +101,7 @@ _filter_and_check_blocks()
                        }
                        s/^('$name'\s+[-|+][-|+]\s+)(\d+)/\1 OK/g;
                }
-       ' | _filter_repquota $1
+       ' | _filter_repquota
 }
 
 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
@@ -109,21 +112,28 @@ cat $tmp.mkfs >>$seq.full
 
 _qmount
 
+# Irix uses filesystem name and Linux uses device of filesystem
+if [ $HOSTOS = "Linux" ]; then
+    QUOTA_FS=$SCRATCH_DEV
+else
+    QUOTA_FS=$SCRATCH_MNT
+fi
+
 # setup exactly what it is we'll be testing
 enforce=1
 if src/feature -u $SCRATCH_DEV
 then
-       type=u ; eval `_choose_uid`; ln $seq.usrquota $seq.out
+       type=u ; eval `_choose_uid`; ln -s $seq.usrquota $seq.out
 elif src/feature -g $SCRATCH_DEV
 then
-       type=g ; eval `_choose_gid`; ln $seq.grpquota $seq.out
+       type=g ; eval `_choose_gid`; ln -s $seq.grpquota $seq.out
 elif src/feature -U $SCRATCH_DEV
 then
-       type=u ; eval `_choose_uid`; ln $seq.uqnoenforce $seq.out
+       type=u ; eval `_choose_uid`; ln -s $seq.uqnoenforce $seq.out
        enforce=0
 elif src/feature -G $SCRATCH_DEV
 then
-       type=g ; eval `_choose_gid`; ln $seq.gqnoenforce $seq.out
+       type=g ; eval `_choose_gid`; ln -s $seq.gqnoenforce $seq.out
        enforce=0
 else
        _notrun "No quota support at mount time"
@@ -134,26 +144,28 @@ echo "and using type=$type id=$id" >>$seq.full
 
 echo
 echo "*** report no quota settings" | tee -a $seq.full
-repquota -$type $SCRATCH_DEV | _filter_repquota 6
+_repquota -$type $QUOTA_FS | _filter_repquota
 
 echo
 echo "*** report initial settings" | tee -a $seq.full
 _file_as_id $SCRATCH_MNT/initme $id $type 1024 0
-setquota -$type $id $blksoft $blkhard $inosoft $inohard $SCRATCH_DEV
-repquota -$type $SCRATCH_DEV | _filter_repquota 7
+echo "ls -l $SCRATCH_MNT" >>$seq.full
+ls -l $SCRATCH_MNT >>$seq.full
+_setquota -$type $id $blksoft $blkhard $inosoft $inohard $QUOTA_FS
+_repquota -$type $QUOTA_FS | _filter_repquota
 
 echo
 echo "*** push past the soft inode limit" | tee -a $seq.full
 _file_as_id $SCRATCH_MNT/softie1 $id $type 1024 0
 _file_as_id $SCRATCH_MNT/softie2 $id $type 1024 0
 _qmount
-repquota -$type $SCRATCH_DEV | _filter_repquota 7
+_repquota -$type $QUOTA_FS | _filter_repquota
 
 echo
 echo "*** push past the soft block limit" | tee -a $seq.full
 _file_as_id $SCRATCH_MNT/softie $id $type 1024 140
 _qmount
-repquota -$type $SCRATCH_DEV | _filter_repquota 7
+_repquota -$type $QUOTA_FS | _filter_repquota
 
 echo
 # Note: for quota accounting (not enforcement), EDQUOT is not expected
@@ -163,17 +175,17 @@ do
        _file_as_id $SCRATCH_MNT/hard$i $id $type 1024 0
 done
 _qmount
-repquota -$type $SCRATCH_DEV | _filter_repquota 7
+_repquota -$type $QUOTA_FS | _filter_repquota
 
 echo
 # Note: for quota accounting (not enforcement), EDQUOT is not expected
 echo "*** push past the hard block limit (expect EDQUOT)" | tee -a $seq.full
 _file_as_id $SCRATCH_MNT/softie $id $type 1024 540
+echo "ls -l $SCRATCH_MNT" >>$seq.full
+ls -l $SCRATCH_MNT >>$seq.full
 _qmount
-repquota -$type $SCRATCH_DEV | _filter_and_check_blocks 7
-
+_repquota -$type $QUOTA_FS | _filter_and_check_blocks
 
-export -n MOUNT_OPTIONS
 
 # success, all done
 status=0
index ff1c417e29177ac32c24231ae9b8979089064a40..b2b083f267e243fb5b0a930a577719935adde508 100644 (file)
@@ -7,56 +7,38 @@ log      =LDEV bsize=XXX blocks=XXX
 realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
 
 *** report no quota settings
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
 
 *** report initial settings
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              1     4    10       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 1 4 10
 
 *** push past the soft inode limit
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              3     4    10       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 3 4 10
 
 *** push past the soft block limit
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    +-     140     100     500              4     4    10       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* 140 100 500 4 4 10
 
 *** push past the hard inode limit (expect EDQUOT)
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       4       0       0              3     0     0       
-[NAME]    ++     140     100     500             16     4    10       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 4 0 0 3 0 0
+name +* 140 100 500 16 4 10
 
 *** push past the hard block limit (expect EDQUOT)
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       4       0       0              3     0     0       
-[NAME]    ++     540     100     500             16     4    10       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 4 0 0 3 0 0
+name +* 540 100 500 16 4 10
 
 *** unmount
index 68a761d1dc65f6c8ffc67900c7a47fcf7ad49134..a2759433faec505549825bbd971c7faf198b3120 100644 (file)
@@ -7,56 +7,38 @@ log      =LDEV bsize=XXX blocks=XXX
 realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
 
 *** report no quota settings
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
 
 *** report initial settings
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              1     4    10       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 1 4 10
 
 *** push past the soft inode limit
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              3     4    10       
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 3 4 10
 
 *** push past the soft block limit
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    +-     140     100     500  7days       4     4    10  7days
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* 140 100 500 7days 4 4 10 7days
 
 *** push past the hard inode limit (expect EDQUOT)
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    ++     140     100     500  7days      10     4    10  7days
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* 140 100 500 7days 10 4 10 7days
 
 *** push past the hard block limit (expect EDQUOT)
-*** Report for group quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-Group           used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    ++      OK     100     500  7days      10     4    10  7days
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* OK 100 500 7days 10 4 10 7days
 
 *** unmount
index 619e3dd5590aea54235fa32fd57e78226170985d..1bc3d2e86f557b62e73f10980cd7c387ed254ce9 100644 (file)
@@ -7,56 +7,38 @@ log      =LDEV bsize=XXX blocks=XXX
 realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
 
 *** report no quota settings
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
 
 *** report initial settings
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              1     4    10       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 1 4 10
 
 *** push past the soft inode limit
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              3     4    10       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 3 4 10
 
 *** push past the soft block limit
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    +-     140     100     500              4     4    10       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* 140 100 500 4 4 10
 
 *** push past the hard inode limit (expect EDQUOT)
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       4       0       0              3     0     0       
-[NAME]    ++     140     100     500             16     4    10       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 4 0 0 3 0 0
+name +* 140 100 500 16 4 10
 
 *** push past the hard block limit (expect EDQUOT)
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       4       0       0              3     0     0       
-[NAME]    ++     540     100     500             16     4    10       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 4 0 0 3 0 0
+name +* 540 100 500 16 4 10
 
 *** unmount
index 25d920801c7e3df8dcfe41d2a745bb66179d5b2d..4915d3a61cfc9ebf7944cd3e705009225bf5745e 100644 (file)
@@ -7,56 +7,38 @@ log      =LDEV bsize=XXX blocks=XXX
 realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
 
 *** report no quota settings
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
 
 *** report initial settings
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              1     4    10       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 1 4 10
 
 *** push past the soft inode limit
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    --       0     100     500              3     4    10       
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name -* 0 100 500 3 4 10
 
 *** push past the soft block limit
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    +-     140     100     500  7days       4     4    10  7days
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* 140 100 500 7days 4 4 10 7days
 
 *** push past the hard inode limit (expect EDQUOT)
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    ++     140     100     500  7days      10     4    10  7days
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* 140 100 500 7days 10 4 10 7days
 
 *** push past the hard block limit (expect EDQUOT)
-*** Report for user quotas on device [DEVICE]
-Block grace time: 7days; Inode grace time: 7days
-                        Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace
-----------------------------------------------------------------------
-[NAME]    --       0       0       0              3     0     0       
-[NAME]    ++      OK     100     500  7days      10     4    10  7days
+ Block limits File limits
+User used soft hard grace used soft hard grace
+name -* 0 0 0 3 0 0
+name +* OK 100 500 7days 10 4 10 7days
 
 *** unmount
diff --git a/052 b/052
index e523e3d1438136db0b66e1a58522bb63c2839103..51c52d2510177eb649b2125069a37db2fc1cceb6 100755 (executable)
--- a/052
+++ b/052
@@ -3,8 +3,8 @@
 #
 # Ensure that quota(1) displays blocksizes matching ondisk dquots.
 #
-# MOUNT_OPTIONS can be set to grpquota to test group quota,
-# defaults to usrquota if MOUNT_OPTIONS is not set.
+# MOUNT_OPTIONS can be set to gquota to test group quota,
+# defaults to uquota if MOUNT_OPTIONS is not set.
 #
 #-----------------------------------------------------------------------
 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
@@ -48,8 +48,6 @@ here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
 
-export MOUNT_OPTIONS=-ousrquota
-
 # get standard environment, filters and checks
 . ./common.rc
 . ./common.filter
@@ -74,7 +72,7 @@ _require_quota
 
 # setup a default run
 if [ -z "$MOUNT_OPTIONS" ]; then
-        MOUNT_OPTIONS="-o usrquota"; export MOUNT_OPTIONS
+        export MOUNT_OPTIONS="-o uquota"
 fi
 
 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
@@ -88,9 +86,9 @@ _qmount
 
 # setup user/group to test
 if src/feature -U $SCRATCH_DEV ; then
-       type=u ; eval `_choose_uid`
+       type=u; eval `_choose_uid`
 elif src/feature -G $SCRATCH_DEV ; then
-       type=g ; eval `_choose_gid`
+       type=g; eval `_choose_gid`
 else
        _notrun "No quota support at mount time"
 fi
@@ -99,21 +97,37 @@ fi
 _file_as_id $SCRATCH_MNT/foo $id $type $dbsize 220
 sync
 
+# Irix uses filesystem name and Linux uses device of filesystem
+if [ $HOSTOS = "Linux" ]; then
+    QUOTA_FS=$SCRATCH_DEV
+else
+    QUOTA_FS=$SCRATCH_MNT
+fi
+
 # set limit at 1001 (1k) blocks
-setquota -$type $id 1001 1001 10 10 $SCRATCH_DEV
+bsoft=1001
+bhard=1001
+isoft=10
+ihard=10
+_setquota -$type $id $bsoft $bhard $isoft $ihard $QUOTA_FS
 
-# cross check blks, softblks, hardblks <-> quota, xfs_db
-quota -$type $id | tee -a $seq.full | perl -ne '
-       if (m[^\s*'$SCRATCH_DEV'\s+(\d+)\s+(\d+)\s+(\d+)] ||
+_filter_quota()
+{
+    perl -ne '
+       if (m[^\s*'$QUOTA_FS'\s+(\d+)\s+(\d+)\s+(\d+)] ||
                ($next == 1 && m,^\s+(\d+)\s+(\d+)\s+(\d+),)) {
                print "used_blocks=", $1, "\n";
                print "soft_blocks=", $2, "\n";
                print "hard_blocks=", $3, "\n";
                $next = 0;
        }
-       elsif (m[^\s*'$SCRATCH_DEV']) {         # devfs (long) names
+       elsif (m[^\s*'$QUOTA_FS']) {            # devfs (long) names
                $next = 1;
-       }' | LC_COLLATE=POSIX sort >$tmp.quota
+       }' | LC_COLLATE=POSIX sort
+}
+
+# cross check blks, softblks, hardblks <-> quota, xfs_db
+_quota -$type $id | tee -a $seq.full | _filter_quota >$tmp.quota
 
 echo ===quota output >> $seq.full
 cat $tmp.quota >> $seq.full
@@ -141,8 +155,6 @@ echo Comparing out of quota and xfs_db
 diff $tmp.quota $tmp.xfs_db 
 [ $? -eq 0 ] && echo OK.
 
-export -n MOUNT_OPTIONS
-
 # success, all done
 status=0
 exit
diff --git a/054 b/054
index 98df0f87e185a3feaf7006dd018b78a55817d53a..f023573110bf04e402f8a6b43419eb05d1369ea1 100755 (executable)
--- a/054
+++ b/054
@@ -60,7 +60,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 # real QA test starts here
 _supported_fs xfs
-_supported_os Linux
+_supported_os Linux IRIX
 
 cp /dev/null $seq.full
 chmod ugo+rwx $seq.full
@@ -114,7 +114,7 @@ _exercise()
 }
 
 _scratch_mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1
-MOUNT_OPTIONS="$MOUNT_OPTIONS -ousrquota,grpquota"; export MOUNT_OPTIONS
+export MOUNT_OPTIONS="-o uquota,gquota"
 _qmount
 if src/feature -G $SCRATCH_DEV ; then
        :
@@ -123,19 +123,19 @@ else
 fi
 umount $SCRATCH_MNT 2>/dev/null
 
-MOUNT_OPTIONS=""; export MOUNT_OPTIONS
+export MOUNT_OPTIONS=""
 echo "*** Default mount options"
 _exercise
 
-MOUNT_OPTIONS="-o usrquota"; export MOUNT_OPTIONS
+export MOUNT_OPTIONS="-o uquota"
 echo "*** User quota mount option"
 _exercise
 
-MOUNT_OPTIONS="-o grpquota"; export MOUNT_OPTIONS
+export MOUNT_OPTIONS="-o gquota"
 echo "*** Group quota mount option"
 _exercise
 
-MOUNT_OPTIONS="-o usrquota,grpquota"; export MOUNT_OPTIONS
+export MOUNT_OPTIONS="-o uquota,gquota"
 echo "*** User and Group quota mount options"
 _exercise
 
index ca9253f9677744426b147416af100cc33c478fa7..ca6daefa83fb50dad0b8649a9efcdd9c28c01acb 100644 (file)
@@ -69,10 +69,16 @@ _file_as_id()
        _notrun "broken type in call to _file_as_id in test $seq"
     fi
 
-    perl <<EOF >/dev/null 2>&1
+    perl <<EOF >>$seq.full 2>&1
        \$| = 1;
        $magik = $2;
-       exec "dd if=/dev/zero of=$1 bs=$4 count=$5";
+       if ($5 == 0) {
+           print "touch $1";
+           exec "touch $1";
+       } else {
+           print "dd if=/dev/zero of=$1 bs=$4 count=$5";
+           exec "dd if=/dev/zero of=$1 bs=$4 count=$5";
+       }
 EOF
 # for debugging the above euid change, try... [need write in cwd]
 #      exec "dd if=/dev/zero of=$1 bs=$4 count=$5 >>$seq.full 2>&1";
@@ -90,12 +96,32 @@ _choose_gid()
        /etc/group
 }
 
+#
+# filter to get the guts out
+# and make linux and irix similar
+#
 _filter_repquota()
 {
-    head -$1 | perl -ne "
-       s/^(\w+)\s+([-|+])/[NAME]    \2/g;
-       s($SCRATCH_DEV)([DEVICE])g;
-       print"
+    tee -a $seq.full | $AWK_PROG '
+       /File limits/ {
+               gotit = 1
+       }
+       gotit==1 {
+               sub(/Disk/, "Block") 
+               gsub(/timeleft/, "grace")
+               gsub(/[.]0 /,"")
+               sub(/- /, "* ")
+               sub(/[+] /, "* ")
+               gsub(/1week/,"7days")
+               gsub(/NOT STARTED/,"")
+               gsub(/[ \t]+/, " ")
+               if ($0 ~ / [-+]/)
+                   $1 = "name"
+               if ($0 !~ /^$/)
+                   print
+               next
+       }
+    ' | sed -e '/-----------------/d'
 }
 
 _qmount()
@@ -106,5 +132,63 @@ _qmount()
     [ -x /usr/sbin/quot ] && quot $SCRATCH_MNT >>$seq.full 2>&1
 }
 
+#-----------------------------------------------------------------------------------
+#
+# wrappers for Linux/IRIX differences
+#
+_setquota()
+{
+    _opt_type=$1
+    _id=$2
+    _bsoft=$3
+    _bhard=$4
+    _isoft=$5
+    _ihard=$6
+    _fs=$7
+
+    [ $# -eq 7 ] || _fail "_setquota failed with wrong # args: $*"
+
+    if [ $HOSTOS = "Linux" ]; then
+       echo "setquota $_opt_type $_id $_bsoft $_bhard $_isoft $_ihard $_fs" >>$seq.full
+       setquota $_opt_type $_id $_bsoft $_bhard $_isoft $_ihard $_fs
+    else
+       # IRIX
+        if [ $_opt_type = "-u" ]; then
+               _opt_type=""
+               id_param="uid"
+       else 
+               id_param="gid"
+       fi
+       echo "/usr/etc/edquota $_opt_type -f $_fs -l $id_param=$_id,bsoft=$_bsoft,bhard=$_bhard,isoft=$_isoft,ihard=$_ihard" >>$seq.full
+       /usr/etc/edquota $_opt_type -f $_fs -l $id_param=$_id,bsoft=$_bsoft,bhard=$_bhard,isoft=$_isoft,ihard=$_ihard
+    fi
+}
+
+_quota()
+{
+    echo "quota $*" >>$seq.full
+    if [ $HOSTOS = "Linux" ]; then
+       quota $*
+    else
+        # clear -u
+        args=`echo $*|sed -e 's/-u//'`
+       quota -v $args
+    fi
+}
+
+_repquota()
+{
+    echo "repquota $*" >>$seq.full
+    if [ $HOSTOS = "Linux" ]; then
+       repquota $*
+    else
+        # clear -u
+        args=`echo $*|sed -e 's/-u//'`
+       repquota -v $args
+    fi
+}
+
+#-----------------------------------------------------------------------------------
+
 # make sure this script returns success
 /bin/true