updates to match top of tree, grpquota support, fix output to match 3.01
[xfstests-dev.git] / common.quota
index 54b49cfe58f904690e24237419ee50b0dec0bc41..ccedfc62f0c3dfd777f7bd861695610716b44b2b 100644 (file)
 # 
 _require_quota()
 {
-    [ ! -x /usr/sbin/repquota ] && _notrun "Quota user tools not installed"
+    src/feature -q $TEST_DEV
+    [ $? -ne 0 ] && _notrun "Installed kernel does not support XFS quota"
 
-    /usr/sbin/repquota -m -s -a >/dev/null 2>&1
-    [ $? -ne 0 ] && _notrun "Installed quota tools do not support XFS"
+    [ ! -x /sbin/quotaon ] && _notrun "Quota user tools not installed"
 
-    [ ! -f /proc/fs/xfs/xqm ] && _notrun "Kernel does not support XFS quota"
+    /sbin/quotaon -x 2>&1 | grep "option requires an argument -- x" >/dev/null
+    [ $? -ne 0 ] && _notrun "Installed quota tools do not support XFS"
 }
 
 # create a file as a specific user (uid)
@@ -83,9 +84,19 @@ _choose_gid()
 
 _filter_repquota()
 {
-    perl -ne 's/^(\w+)\s+([-|+])/[NAME]    \2/g; print'
+    perl -ne "
+       s/^(\w+)\s+([-|+])/[NAME]    \2/g;
+       s,$SCRATCH_DEV,[DEVICE],g;
+       print"
 }
 
+_qmount()
+{
+    umount $SCRATCH_DEV >/dev/null 2>&1
+    mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "qmount failed"
+    chmod ugo+rwx $SCRATCH_MNT
+    [ -x /usr/sbin/quot ] && quot $SCRATCH_DEV >>$seq.full 2>&1
+}
 
 # make sure this script returns success
 /bin/true