]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: update tests to skip unsupported raid profile types
authorJosef Bacik <josef@toxicpanda.com>
Fri, 5 Apr 2024 19:56:14 +0000 (15:56 -0400)
committerZorro Lang <zlang@kernel.org>
Sun, 28 Apr 2024 11:08:22 +0000 (19:08 +0800)
Tests btrfs/197, btrfs/198, and btrfs/297 test multiple raid types in
their workout() function.  We may not support some of the raid types, so
add a check in the workout() function to skip any incompatible raid
profiles.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
tests/btrfs/197
tests/btrfs/198
tests/btrfs/297

index 2ce41b3261986b6ad543c2a44ba22c0f9e529eb6..9ec4e9f052baffc6ef703231bd662ad50543b04d 100755 (executable)
@@ -30,14 +30,20 @@ _supported_fs btrfs
 _require_test
 _require_scratch
 _require_scratch_dev_pool 5
-# Zoned btrfs only supports SINGLE profile
-_require_non_zoned_device ${SCRATCH_DEV}
+# We require at least one raid setup, raid1 is the easiest, use this to gate on
+# wether or not we run this test
+_require_btrfs_raid_type raid1
 
 workout()
 {
        raid=$1
        device_nr=$2
 
+       if ! _check_btrfs_raid_type $raid; then
+               echo "$raid isn't supported, skipping" >> $seqres.full
+               return
+       fi
+
        echo $raid >> $seqres.full
        _scratch_dev_pool_get $device_nr
        _spare_dev_get
index a326a8ca48e5237e08a0ad4a55cb8e2fc659a292..c5a8f39217d3a04bdfd7218fc0be687131f23185 100755 (executable)
@@ -18,8 +18,9 @@ _supported_fs btrfs
 _require_command "$WIPEFS_PROG" wipefs
 _require_scratch
 _require_scratch_dev_pool 4
-# Zoned btrfs only supports SINGLE profile
-_require_non_zoned_device ${SCRATCH_DEV}
+# We require at least one raid setup, raid1 is the easiest, use this to gate on
+# wether or not we run this test
+_require_btrfs_raid_type raid1
 _fixed_by_kernel_commit 96c2e067ed3e3e \
        "btrfs: skip devices without magic signature when mounting"
 
@@ -28,6 +29,11 @@ workout()
        raid=$1
        device_nr=$2
 
+       if ! _check_btrfs_raid_type $raid; then
+               echo "$raid isn't supported, skipping" >> $seqres.full
+               return
+       fi
+
        echo $raid >> $seqres.full
        _scratch_dev_pool_get $device_nr
 
index a002386152b7e2ba0b90cc23c8f3132a5ae06d11..7afe854dce7ab87f5f05243558bdb1e564ab36c3 100755 (executable)
@@ -18,11 +18,21 @@ _require_scratch_dev_pool 3
 _fixed_by_kernel_commit 486c737f7fdc \
        "btrfs: raid56: always verify the P/Q contents for scrub"
 
+# If neither raid5 or raid6 are supported do _notrun
+if ! _check_btrfs_raid_type raid5 && ! _check_btrfs_raid_type raid6; then
+       _notrun "requires either raid5 or raid6 support"
+fi
+
 workload()
 {
        local profile=$1
        local nr_devs=$2
 
+       if ! _check_btrfs_raid_type $profile; then
+               echo "$profile isn't supported, skipping" >> $seqres.full
+               return
+       fi
+
        echo "=== Testing $nr_devs devices $profile ===" >> $seqres.full
        _scratch_dev_pool_get $nr_devs