diff mbox series

[03/11] generic/709,710: rework these for exchangerange vs. quota testing

Message ID 171891669159.3034840.3701471459033486232.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/11] misc: split swapext and exchangerange | expand

Commit Message

Darrick J. Wong June 20, 2024, 8:54 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

The exchange-range implementation is now completely separate from the
old swapext ioctl, so let's migrate these quota tests to exchangerange.

There's no point in maintaining these tests for the legacy swapext code
because it returns EINVAL if any quota is enabled and the two files have
different user/group/project ids.  Originally I had forward ported the
old swapext ioctl to use commitrange as its backend, but that will be
dropped in favor of porting xfs_fsr to use commitrange directly.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/709     |   12 ++++++------
 tests/generic/710     |   14 +++++++-------
 tests/generic/710.out |    2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

Comments

Christoph Hellwig June 21, 2024, 4:35 a.m. UTC | #1
Looks good:

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

Patch

diff --git a/tests/generic/709 b/tests/generic/709
index 4fc938bb6a..f3b827cb04 100755
--- a/tests/generic/709
+++ b/tests/generic/709
@@ -4,17 +4,17 @@ 
 #
 # FS QA Test No. 709
 #
-# Can we use swapext to make the quota accounting incorrect?
+# Can we use exchangerange to make the quota accounting incorrect?
 
 . ./common/preamble
-_begin_fstest auto quick fiexchange swapext quota
+_begin_fstest auto quick fiexchange quota
 
 # Import common functions.
 . ./common/filter
 . ./common/quota
 
 # real QA test starts here
-_require_xfs_io_command swapext
+_require_xfs_io_command exchangerange
 _require_user
 _require_nobody
 _require_quota
@@ -32,7 +32,7 @@  chown $qa_user $SCRATCH_MNT/a
 $XFS_IO_PROG -f -c 'pwrite -S 0x59 0 64k -b 64k' -c 'truncate 256k' $SCRATCH_MNT/b >> $seqres.full
 chown nobody $SCRATCH_MNT/b
 
-echo before swapext >> $seqres.full
+echo before exchangerange >> $seqres.full
 $XFS_QUOTA_PROG -x -c 'report -a' $SCRATCH_MNT >> $seqres.full
 stat $SCRATCH_MNT/* >> $seqres.full
 
@@ -40,11 +40,11 @@  stat $SCRATCH_MNT/* >> $seqres.full
 # fail with -EINVAL (since that's what the first kernel fix does) or succeed
 # (because subsequent rewrites can handle quota).  Whatever the outcome, the
 # quota usage check at the end should never show a discrepancy.
-$XFS_IO_PROG -c "swapext $SCRATCH_MNT/b" $SCRATCH_MNT/a &> $tmp.swap
+$XFS_IO_PROG -c "exchangerange $SCRATCH_MNT/b" $SCRATCH_MNT/a &> $tmp.swap
 cat $tmp.swap >> $seqres.full
 grep -v 'Invalid argument' $tmp.swap
 
-echo after swapext >> $seqres.full
+echo after exchangerange >> $seqres.full
 $XFS_QUOTA_PROG -x -c 'report -a' $SCRATCH_MNT >> $seqres.full
 stat $SCRATCH_MNT/* >> $seqres.full
 
diff --git a/tests/generic/710 b/tests/generic/710
index 6c6aa08f63..c344bd898b 100755
--- a/tests/generic/710
+++ b/tests/generic/710
@@ -4,17 +4,17 @@ 
 #
 # FS QA Test No. 710
 #
-# Can we use swapext to exceed the quota enforcement?
+# Can we use exchangerange to exceed the quota enforcement?
 
 . ./common/preamble
-_begin_fstest auto quick fiexchange swapext quota
+_begin_fstest auto quick fiexchange quota
 
 # Import common functions.
 . ./common/filter
 . ./common/quota
 
 # real QA test starts here
-_require_xfs_io_command swapext
+_require_xfs_io_command exchangerange
 _require_user
 _require_nobody
 _require_quota
@@ -35,14 +35,14 @@  chown nobody $SCRATCH_MNT/b
 # Set up a quota limit
 $XFS_QUOTA_PROG -x -c "limit -u bhard=70k nobody" $SCRATCH_MNT
 
-echo before swapext >> $seqres.full
+echo before exchangerange >> $seqres.full
 $XFS_QUOTA_PROG -x -c 'report -a' $SCRATCH_MNT >> $seqres.full
 stat $SCRATCH_MNT/* >> $seqres.full
 
-# Now try to swapext
-$XFS_IO_PROG -c "swapext $SCRATCH_MNT/b" $SCRATCH_MNT/a
+# Now try to exchangerange
+$XFS_IO_PROG -c "exchangerange $SCRATCH_MNT/b" $SCRATCH_MNT/a
 
-echo after swapext >> $seqres.full
+echo after exchangerange >> $seqres.full
 $XFS_QUOTA_PROG -x -c 'report -a' $SCRATCH_MNT >> $seqres.full
 stat $SCRATCH_MNT/* >> $seqres.full
 
diff --git a/tests/generic/710.out b/tests/generic/710.out
index a2aa981919..fcc006c279 100644
--- a/tests/generic/710.out
+++ b/tests/generic/710.out
@@ -1,4 +1,4 @@ 
 QA output created by 710
-swapext: Disk quota exceeded
+exchangerange: Disk quota exceeded
 Comparing user usage
 Comparing group usage