xfs/152: avoid failure when quotaoff is not supported
authorDarrick J. Wong <djwong@kernel.org>
Fri, 23 Jul 2021 05:08:59 +0000 (22:08 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 25 Jul 2021 14:59:45 +0000 (22:59 +0800)
Switch the test that removes the quota files to just disable enforcement
and then unmount the file system as disabling quota accounting is about
to go away.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/152
tests/xfs/152.out

index de85f48..129d9c0 100755 (executable)
@@ -195,8 +195,9 @@ test_enable()
 test_off()
 {
        echo "checking off command (type=$type)"
-       $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
-                       -c "off -$type -v" $SCRATCH_MNT | _filter_scratch
+       _scratch_unmount
+       _qmount_option ""
+       _qmount
 }
 
 test_remove()
@@ -257,6 +258,8 @@ qmount_idmapped()
 
 test_xfs_quota()
 {
+       local quota_options="$1"
+
        # init quota
        echo "init quota limit and timer, and dump it"
        if [ "$idmapped" -eq 1 ]; then
@@ -310,7 +313,10 @@ test_xfs_quota()
        echo ; test_state
        echo ; test_remove
        echo ; test_report -N
-       echo "quota remount"; qmount_idmapped
+       echo "quota remount"
+       _qmount_option "$quota_options"
+       _qmount
+       qmount_idmapped
        echo ; test_report -N
 
        # restore test
@@ -329,7 +335,7 @@ id=$uqid
 id2=$uqid2
 idmapped=0
 qmount_idmapped
-test_xfs_quota
+test_xfs_quota "uquota,sync"
 
 echo "----------------------- uquota,sync,idmapped ---------------------------"
 wipe_scratch
@@ -339,7 +345,7 @@ id=$uqid
 id2=$uqid2
 idmapped=1
 qmount_idmapped
-test_xfs_quota
+test_xfs_quota "uquota,sync"
 
 echo "----------------------- gquota,sync,unmapped ---------------------------"
 wipe_scratch
@@ -349,7 +355,7 @@ id=$gqid
 id2=$gqid2
 idmapped=0
 qmount_idmapped
-test_xfs_quota
+test_xfs_quota "gquota,sync"
 
 echo "----------------------- gquota,sync,idmapped ---------------------------"
 wipe_scratch
@@ -359,7 +365,7 @@ id=$gqid
 id2=$gqid2
 idmapped=1
 qmount_idmapped
-test_xfs_quota
+test_xfs_quota "gquota,sync"
 
 wipe_mounts
 
index 1fc71fb..b663b09 100644 (file)
@@ -132,7 +132,6 @@ checking quota command (type=u)
 SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
 
 checking off command (type=u)
-User quota are not enabled on SCRATCH_DEV
 
 checking state command (type=u)
 
@@ -296,7 +295,6 @@ checking quota command (type=u)
 SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
 
 checking off command (type=u)
-User quota are not enabled on SCRATCH_DEV
 
 checking state command (type=u)
 
@@ -460,7 +458,6 @@ checking quota command (type=g)
 SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
 
 checking off command (type=g)
-Group quota are not enabled on SCRATCH_DEV
 
 checking state command (type=g)
 
@@ -624,7 +621,6 @@ checking quota command (type=g)
 SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
 
 checking off command (type=g)
-Group quota are not enabled on SCRATCH_DEV
 
 checking state command (type=g)