[Top] [All Lists]

Re: [PATCH 2/2] btrfs/035: add new clone overwrite regression test

To: David Disseldorp <ddiss@xxxxxxx>
Subject: Re: [PATCH 2/2] btrfs/035: add new clone overwrite regression test
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 6 Feb 2014 10:15:26 +1100
Cc: xfs@xxxxxxxxxxx, dsterba@xxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1391599009-2402-3-git-send-email-ddiss@xxxxxxx>
References: <1391599009-2402-1-git-send-email-ddiss@xxxxxxx> <1391599009-2402-3-git-send-email-ddiss@xxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Feb 05, 2014 at 12:16:49PM +0100, David Disseldorp wrote:
> This test uses the newly added cloner binary to dispatch full file and
> range specific clone (reflink) requests.

A couple of small nits:

> +CLONER_PROG=$here/src/cloner

Need to test that the binary was build and is present.

> +
> +src_str="aaaaaaaaaa"
> +
> +echo -n "$src_str" > $SCRATCH_MNT/src || _fail "failed to create src"

No need for the "|| _fail ..." in any part of this test. Failures
will be caught in the output and hence cause golden output

Letting the test run even after a failure exercises the filesystem
in interesting ways, so it's worthwhile ignoring failures in the
test and letting the harness pick up the failures through error

> +
> +src_str="bbbbbbbbbbcccccccccc"
> +
> +echo -n "$src_str" > $SCRATCH_MNT/src || _fail "failed to create src"
> +
> +
> +snap_src_sz=`ls -lah $SCRATCH_MNT/src.clone1 | awk '{print $5}'`
> +echo "attempting ioctl (src.clone1 src)"
> +$CLONER_PROG -s 0 -d 0 -l ${snap_src_sz} \
> +     $SCRATCH_MNT/src.clone1 $SCRATCH_MNT/src || _fail "ioctl failed"

And to do that here, you probably need to add perror() output to
the cloner program when it detects an error. i.e. let it give you
the exact error that was detected, rather than lumping them all into
a catchall here...


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>