btrfs/011: use $_btrfs_profile_configs to limit the tests
PATCH 1/1 btrfs/011: use $_btrfs_profile_configs to limit the tests
Generally the tester need BTRFS_PROFILE_CONFIGS to test certain profiles. For example, skip raid56 as it's not supported.
--- tests/btrfs/011 | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-)
tests/btrfs/011 +38 -10
@@ -22,6 +22,8 @@ . ./common/preamble _begin_fstest auto replace volume +_btrfs_get_profile_configs + noise_pid=0 # Override the default cleanup function.
@@ -237,18 +239,44 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 +if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single" ]]; then + workout "-m single -d single" 1 no 64 +fi + # Mixed BG & RAID/DUP profiles are not supported on zoned btrfs if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 + if [[ "${_btrfs_profile_configs[@]}" =~ "-m dup -d single" ]]; then + workout "-m dup -d single" 1 no 64 + workout "-m dup -d single" 1 cancel 1024 + fi + + if [[ "${_btrfs_profile_configs[@]}" =~ "-m raid0 -d raid0" ]]; then + workout "-m raid0 -d raid0" 2 no 64 + fi + + if [[ "${_btrfs_profile_configs[@]}" =~ "-m raid1 -d raid1" ]]; then + workout "-m raid1 -d raid1" 2 no 2048 + fi + + if [[ "${_btrfs_profile_configs[@]}" =~ "-m raid10 -d raid10" ]]; then + workout "-m raid10 -d raid10" 4 no 64 + fi + + if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single" ]]; then + workout "-m single -d single -M" 1 no 64 + fi + + if [[ "${_btrfs_profile_configs[@]}" =~ "-m dup -d dup" ]]; then + workout "-m dup -d dup -M" 1 no 64 + fi + + if [[ "${_btrfs_profile_configs[@]}" =~ "-m raid5 -d raid5" ]]; then + workout "-m raid5 -d raid5" 2 no 64 + fi + + if [[ "${_btrfs_profile_configs[@]}" =~ "-m raid6 -d raid6" ]]; then + workout "-m raid6 -d raid6" 3 no 64 + fi fi echo "*** done"
Signature · 1 line
2.35.3
Hi,
Quoted 17 lines · An Long
Generally the tester need
BTRFS_PROFILE_CONFIGSto test certain profiles. For example, skip raid56 as it's not supported.Signed-off-by An Long <[email protected]>--- tests/btrfs/011 | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-)tests/btrfs/011 +1
-0@@ -22,6 +22,8 @@ . ./common/preamble _begin_fstest auto replace volume +_btrfs_get_profile_configs
...
tests/btrfs/011 btrfs_replace_test() · line 259
Quoted 3 lines
tests/btrfs/011 +3
-0+ if [[ "${_btrfs_profile_configs[@]}" =~ "-m raid1 -d raid1" ]]; then + workout "-m raid1 -d raid1" 2 no 2048 + fi
These regexes aren't anchored, so above could match "-m raid1 -d raid10"
- not a problem given current profiles, but still not ideal.
My preference would be to use a loop for filtering workout parameters against _btrfs_profile_configs, e.g.
for i in "-m single -d single:1 no 64" \
"-m dup -d single:1 no 64" \
"-m dup -d single:1 cancel 1024" \
...; do
# confirm "${i%:*}" is in _btrfs_profile_configs...
workout "${i%:*}" ${i#*:}done
Cheers, David
PATCH v2 1/1 btrfs/011: use $_btrfs_profile_configs to limit the tests
Generally the tester need BTRFS_PROFILE_CONFIGS to test certain profiles. For example, skip raid56 as it's not supported.
--- tests/btrfs/011 | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-)
tests/btrfs/011 +21 -10
@@ -22,6 +22,8 @@ . ./common/preamble _begin_fstest auto replace volume +_btrfs_get_profile_configs + noise_pid=0 # Override the default cleanup function.
@@ -237,18 +239,27 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 +if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single"( |$) ]]; then + workout "-m single -d single" 1 no 64 +fi + # Mixed BG & RAID/DUP profiles are not supported on zoned btrfs if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 + for t in "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi + done fi echo "*** done"
Signature · 1 line
2.35.3
Quoted 13 lines · An Long
Generally the tester need
BTRFS_PROFILE_CONFIGSto test certain profiles. For example, skip raid56 as it's not supported.Signed-off-by An Long <[email protected]>--- tests/btrfs/011 | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-)tests/btrfs/011 +0
-0
tests/btrfs/011 line 26
Quoted 5 lines
tests/btrfs/011 +2
-0@@ -22,6 +22,8 @@ . ./common/preamble _begin_fstest auto replace volume +_btrfs_get_profile_configs +
Do you need to call it such early? I think this helper should be called after "_supported_fs btrfs" at least. Or maybe even after those _require_scratch_* things?
Quoted 44 lines
tests/btrfs/011 +19
-10noise_pid=0 # Override the default cleanup function.@@ -237,18 +239,27 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 +if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single"( |$) ]]; then + workout "-m single -d single" 1 no 64 +fi + # Mixed BG & RAID/DUP profiles are not supported on zoned btrfs if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 + for t in "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi + done fi echo "*** done"Signature · 1 line
2.35.3
PATCH v3 1/1 btrfs/011: use $_btrfs_profile_configs to limit the tests
In reply to David DisseldorpGenerally the tester need BTRFS_PROFILE_CONFIGS to test certain profiles. For example, skip raid56 as it's not supported.
--- tests/btrfs/011 | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
tests/btrfs/011 +20 -10
@@ -47,6 +47,7 @@ _require_scratch_nocheck _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB +_btrfs_get_profile_configs _require_command "$WIPEFS_PROG" wipefs rm -f $tmp.*
@@ -237,18 +238,27 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 +if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single"( |$) ]]; then + workout "-m single -d single" 1 no 64 +fi + # Mixed BG & RAID/DUP profiles are not supported on zoned btrfs if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 + for t in "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi + done fi echo "*** done"
Signature · 1 line
2.35.3
PATCH v4 1/1 btrfs/011: use $_btrfs_profile_configs to limit the tests
In reply to David DisseldorpGenerally the tester need BTRFS_PROFILE_CONFIGS to test certain profiles. For example, skip raid56 as it's not supported.
--- tests/btrfs/011 | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
tests/btrfs/011 +20 -10
@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB _require_command "$WIPEFS_PROG" wipefs +_btrfs_get_profile_configs rm -f $tmp.*
@@ -237,18 +238,27 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 +if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single"( |$) ]]; then + workout "-m single -d single" 1 no 64 +fi + # Mixed BG & RAID/DUP profiles are not supported on zoned btrfs if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 + for t in "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi + done fi echo "*** done"
Signature · 1 line
2.35.3
Hi,
Quoted 37 lines · An Long
Generally the tester need
BTRFS_PROFILE_CONFIGSto test certain profiles. For example, skip raid56 as it's not supported.Signed-off-by An Long <[email protected]>--- tests/btrfs/011 | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)tests/btrfs/011 +5
-7@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB _require_command "$WIPEFS_PROG" wipefs +_btrfs_get_profile_configs rm -f $tmp.*@@ -237,18 +238,27 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 +if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single"( |$) ]]; then + workout "-m single -d single" 1 no 64 +fi + # Mixed BG & RAID/DUP profiles are not supported on zoned btrfs if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64
tests/btrfs/011 btrfs_replace_test() · line 253
Quoted 10 lines
tests/btrfs/011 +7
-3- workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 + for t in "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \
This dup/dup case no longer gets run with a default _btrfs_profile_configs[]. Is that intentional?
Cheers, David
Quoted 56 lines · David Disseldorp
Hi,
Quoted 40 lines · An Long
Generally the tester need
BTRFS_PROFILE_CONFIGSto test certain profiles. For example, skip raid56 as it's not supported.Signed-off-by An Long <[email protected]>---
tests/btrfs/011 | 30 ++++++++++++++++++++----------1 file changed, 20 insertions(+), 10 deletions(-)tests/btrfs/011 +0
-0@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5_require_scratch_dev_pool_equal_size
_require_scratch_size $((10 * 1024 * 1024)) #kB
_require_command "$WIPEFS_PROG" wipefs
+_btrfs_get_profile_configs
rm -f $tmp.*tests/btrfs/011 +0
-0@@ -237,18 +238,27 @@ btrfs_replace_test()fi
}tests/btrfs/011 +1
-1-workout "-m single -d single" 1 no 64 +if [[ "${_btrfs_profile_configs[@]}" =~ "-m single -d single"( |$)]]; then
+ workout "-m single -d single" 1 no 64tests/btrfs/011 +2
-0+fi +# Mixed BG & RAID/DUP profiles are not supported on zoned btrfs if !
_scratch_btrfs_is_zoned; then
- workout "-m dup -d single" 1 no 64
- workout "-m dup -d single" 1 cancel 1024
- workout "-m raid0 -d raid0" 2 no 64
- workout "-m raid1 -d raid1" 2 no 2048
- workout "-m raid10 -d raid10" 4 no 64
- workout "-m single -d single -M" 1 no 64
- workout "-m dup -d dup -M" 1 no 64
- workout "-m raid5 -d raid5" 2 no 64Quoted 8 lines
- workout "-m raid6 -d raid6" 3 no 64 + for t in "-m dup -d single:1 no 64" \
+ "-m dup -d single:1 cancel 1024" \
+ "-m raid0 -d raid0:2 no 64" \
+ "-m raid1 -d raid1:2 no 2048" \
+ "-m raid10 -d raid10:4 no 64" \
+ "-m single -d single -M:1 no 64" \
+ "-m dup -d dup -M:1 no 64" \This dup/dup case no longer gets run with a default _btrfs_profile_configs[]. Is that intentional?
Quoted 1 line
Cheers, David
I thought profiles from "BTRFS_PROFILE_CONFIGS" should be fine. But this really changed behavior with default configs, and will get worse if use "_btrfs_profile_configs replace".
In a brief, I just need a way to limit tests. If the default config is not
suitable, how about using a new argument to "_btrfs_get_profile_configs"?
Thanks,
An Long
Hi,
On Fri, 20 Jan 2023 15:59:02 +0000, Long An wrote:
...
Quoted 7 lines
Quoted 6 lines
Quoted 1 line
+ "-m dup -d dup -M:1 no 64" \
This dup/dup case no longer gets run with a default _btrfs_profile_configs[]. Is that intentional?
Cheers, David
Quoted 8 lines
I thought profiles from "
BTRFS_PROFILE_CONFIGS" should be fine. But this really changed behavior with default configs, and will get worse if use "_btrfs_profile_configsreplace".In a brief, I just need a way to limit tests. If the default config is not
suitable, how about using a new argument to "_btrfs_get_profile_configs"?
Yes, a new parameter for _btrfs_get_profile_configs() which adds the missing "dup:dup" entry sounds reasonable.
Cheers, David
PATCH v5 1/1 btrfs/011: use $_btrfs_profile_configs to limit the tests
In reply to David DisseldorpGenerally the tester need BTRFS_PROFILE_CONFIGS to test certain profiles. For example, skip raid56 as it's not supported.
For dup profile, add dup to default profile configs
--- common/btrfs | 6 ++++++ tests/btrfs/011 | 30 +++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-)
common/btrfs +6 -0
@@ -213,6 +213,12 @@ _btrfs_get_profile_configs() "raid5:raid5" "raid6:raid6" ) + if [ "$1" == "dup" ]; then + configs=( + ${configs[*]} + "dup:dup" + ) + fi else # User-provided configurations. local configs=(${BTRFS_PROFILE_CONFIGS[@]})
tests/btrfs/011 +17 -13
@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB _require_command "$WIPEFS_PROG" wipefs +_btrfs_get_profile_configs dup rm -f $tmp.*
@@ -237,19 +238,22 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 -# Mixed BG & RAID/DUP profiles are not supported on zoned btrfs -if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 -fi +for t in "-m single -d single:1 no 64" \ + "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi +done echo "*** done" status=0
Signature · 1 line
2.35.3
Hi,
Quoted 16 lines · An Long
Generally the tester need
BTRFS_PROFILE_CONFIGSto test certain profiles. For example, skip raid56 as it's not supported.For dup profile, add dup to default profile configs
Signed-off-by An Long <[email protected]>--- common/btrfs | 6 ++++++ tests/btrfs/011 | 30 +++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-)common/btrfs +0
-0
common/btrfs _btrfs_get_profile_configs() · line 221
Quoted 9 lines
common/btrfs +6
-0@@ -213,6 +213,12 @@ _btrfs_get_profile_configs() "raid5:raid5" "raid6:raid6" ) + if [ "$1" == "dup" ]; then + configs=( + ${configs[*]} + "dup:dup" + ) + fi
nit: configs+=("dup:dup") can be used for appending to bash arrays.
Quoted 41 lines
common/btrfs +0
-0else # User-provided configurations. local configs=(${BTRFS_PROFILE_CONFIGS[@]})tests/btrfs/011 +10
-13@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB _require_command "$WIPEFS_PROG" wipefs +_btrfs_get_profile_configs dup rm -f $tmp.*@@ -237,19 +238,22 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 -# Mixed BG & RAID/DUP profiles are not supported on zoned btrfs -if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 -fi +for t in "-m single -d single:1 no 64" \ + "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \
tests/btrfs/011 btrfs_replace_test() · line 259
Quoted 10 lines
tests/btrfs/011 +7
-0+ "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi +done echo "*** done" status=0
With the minor nit above fixed, feel free to add:
Quoted 86 lines · David Disseldorp
Hi,
Quoted 17 lines · An Long
Generally the tester need
BTRFS_PROFILE_CONFIGSto test certain profiles. For example, skip raid56 as it's not supported.For dup profile, add dup to default profile configs
Signed-off-by An Long <[email protected]>---
common/btrfs | 6 ++++++
tests/btrfs/011 | 30 +++++++++++++++++-------------2 files changed, 23 insertions(+), 13 deletions(-)common/btrfs +0
-0@@ -213,6 +213,12 @@ _btrfs_get_profile_configs()"raid5:raid5"
Quoted 8 lines
"raid6:raid6"
)
+ if [ "$1" == "dup" ]; then
+ configs=(
+ ${configs[*]}
+ "dup:dup"
+ )
+ finit: configs+=("dup:dup") can be used for appending to bash arrays.
Quoted 45 lines
else
# User-provided configurations. local configs=(${BTRFS_PROFILE_CONFIGS[@]})tests/btrfs/011 +0
-0@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5_require_scratch_dev_pool_equal_size
_require_scratch_size $((10 * 1024 * 1024)) #kB
_require_command "$WIPEFS_PROG" wipefs
+_btrfs_get_profile_configs dup
rm -f $tmp.*tests/btrfs/011 +0
-0@@ -237,19 +238,22 @@ btrfs_replace_test()fi
}tests/btrfs/011 +13
-13-workout "-m single -d single" 1 no 64 -# Mixed BG & RAID/DUP profiles are not supported on zoned btrfs -if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 -fi +for t in "-m single -d single:1 no 64" \ + "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -Quoted 7 lines
M}"( |$) ]]; then
+ workout "$mkfs_option" $workout_option + fi
+done
echo "*** done"
status=0With the minor nit above fixed, feel free to add:
Quoted 1 line
Reviewed-by David Disseldorp <[email protected]>
Thanks David! It's really a elegance way for appending.
PATCH v6 1/1 btrfs/011: use $_btrfs_profile_configs to limit the tests
In reply to David DisseldorpGenerally the tester need BTRFS_PROFILE_CONFIGS to test certain profeils. For example, skip raid56 as it's not supported.
For dup profile, add dup to default profile configs.
--- common/btrfs | 3 +++ tests/btrfs/011 | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-)
common/btrfs +3 -0
@@ -213,6 +213,9 @@ _btrfs_get_profile_configs() "raid5:raid5" "raid6:raid6" ) + if [ "$1" == "dup" ]; then + configs+=("dup:dup") + fi else # User-provided configurations. local configs=(${BTRFS_PROFILE_CONFIGS[@]})
tests/btrfs/011 +17 -13
@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB _require_command "$WIPEFS_PROG" wipefs +_btrfs_get_profile_configs dup rm -f $tmp.*
@@ -237,19 +238,22 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 -# Mixed BG & RAID/DUP profiles are not supported on zoned btrfs -if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 -fi +for t in "-m single -d single:1 no 64" \ + "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi +done echo "*** done" status=0
Signature · 1 line
2.35.3
Quoted 7 lines · An Long
Generally the tester need
BTRFS_PROFILE_CONFIGSto test certain profeils. For example, skip raid56 as it's not supported.For dup profile, add dup to default profile configs.
Signed-off-by An Long <[email protected]>---
David has given his RVB to V5 patch, so if no other review points, I'll merge this patch with:
Quoted 69 lines
common/btrfs | 3 +++ tests/btrfs/011 | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-)common/btrfs +3
-0@@ -213,6 +213,9 @@ _btrfs_get_profile_configs() "raid5:raid5" "raid6:raid6" ) + if [ "$1" == "dup" ]; then + configs+=("dup:dup") + fi else # User-provided configurations. local configs=(${BTRFS_PROFILE_CONFIGS[@]})tests/btrfs/011 +17
-13@@ -48,6 +48,7 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB _require_command "$WIPEFS_PROG" wipefs +_btrfs_get_profile_configs dup rm -f $tmp.*@@ -237,19 +238,22 @@ btrfs_replace_test() fi } -workout "-m single -d single" 1 no 64 -# Mixed BG & RAID/DUP profiles are not supported on zoned btrfs -if ! _scratch_btrfs_is_zoned; then - workout "-m dup -d single" 1 no 64 - workout "-m dup -d single" 1 cancel 1024 - workout "-m raid0 -d raid0" 2 no 64 - workout "-m raid1 -d raid1" 2 no 2048 - workout "-m raid10 -d raid10" 4 no 64 - workout "-m single -d single -M" 1 no 64 - workout "-m dup -d dup -M" 1 no 64 - workout "-m raid5 -d raid5" 2 no 64 - workout "-m raid6 -d raid6" 3 no 64 -fi +for t in "-m single -d single:1 no 64" \ + "-m dup -d single:1 no 64" \ + "-m dup -d single:1 cancel 1024" \ + "-m raid0 -d raid0:2 no 64" \ + "-m raid1 -d raid1:2 no 2048" \ + "-m raid10 -d raid10:4 no 64" \ + "-m single -d single -M:1 no 64" \ + "-m dup -d dup -M:1 no 64" \ + "-m raid5 -d raid5:2 no 64" \ + "-m raid6 -d raid6:3 no 64"; do + mkfs_option=${t%:*} + workout_option=${t#*:} + if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then + workout "$mkfs_option" $workout_option + fi +done echo "*** done" status=0Signature · 1 line
2.35.3