@@ -1766,30 +1766,16 @@ _fail()
exit 1
}
-# tests whether $FSTYP is one of the supported filesystems for a test
#
-_check_supported_fs()
-{
- local res=1
- local f
-
- for f; do
- # ^FS means black listed fs
- if [ "$f" = "^$FSTYP" ]; then
- return 1
- elif [ "$f" = "generic" ] || [[ "$f" == "^"* ]]; then
- # ^FS implies "generic ^FS"
- res=0
- elif [ "$f" = "$FSTYP" ]; then
- return 0
- fi
- done
- return $res
-}
-
-_supported_fs()
+# Tests whether $FSTYP should be exclude from this test.
+#
+# In general this should be avoided in favor of feature tests, and when this
+# helper has to be used, it should include a comment on why a specific file
+# system is excluded.
+#
+_exclude_fs()
{
- _check_supported_fs $* || \
+ [ "$1" = "$FSTYP" ] && \
_notrun "not suitable for this filesystem type: $FSTYP"
}
@@ -29,7 +29,7 @@ _cleanup()
# Import common functions.
. ./common/filter
-_supported_fs ^ext2
+_exclude_fs ext2
_require_scratch_nocheck
_require_scratch_shutdown
@@ -15,7 +15,8 @@ _begin_fstest auto quick
# Import common functions.
. ./common/filter
-_supported_fs ^ext2
+_exclude_fs ext2
+
_require_scratch
echo "Silence is golden"
@@ -15,7 +15,7 @@ _begin_fstest auto quick
# Import common functions.
. ./common/filter
-_supported_fs ^ext2
+_exclude_fs ext2
# nofsck as we modify sb via debugfs
_require_scratch_nocheck
@@ -10,9 +10,8 @@
. ./common/preamble
_begin_fstest auto quick
-# Import common functions.
+_exclude_fs ext2
-_supported_fs ^ext2
_require_scratch
_require_command "$DEBUGFS_PROG" debugfs
@@ -56,7 +56,8 @@ chattr_opt: $chattr_opt" >>$seqres.full
done
}
-_supported_fs ^ext2
+_exclude_fs ext2
+
_require_scratch
_exclude_scratch_mount_option dax
@@ -12,7 +12,7 @@ _begin_fstest auto quick
# Import common functions.
. ./common/filter
-_supported_fs ^ext2
+_exclude_fs ext2
_require_scratch
_require_test_program "t_get_file_time"
@@ -28,10 +28,12 @@ _cleanup()
. ./common/filter
. ./common/reflink
+# btrfs can't fragment free space.
+_exclude_fs btrfs
+
+# This test is unreliable on NFS, as it depends on the exported filesystem.
+_exclude_fs nfs
-# btrfs can't fragment free space. This test is unreliable on NFS, as it
-# depends on the exported filesystem.
-_supported_fs ^btrfs ^nfs
_require_scratch_reflink
_require_cp_reflink
_require_xfs_io_command "falloc"
@@ -16,7 +16,7 @@ _begin_fstest auto quick
# NFS will optimize away the on-the-wire lookup before attempting to
# create a new file (since that means an extra round trip).
-_supported_fs ^nfs
+_exclude_fs nfs
_require_scratch
_require_symlinks
@@ -26,7 +26,7 @@ _cleanup()
# For NFS, a reflink is just a CLONE operation, and after that
# point it's dealt with by the server.
-_supported_fs ^nfs
+_exclude_fs nfs
_require_scratch_swapfile
_require_scratch_reflink
@@ -11,7 +11,8 @@
_begin_fstest auto quick
# NFS forbade open with O_APPEND|O_DIRECT
-_supported_fs ^nfs
+_exclude_fs nfs
+
_require_test
_require_odirect
_require_test_program dio-append-buf-fault
@@ -20,7 +20,7 @@ _cleanup()
# Import common functions.
. ./common/filter
-_supported_fs ^nfs
+_exclude_fs nfs
_require_aiodio aio-dio-append-write-read-race
_require_test_program "feature"
@@ -41,7 +41,7 @@ _require_dm_target thin-pool
# and since we've filled the thinp device it'll return EIO, which will make
# btrfs flip read only, making it fail this test when it just won't work right
# for us in the first place.
-_supported_fs ^btrfs
+_exclude_fs btrfs
# Require underlying device support discard
_scratch_mkfs >>$seqres.full 2>&1
@@ -37,8 +37,10 @@ _cleanup()
_require_scratch
_require_attrs trusted
-_supported_fs ^overlay
+
+_exclude_fs overlay
_require_extra_fs overlay
+
_fixed_by_kernel_commit 6da1b4b1ab36 \
"xfs: fix an ABBA deadlock in xfs_rename"
@@ -23,7 +23,7 @@ _require_xfs_io_command "fiemap"
#
# https://lore.kernel.org/linux-btrfs/20220315164011.GF8241@magnolia/
#
-_supported_fs ^xfs
+_exclude_fs xfs
rm -f $seqres.full
@@ -21,8 +21,9 @@ _cleanup()
rm -r -f $tmp.*
}
-_supported_fs ^overlay
+_exclude_fs overlay
_require_extra_fs overlay
+
_require_scratch
_require_chown
_require_idmapped_mounts
@@ -24,7 +24,9 @@ _cleanup()
# This case give a assumption that the same mount options for
# different mount point will share the same superblock, which won't
# sucess for the follow fs.
-_supported_fs ^nfs ^overlay ^tmpfs
+_exclude_fs nfs
+_exclude_fs overlay
+_exclude_fs tmpfs
_require_test
_require_scratch
@@ -14,7 +14,12 @@ _begin_fstest mkfs auto quick
# a bunch of file systems don't support foreign fs detection
# ext* do support it, but disable the feature when called non-interactively
-_supported_fs ^ext2 ^ext3 ^ext4 ^jfs ^ocfs2 ^udf
+_exclude_fs ext2
+_exclude_fs ext3
+_exclude_fs ext4
+_exclude_fs jfs
+_exclude_fs ocfs2
+_exclude_fs udf
_require_block_device "${SCRATCH_DEV}"
# not all the FS support zoned block device
Tests don't require a list of supported file systems, as that is deducted from the test directory name. Instead we exclude specific file systems from a few common tests, and pick the extN variants supported for the ext4 directory. Replace _supported_fs with a new _exclude_fs that takes only a single file systems as the argument, making it easier to explain why the file system is not supported. Signed-off-by: Christoph Hellwig <hch@lst.de> --- common/rc | 30 ++++++++---------------------- tests/ext-common/002 | 2 +- tests/ext-common/036 | 3 ++- tests/ext-common/037 | 2 +- tests/ext-common/038 | 3 +-- tests/ext-common/039 | 3 ++- tests/ext-common/043 | 2 +- tests/generic/187 | 8 +++++--- tests/generic/294 | 2 +- tests/generic/357 | 2 +- tests/generic/362 | 3 ++- tests/generic/465 | 2 +- tests/generic/500 | 2 +- tests/generic/631 | 4 +++- tests/generic/679 | 2 +- tests/generic/699 | 3 ++- tests/generic/732 | 4 +++- tests/generic/740 | 7 ++++++- 18 files changed, 42 insertions(+), 42 deletions(-)