diff mbox series

[2/3] fstests: btrfs/195: skip raid setups not in the profile configs

Message ID c19995ea42066da0eae381b499475c81679c8f0e.1710867187.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series fstests: various RAID56 related fixes for btrfs | expand

Commit Message

Josef Bacik March 19, 2024, 4:55 p.m. UTC
You can specify a custom BTRFS_PROFILE_CONFIGS to skip certain raid
configurations in the tests, however btrfs/195 doesn't honor this
currently.  Fix this up by getting the profile configs and skipping any
configurations that are not listed in BTRFS_PROFILE_CONFIGS.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 tests/btrfs/195 | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Anand Jain March 24, 2024, 2:25 p.m. UTC | #1
On 3/19/24 22:25, Josef Bacik wrote:
> You can specify a custom BTRFS_PROFILE_CONFIGS to skip certain raid
> configurations in the tests, however btrfs/195 doesn't honor this
> currently.  Fix this up by getting the profile configs and skipping any
> configurations that are not listed in BTRFS_PROFILE_CONFIGS.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

This doesn't use _require_btrfs_fs_feature raid56,
so applied. Included for the PR.

Thanks, Anand

> ---
>   tests/btrfs/195 | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/tests/btrfs/195 b/tests/btrfs/195
> index 96cc4134..df8f5ed6 100755
> --- a/tests/btrfs/195
> +++ b/tests/btrfs/195
> @@ -21,6 +21,9 @@ _require_scratch_dev_pool 4
>   # Zoned btrfs only supports SINGLE profile
>   _require_non_zoned_device "${SCRATCH_DEV}"
>   
> +# Load up the available configs
> +_btrfs_get_profile_configs
> +
>   declare -a TEST_VECTORS=(
>   # $nr_dev_min:$data:$metadata:$data_convert:$metadata_convert
>   "4:single:raid1"
> @@ -38,6 +41,11 @@ run_testcase() {
>   	src_type=${args[1]}
>   	dst_type=${args[2]}
>   
> +	if [[ ! "${_btrfs_profile_configs[@]}" =~ "$dst_type" ]]; then
> +		echo "=== Skipping test: $1 ===" >> $seqres.full
> +		return
> +	fi
> +
>   	_scratch_dev_pool_get $num_disks
>   
>   	echo "=== Running test: $1 ===" >> $seqres.full
diff mbox series

Patch

diff --git a/tests/btrfs/195 b/tests/btrfs/195
index 96cc4134..df8f5ed6 100755
--- a/tests/btrfs/195
+++ b/tests/btrfs/195
@@ -21,6 +21,9 @@  _require_scratch_dev_pool 4
 # Zoned btrfs only supports SINGLE profile
 _require_non_zoned_device "${SCRATCH_DEV}"
 
+# Load up the available configs
+_btrfs_get_profile_configs
+
 declare -a TEST_VECTORS=(
 # $nr_dev_min:$data:$metadata:$data_convert:$metadata_convert
 "4:single:raid1"
@@ -38,6 +41,11 @@  run_testcase() {
 	src_type=${args[1]}
 	dst_type=${args[2]}
 
+	if [[ ! "${_btrfs_profile_configs[@]}" =~ "$dst_type" ]]; then
+		echo "=== Skipping test: $1 ===" >> $seqres.full
+		return
+	fi
+
 	_scratch_dev_pool_get $num_disks
 
 	echo "=== Running test: $1 ===" >> $seqres.full