]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs: fix quota detection in fuzz tests
authorDarrick J. Wong <djwong@kernel.org>
Wed, 27 Nov 2024 21:01:15 +0000 (13:01 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 23 Jan 2025 21:19:56 +0000 (13:19 -0800)
With metadir, quota options persist until they are changed by mount
options.  Therefore, we can set the quota flags in MKFS_OPTIONS and
needn't supply them in MOUNT_OPTIONS.  Unfortunately, this means that we
cannot grep the MOUNT_OPTIONS anymore; we must mount the fs and run
src/feature to determine if quotas are enabled.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
12 files changed:
tests/xfs/425
tests/xfs/426
tests/xfs/427
tests/xfs/428
tests/xfs/429
tests/xfs/430
tests/xfs/487
tests/xfs/488
tests/xfs/489
tests/xfs/779
tests/xfs/780
tests/xfs/781

index 7ad53f97a6940c69876327a153779c160c2a11a6..77f86bcc398312f8fe4917fbf4d232a1ad344097 100755 (executable)
@@ -23,7 +23,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'usrquota' || _notrun "user quota disabled"
+
+_scratch_mount
+$here/src/feature -U $SCRATCH_DEV || _notrun "user quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index 53bfd0d637fcb5475acfe78f2cd1bb0349c4b22a..80f572eb8068a2ae5459929ed67b36c103190d66 100755 (executable)
@@ -23,7 +23,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'usrquota' || _notrun "user quota disabled"
+
+_scratch_mount
+$here/src/feature -U $SCRATCH_DEV || _notrun "user quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index 38de1360af62629568ccb00cb37ce687aa9a0325..48b8d5e935abfede6bf0527fdec5e9c6479c98b1 100755 (executable)
@@ -23,7 +23,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'grpquota' || _notrun "group quota disabled"
+
+_scratch_mount
+$here/src/feature -G $SCRATCH_DEV || _notrun "group quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index e112ccf84646c19c999aa23b890e26a8e7fbaea4..f87f0a98bae3e9fc726655bd918877a82e8fc22f 100755 (executable)
@@ -23,7 +23,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'grpquota' || _notrun "group quota disabled"
+
+_scratch_mount
+$here/src/feature -G $SCRATCH_DEV || _notrun "group quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index ded8c3944a2648481a533ef3e632170716d42081..426e716aa079bf384debfdf483252fe05c694370 100755 (executable)
@@ -23,7 +23,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'prjquota' || _notrun "project quota disabled"
+
+_scratch_mount
+$here/src/feature -P $SCRATCH_DEV || _notrun "project quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index 3e6527851069a9b54cb9b28650beb14afcb9e3b0..b3a2c6dd1a5f6a04eb66140a8c45045b4abd3149 100755 (executable)
@@ -23,7 +23,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'prjquota' || _notrun "project quota disabled"
+
+_scratch_mount
+$here/src/feature -P $SCRATCH_DEV || _notrun "project quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index 0a5403a25dfd828b39044e031cea3e994c958b83..809a4c6fd621cd06014ed7c28cb9469cb93c1eb1 100755 (executable)
@@ -24,7 +24,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'usrquota' || _notrun "user quota disabled"
+
+_scratch_mount
+$here/src/feature -U $SCRATCH_DEV || _notrun "user quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index 0e67889f26f7a0d31b5d81a14b8ace1665275fd1..a8144c9ce39b910619c449f3a9545890d1d94651 100755 (executable)
@@ -24,7 +24,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'grpquota' || _notrun "group quota disabled"
+
+_scratch_mount
+$here/src/feature -G $SCRATCH_DEV || _notrun "group quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index ef65525c224764ad4b15e5eb6fe089679eaf6417..cb24b444bcc919da68c86ea5da354cfb63616e4d 100755 (executable)
@@ -24,7 +24,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'prjquota' || _notrun "project quota disabled"
+
+_scratch_mount
+$here/src/feature -P $SCRATCH_DEV || _notrun "project quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index acce522995c693f9296fa6951982054e3dbd53b6..e1e44c1928c67bdf28572e87d1ccd11bdb14f1d5 100755 (executable)
@@ -25,7 +25,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'usrquota' || _notrun "user quota disabled"
+
+_scratch_mount
+$here/src/feature -U $SCRATCH_DEV || _notrunn "user quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index efcbeb8e1473535b3ebbd25e893112791367f009..ebd25f8a13bab45138698da343b97085e82c3fff 100755 (executable)
@@ -25,7 +25,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'grpquota' || _notrun "group quota disabled"
+
+_scratch_mount
+$here/src/feature -G $SCRATCH_DEV || _notrun "group quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids
 
index 09d63bfeceb6e789056411cfc20c9978f52196a2..49920cd1215ec1644173ab31c890806bef208753 100755 (executable)
@@ -25,7 +25,10 @@ _require_quota
 
 echo "Format and populate"
 _scratch_populate_cached nofill > $seqres.full 2>&1
-echo "${MOUNT_OPTIONS}" | grep -q 'prjquota' || _notrun "project quota disabled"
+
+_scratch_mount
+$here/src/feature -P $SCRATCH_DEV || _notrun "project quota disabled"
+_scratch_unmount
 
 _scratch_xfs_set_quota_fuzz_ids