common/btrfs: don't skip the test if BTRFS_PROFILE_CONFIGS contains unsupported profile
authorQu Wenruo <wqu@suse.com>
Tue, 8 Mar 2022 13:03:42 +0000 (21:03 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Apr 2022 15:35:13 +0000 (23:35 +0800)
commit1133ecda69f92cee3875b9f12fb4a1957d97aef1
treec52e4c216ee6ae061f337220e9cfbd91eedfd9df
parent7834a74058c2543aa3d85465a5e52c9af7b2ab91
common/btrfs: don't skip the test if BTRFS_PROFILE_CONFIGS contains unsupported profile

[BUG]
Sometimes the tester wants to use $BTRFS_PROFILE_CONFIGS to limit the
tests to certain profiles.

This is especially useful for btrfs subpage tests, as we don't yet
support RAID56 for it yet.

But unfortunately, if we specify $BTRFS_PROFILE_CONFIGS with the
following content:

 export BTRFS_PROFILE_CONFIGS="single:single dup:single raid0:raid0 \
       raid1:raid1 raid10:raid10"

A lot of tests will not run, like:

  btrfs/064 30s ... [not run] Profile dup not supported for replace
  btrfs/065 26s ... [not run] Profile dup not supported for replace
  btrfs/066 27s ...  14s
  btrfs/069 25s ... [not run] Profile dup not supported for replace
  btrfs/070 59s ... [not run] Profile dup not supported for replace
  btrfs/071 25s ... [not run] Profile dup not supported for replace

[CAUSE]
Those test cases uses _btrfs_get_profile_configs() to grab the profiles
which support given workload (like replace/repace-missing).

But _btrfs_get_profile_configs() will behave different based on whether
BTRFS_PROFILE_CONFIGS is defined.

If not defined, it goes with default profiles, and just skip those
unsupported.
This is what we want.

But if the environment variable is defined, it will not run if there is
any unsupported profile in it.

[FIX]
Unify the behaivor by always skip the unsupported profiles, no matter if
$BTRFS_PROFILE_CONFIGS is defined or not.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/btrfs