]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
common/btrfs: add a _require_btrfs_no_nodatasum helper
authorFilipe Manana <fdmanana@suse.com>
Wed, 12 Feb 2025 23:35:01 +0000 (23:35 +0000)
committerZorro Lang <zlang@kernel.org>
Fri, 14 Feb 2025 19:20:23 +0000 (03:20 +0800)
Add a _require_btrfs_no_nodatasum helper to skip a test if the nodatasum
mount option is give, as we do have several tests that fail, for several
reasons, when that mount option is passed.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/btrfs

index 5d69ddd825df05b64208fee10350f5e06be2e059..a3b9c12fc9fc41651df1a2ab25f071aabfe3115d 100644 (file)
@@ -134,6 +134,13 @@ _require_btrfs_no_nodatacow()
        fi
 }
 
+_require_btrfs_no_nodatasum()
+{
+       if _normalize_mount_options "$MOUNT_OPTIONS" | grep -q "nodatasum"; then
+               _notrun "This test requires no nodatasum enabled"
+       fi
+}
+
 _require_btrfs_free_space_tree()
 {
        _scratch_mkfs > /dev/null 2>&1