FS/XFS testing framework
 help / color / mirror / Atom feed
From: Long An <lan@suse.com>
To: "ddiss@suse.de" <ddiss@suse.de>
Cc: "fstests@vger.kernel.org" <fstests@vger.kernel.org>
Subject: Re: [PATCH v5] btrfs/011: use $_btrfs_profile_configs to limit the tests
Date: Wed, 15 Feb 2023 05:12:22 +0000	[thread overview]
Message-ID: <dad2d60b89a6dd8298aaf3476ba64adc2c4ef249.camel@suse.com> (raw)
In-Reply-To: <20230214220728.000fd5d9@echidna.fritz.box>

On Tue, 2023-02-14 at 22:07 +0100, David Disseldorp wrote:
> Hi,
> 
> On Tue, 14 Feb 2023 23:30:57 +0800, An Long wrote:
> 
> > Generally 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
> > 
> > Signed-off-by: An Long <lan@suse.com>
> > ---
> >  common/btrfs    |  6 ++++++
> >  tests/btrfs/011 | 30 +++++++++++++++++-------------
> >  2 files changed, 23 insertions(+), 13 deletions(-)
> > 
> > diff --git a/common/btrfs b/common/btrfs
> > index ee673a93..e857a40e 100644
> > --- a/common/btrfs
> > +++ b/common/btrfs
> > @@ -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.
> 
> >         else
> >                 # User-provided configurations.
> >                 local configs=(${BTRFS_PROFILE_CONFIGS[@]})
> > diff --git a/tests/btrfs/011 b/tests/btrfs/011
> > index 6c3d037f..852742ee 100755
> > --- a/tests/btrfs/011
> > +++ b/tests/btrfs/011
> > @@ -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
> 
> With the minor nit above fixed, feel free to add:
> Reviewed-by: David Disseldorp <ddiss@suse.de>

Thanks David! It's really a elegance way for appending.

  reply	other threads:[~2023-02-15  5:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 17:22 [PATCH] btrfs/011: use $_btrfs_profile_configs to limit the tests An Long
2023-01-11 12:18 ` David Disseldorp
2023-01-13 16:35   ` [PATCH v2] " An Long
2023-01-13 18:40     ` Zorro Lang
2023-01-14  3:12   ` [PATCH v3] " An Long
2023-01-14  3:19   ` [PATCH v4] " An Long
2023-01-20 11:49     ` David Disseldorp
2023-01-20 15:59       ` Long An
2023-01-20 17:19         ` David Disseldorp
2023-02-14 15:30   ` [PATCH v5] " An Long
2023-02-14 21:07     ` David Disseldorp
2023-02-15  5:12       ` Long An [this message]
2023-02-15  5:13   ` [PATCH v6] " An Long
2023-02-16 14:55     ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dad2d60b89a6dd8298aaf3476ba64adc2c4ef249.camel@suse.com \
    --to=lan@suse.com \
    --cc=ddiss@suse.de \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox