All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Eryu Guan <guaneryu@gmail.com>, Nikolay Borisov <nborisov@suse.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/2] btrfs: Add test for btrfs balance convert functionality
Date: Sun, 6 Oct 2019 07:21:07 +0800	[thread overview]
Message-ID: <fc8d4539-116c-5447-9954-569151de582c@gmx.com> (raw)
In-Reply-To: <20191005175354.GD2622@desktop>



On 2019/10/6 上午1:53, Eryu Guan wrote:
> Hi Qu,
>
> On Tue, Oct 01, 2019 at 12:04:19PM +0300, Nikolay Borisov wrote:
>> Add basic test to ensure btrfs conversion functionality is tested. This test
>> exercies conversion to all possible types of the data portion. This is sufficient
>> since from the POV of relocation we are only moving blockgroups.
>>
>> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Still one small nitpick inlined below (just small wording, can be fixed
at commit time).

>
> Would you please help review this v2 as well? Thanks a lot!
>
> Eryu
>
>> ---
>>  tests/btrfs/194     | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  tests/btrfs/194.out |  2 ++
>>  tests/btrfs/group   |  1 +
>>  3 files changed, 87 insertions(+)
>>  create mode 100755 tests/btrfs/194
>>  create mode 100644 tests/btrfs/194.out
>>
>> diff --git a/tests/btrfs/194 b/tests/btrfs/194
>> new file mode 100755
>> index 000000000000..39b6e0a969c1
>> --- /dev/null
>> +++ b/tests/btrfs/194
>> @@ -0,0 +1,84 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (c) 2019 SUSE Linux Products GmbH. All Rights Reserved.
>> +#
>> +# FS QA Test 194
>> +#
>> +# Test raid profile conversion. It's sufficient to test all dest profiles as
>> +# source profiles just rely on being able to read the metadata.

data and metadata.

In fact in the test case itself it's purely data.

THanks,
Qu

>> +#
>> +seq=`basename $0`
>> +seqres=$RESULT_DIR/$seq
>> +echo "QA output created by $seq"
>> +
>> +here=`pwd`
>> +tmp=/tmp/$$
>> +status=1	# failure is the default!
>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>> +
>> +_cleanup()
>> +{
>> +	cd /
>> +	rm -f $tmp.*
>> +}
>> +
>> +# get standard environment, filters and checks
>> +. ./common/rc
>> +. ./common/filter
>> +
>> +# remove previous $seqres.full before test
>> +rm -f $seqres.full
>> +
>> +# real QA test starts here
>> +
>> +# Modify as appropriate.
>> +_supported_fs btrfs
>> +_supported_os Linux
>> +_require_scratch_dev_pool 4
>> +
>> +
>> +declare -a TEST_VECTORS=(
>> +# $nr_dev_min:$data:$metadata:$data_convert:$metadata_convert
>> +"4:single:raid1"
>> +"4:single:raid0"
>> +"4:single:raid10"
>> +"4:single:dup"
>> +"4:single:raid5"
>> +"4:single:raid6"
>> +"2:raid1:single"
>> +)
>> +
>> +run_testcase() {
>> +	IFS=':' read -ra args <<< $1
>> +	num_disks=${args[0]}
>> +	src_type=${args[1]}
>> +	dst_type=${args[2]}
>> +
>> +	_scratch_dev_pool_get $num_disks
>> +
>> +	echo "=== Running test: $1 ===" >> $seqres.full
>> +
>> +	_scratch_pool_mkfs -d$src_type >> $seqres.full 2>&1
>> +	_scratch_mount
>> +
>> +	# Create random filesystem with 20k write ops
>> +	run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -n 10000 $FSSTRESS_AVOID
>> +
>> +	$BTRFS_UTIL_PROG balance start -f -dconvert=$dst_type $SCRATCH_MNT >> $seqres.full 2>&1
>> +	[ $? -eq 0 ] || echo "$1: Failed convert"
>> +
>> +	$BTRFS_UTIL_PROG scrub start -B $SCRATCH_MNT >>$seqres.full 2>&1
>> +	[ $? -eq 0 ] || echo "$1: Scrub failed"
>> +
>> +	_scratch_unmount
>> +	_check_btrfs_filesystem $SCRATCH_DEV
>> +	_scratch_dev_pool_put
>> +}
>> +
>> +for i in "${TEST_VECTORS[@]}"; do
>> +	run_testcase $i
>> +done
>> +
>> +echo "Silence is golden"
>> +status=0
>> +exit
>> diff --git a/tests/btrfs/194.out b/tests/btrfs/194.out
>> new file mode 100644
>> index 000000000000..7bfd50ffb5a4
>> --- /dev/null
>> +++ b/tests/btrfs/194.out
>> @@ -0,0 +1,2 @@
>> +QA output created by 194
>> +Silence is golden
>> diff --git a/tests/btrfs/group b/tests/btrfs/group
>> index b92cb12ca66f..a2c0ad87d0f6 100644
>> --- a/tests/btrfs/group
>> +++ b/tests/btrfs/group
>> @@ -196,3 +196,4 @@
>>  191 auto quick send dedupe
>>  192 auto replay snapshot stress
>>  193 auto quick qgroup enospc limit
>> +194 auto volume balance
>> --
>> 2.7.4
>>

      reply	other threads:[~2019-10-05 23:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  9:04 [PATCH v2 1/2] common/rc: Remove special handing of 'dup' argument for btrfs Nikolay Borisov
2019-10-01  9:04 ` [PATCH v2 2/2] btrfs: Add test for btrfs balance convert functionality Nikolay Borisov
2019-10-01  9:05   ` Nikolay Borisov
2019-10-05 17:53   ` Eryu Guan
2019-10-05 23:21     ` Qu Wenruo [this message]

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=fc8d4539-116c-5447-9954-569151de582c@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.