]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/746: clean up fs support
authorChristoph Hellwig <hch@lst.de>
Sun, 23 Jun 2024 12:10:36 +0000 (14:10 +0200)
committerZorro Lang <zlang@kernel.org>
Fri, 12 Jul 2024 19:05:34 +0000 (03:05 +0800)
Use a single case statement for fs-specific options and to check if
this test is supported at all.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/746

index 0e6387fe4d5ece01e540c20aafc17025bdc85892..b13fd98a185b42e7875e4744c674494d641485b4 100755 (executable)
@@ -9,23 +9,32 @@
 . ./common/preamble
 _begin_fstest auto trim fiemap
 
-_supported_fs ext4 xfs btrfs
+_supported_fs generic
 _require_test
 _require_loop
 _require_fstrim
 _require_xfs_io_command "fiemap"
-if [ "$FSTYP" = "btrfs" ]; then
+
+_require_fs_space $TEST_DIR 307200
+fssize=$(_small_fs_size_mb 300)           # 200m phys/virt size
+
+case "$FSTYP" in
+btrfs)
+       _require_btrfs_command inspect-internal dump-super
+       _require_btrfs_command inspect-internal dump-tree
+
        # 3g for btrfs to have distinct bgs
        _require_fs_space $TEST_DIR 3145728
        fssize=3000
-else
-       _require_fs_space $TEST_DIR 307200
-       fssize=$(_small_fs_size_mb 300)           # 200m phys/virt size
-fi
-
-[ "$FSTYP" = "ext4" ] && _require_dumpe2fs
-[ "$FSTYP" = "btrfs" ] && _require_btrfs_command inspect-internal dump-super
-[ "$FSTYP" = "btrfs" ] && _require_btrfs_command inspect-internal dump-tree
+       ;;
+ext4)
+       _require_dumpe2fs
+       ;;
+xfs)
+       ;;
+*)
+       _notrun "Requires fs-specific way to check discard ranges"
+esac
 
 # Override the default cleanup function.
 _cleanup()