diff mbox series

generic/506: fix _require test, use xfs_io vs chattr

Message ID e29cb8b1-5c4f-0cc4-017f-a2303d31a1f6@redhat.com (mailing list archive)
State New, archived
Headers show
Series generic/506: fix _require test, use xfs_io vs chattr | expand

Commit Message

Eric Sandeen May 8, 2020, 3:25 a.m. UTC
_require_prjquota doesn't work on xfs unless the scratch device has
been mounted with project quota, so do that prior to the test.

older chattr/lsattr don't understand project quotas, so use xfs_io
instead for compatibility on older systems.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Comments

Christoph Hellwig May 8, 2020, 12:04 p.m. UTC | #1
On Thu, May 07, 2020 at 10:25:51PM -0500, Eric Sandeen wrote:
> _require_prjquota doesn't work on xfs unless the scratch device has
> been mounted with project quota, so do that prior to the test.
> 
> older chattr/lsattr don't understand project quotas, so use xfs_io
> instead for compatibility on older systems.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/tests/generic/506 b/tests/generic/506
index e8d0ca24..2eb82a03 100755
--- a/tests/generic/506
+++ b/tests/generic/506
@@ -43,15 +43,13 @@  rm -f $seqres.full
 _supported_fs generic
 _supported_os Linux
 
-_require_command "$LSATTR_PROG" lsattr
-_require_command "$CHATTR_PROG" chattr
-
 _require_scratch
 _require_scratch_shutdown
 
 _scratch_mkfs >/dev/null 2>&1
 _require_metadata_journaling $SCRATCH_DEV
-_scratch_mount
+_qmount_option "prjquota"
+_qmount
 _require_prjquota $SCRATCH_DEV
 _scratch_unmount
 
@@ -67,16 +65,16 @@  do_check()
 		sync
 	fi
 
-	$CHATTR_PROG -p 100 $testfile
+	$XFS_IO_PROG -x -c "chproj 100" $testfile
 
-	before=`$LSATTR_PROG -p $testfile`
+	before=`$XFS_IO_PROG -x -c "lsproj" $testfile`
 
 	$XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
 
 	_scratch_shutdown | tee -a $seqres.full
 	_scratch_cycle_mount
 
-	after=`$LSATTR_PROG -p $testfile`
+	after=`$XFS_IO_PROG -x -c "lsproj" $testfile`
 
 	# check inode's project quota id
 	if [ "$before" != "$after" ]; then