From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] btrfs-progs: convert-test: Add test for converting ext* with regular file extent.
Date: Fri, 3 Apr 2015 08:42:19 +0800 [thread overview]
Message-ID: <551DE1EB.5000507@cn.fujitsu.com> (raw)
In-Reply-To: <20150402154540.GM6821@twin.jikos.cz>
-------- Original Message --------
Subject: Re: [PATCH 2/2] btrfs-progs: convert-test: Add test for
converting ext* with regular file extent.
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Date: 2015年04月02日 23:45
> On Thu, Apr 02, 2015 at 10:21:36AM +0800, Qu Wenruo wrote:
>> Before previous patch, btrfs-convert will result fsck complain if there
>> is any regular file extent in newly converted btrfs.
>>
>> Add test case for it.
>
> Please separate the changes that update generic code and the test
> itself.
OK, I'll update it soon.
>
>> +script_dir=$(dirname $(realpath $0))
>> +top=$(realpath $script_dir/../)
>
> Please use upper case names.
Some fsck-tests use lower case names, I'll update them too.
Thanks,
Qu
>
>> +TEST_DEV=${TEST_DEV:-}
>> +TEST_MNT=${TEST_MNT:-$top/tests/mnt}
>> +RESULT="$top/tests/convert-tests-results.txt"
>
> RESULTS
>
>> +IMAGE="$script_dir/test.img"
>>
>> -_fail()
>> -{
>> - echo "$*" | tee -a convert-tests-results.txt
>> - exit 1
>> -}
>> +source $top/tests/common
>> +export top
>> +export RESULT
>> +# For comprehensive convert test which needs write something into ext*
>> +export TEST_MNT
>> +export LANG
>> +
>> +rm -f $RESULT
>> +mkdir -p $TEST_MNT || _fail "unable to create mount point on $TEST_MNT"
>> +
>> +# test reply on btrfs-convert
>> +check_prereq btrfs-convert
>> +check_prereq btrfs
>>
>> -rm -f convert-tests-results.txt
>>
>> -test(){
>> +convert_test(){
>> echo " [TEST] $1"
>> nodesize=$2
>> shift 2
>> - echo "creating ext image with: $*" >> convert-tests-results.txt
>> + echo "creating ext image with: $*" >> $RESULT
>> # 256MB is the smallest acceptable btrfs image.
>> - rm -f $here/test.img >> convert-tests-results.txt 2>&1 \
>> + rm -f $IMAGE >> $RESULT 2>&1 \
>> || _fail "could not remove test image file"
>> - truncate -s 256M $here/test.img >> convert-tests-results.txt 2>&1 \
>> + truncate -s 256M $IMAGE >> $RESULT 2>&1 \
>> || _fail "could not create test image file"
>> - $* -F $here/test.img >> convert-tests-results.txt 2>&1 \
>> + $* -F $IMAGE >> $RESULT 2>&1 \
>> || _fail "filesystem create failed"
>> - $here/btrfs-convert -N "$nodesize" $here/test.img \
>> - >> convert-tests-results.txt 2>&1 \
>> +
>> + # write a file with regular file extent
>> + $SUDO_HELPER mount $IMAGE $TEST_MNT
>> + $SUDO_HELPER dd if=/dev/zero bs=$nodesize count=4 of=$TEST_MNT/test \
>> + 1>/dev/null 2>&1
>> + $SUDO_HELPER umount $TEST_MNT
>> +
>> + # do convert test
>> + $top/btrfs-convert -N "$nodesize" $script_dir/test.img \
>
> $IMAGE instead of "$script_dir/test.img"
>
>> + >> $RESULT 2>&1 \
>> || _fail "btrfs-convert failed"
>> - $here/btrfs check $here/test.img >> convert-tests-results.txt 2>&1 \
>
> same here
>
>> + $top/btrfs check $script_dir/test.img >> $RESULT 2>&1 \
>
> and here
>
>> || _fail "btrfs check detected errors"
>
> Thanks.
>
next prev parent reply other threads:[~2015-04-03 0:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 2:21 [PATCH 1/2] btrfs-progs: convert: Make ext*_image file obey datacsum setting Qu Wenruo
2015-04-02 2:21 ` [PATCH 2/2] btrfs-progs: convert-test: Add test for converting ext* with regular file extent Qu Wenruo
2015-04-02 15:45 ` David Sterba
2015-04-03 0:42 ` Qu Wenruo [this message]
2015-04-02 15:45 ` [PATCH 1/2] btrfs-progs: convert: Make ext*_image file obey datacsum setting David Sterba
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=551DE1EB.5000507@cn.fujitsu.com \
--to=quwenruo@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).