aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiyang Ruan <ruansy.fnst@fujitsu.com>2021-12-14 16:19:02 +0800
committerEryu Guan <guaneryu@gmail.com>2021-12-25 21:02:48 +0800
commitac3fcc16d29886663e11da04533cb49d764b5b24 (patch)
treed39785b62ed140b5ceb7043f1ada5806f58b716e
parent0405a0a3941ca4c365e3fbba9801d7d2ff7b9bbe (diff)
downloadxfstests-dev-ac3fcc16d29886663e11da04533cb49d764b5b24.tar.gz
common/rc: introduce _require_scratch_delalloc()
Check whether delalloc is supported on current device. Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r--common/rc13
-rwxr-xr-xtests/generic/1941
-rwxr-xr-xtests/generic/1951
-rwxr-xr-xtests/generic/1991
-rwxr-xr-xtests/generic/2001
-rwxr-xr-xtests/generic/2931
-rwxr-xr-xtests/generic/2951
-rwxr-xr-xtests/generic/5401
-rwxr-xr-xtests/generic/5411
-rwxr-xr-xtests/generic/5421
-rwxr-xr-xtests/generic/5431
-rwxr-xr-xtests/xfs/17212
-rwxr-xr-xtests/xfs/2231
-rwxr-xr-xtests/xfs/2241
-rwxr-xr-xtests/xfs/2281
-rwxr-xr-xtests/xfs/2301
-rwxr-xr-xtests/xfs/2571
-rwxr-xr-xtests/xfs/2581
18 files changed, 30 insertions, 11 deletions
diff --git a/common/rc b/common/rc
index 7973ceb5fd..a419b3ba53 100644
--- a/common/rc
+++ b/common/rc
@@ -1748,6 +1748,19 @@ _require_scratch_16T_support()
esac
}
+# Require scratch fs supports delay allocation.
+_require_scratch_delalloc()
+{
+ _require_command "$FILEFRAG_PROG" filefrag
+
+ _scratch_mkfs > $seqres.full
+ _scratch_mount
+ $XFS_IO_PROG -f -c 'pwrite 0 64k' $SCRATCH_MNT/testy &> /dev/null
+ $FILEFRAG_PROG -v $SCRATCH_MNT/testy 2>&1 | grep -q delalloc || \
+ _notrun "test requires delayed allocation buffered writes"
+ _scratch_unmount
+}
+
# this test needs a test partition - check we're ok & mount it
#
_require_test()
diff --git a/tests/generic/194 b/tests/generic/194
index ce8c31ac1c..ff76438d85 100755
--- a/tests/generic/194
+++ b/tests/generic/194
@@ -28,6 +28,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_odirect
diff --git a/tests/generic/195 b/tests/generic/195
index da502c391b..e087b99cbf 100755
--- a/tests/generic/195
+++ b/tests/generic/195
@@ -28,6 +28,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
diff --git a/tests/generic/199 b/tests/generic/199
index ab13f58edd..2a8cafcc46 100755
--- a/tests/generic/199
+++ b/tests/generic/199
@@ -31,6 +31,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "fpunch"
_require_cp_reflink
diff --git a/tests/generic/200 b/tests/generic/200
index deadfeaa89..a1a78ef40f 100755
--- a/tests/generic/200
+++ b/tests/generic/200
@@ -31,6 +31,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "fpunch"
_require_cp_reflink
diff --git a/tests/generic/293 b/tests/generic/293
index 74231b4d9a..0f1d841608 100755
--- a/tests/generic/293
+++ b/tests/generic/293
@@ -24,6 +24,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
diff --git a/tests/generic/295 b/tests/generic/295
index b921c79baf..f66c180540 100755
--- a/tests/generic/295
+++ b/tests/generic/295
@@ -24,6 +24,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_odirect
diff --git a/tests/generic/540 b/tests/generic/540
index 69cf635fc1..38e00f97e6 100755
--- a/tests/generic/540
+++ b/tests/generic/540
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
diff --git a/tests/generic/541 b/tests/generic/541
index 925f346e9f..89b2adadef 100755
--- a/tests/generic/541
+++ b/tests/generic/541
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
diff --git a/tests/generic/542 b/tests/generic/542
index e3e627a8b8..e7682f593e 100755
--- a/tests/generic/542
+++ b/tests/generic/542
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
diff --git a/tests/generic/543 b/tests/generic/543
index 047bedd5e0..624cfc4108 100755
--- a/tests/generic/543
+++ b/tests/generic/543
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
diff --git a/tests/xfs/172 b/tests/xfs/172
index c049530536..56c2583b9d 100755
--- a/tests/xfs/172
+++ b/tests/xfs/172
@@ -16,7 +16,6 @@ _begin_fstest rw filestreams
# real QA test starts here
_supported_fs xfs
-_require_command "$FILEFRAG_PROG" filefrag
_require_scratch
# The first _test_streams call sets up the filestreams allocator to fail and
@@ -36,16 +35,7 @@ _require_scratch
# rescan thresholds and will keep pushing out the expiration time, with the
# result that the filestreams allocator succeeds in maintaining the streams.
# The test considers this a failure.
-#
-# Make sure that a regular buffered write produces delalloc reservations.
-# This effectively disables the test for files with extent size hints or DAX
-# mode set.
-_scratch_mkfs > $seqres.full
-_scratch_mount
-$XFS_IO_PROG -f -c 'pwrite 0 64k' $SCRATCH_MNT/testy &> /dev/null
-$FILEFRAG_PROG -v $SCRATCH_MNT/testy 2>&1 | grep -q delalloc || \
- _notrun "test requires delayed allocation buffered writes"
-_scratch_unmount
+_require_scratch_delalloc
_check_filestreams_support || _notrun "filestreams not available"
diff --git a/tests/xfs/223 b/tests/xfs/223
index f002f1de6b..11dbad14d8 100755
--- a/tests/xfs/223
+++ b/tests/xfs/223
@@ -22,6 +22,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_odirect
diff --git a/tests/xfs/224 b/tests/xfs/224
index 11a54fa353..f8bab07ee6 100755
--- a/tests/xfs/224
+++ b/tests/xfs/224
@@ -22,6 +22,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
diff --git a/tests/xfs/228 b/tests/xfs/228
index 5c644c0f98..f2f2f6a92d 100755
--- a/tests/xfs/228
+++ b/tests/xfs/228
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone punch
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "fpunch"
diff --git a/tests/xfs/230 b/tests/xfs/230
index 53e8dd78f3..15f6b6849c 100755
--- a/tests/xfs/230
+++ b/tests/xfs/230
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone punch
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "fpunch"
diff --git a/tests/xfs/257 b/tests/xfs/257
index acd55c2202..6a58f0ac70 100755
--- a/tests/xfs/257
+++ b/tests/xfs/257
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
diff --git a/tests/xfs/258 b/tests/xfs/258
index 25e8eb605d..2865cdf9cd 100755
--- a/tests/xfs/258
+++ b/tests/xfs/258
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_odirect