qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 4/4] iotests: Add test 197 for covering copy-on-


From: Jeff Cody
Subject: Re: [Qemu-block] [PATCH 4/4] iotests: Add test 197 for covering copy-on-read
Date: Mon, 2 Oct 2017 10:04:22 -0400
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Oct 02, 2017 at 08:55:50AM -0500, Eric Blake wrote:
> On 09/30/2017 10:03 PM, Jeff Cody wrote:
> > On Sat, Sep 30, 2017 at 03:11:21PM -0500, Eric Blake wrote:
> >> Add a test for qcow2 copy-on-read behavior, including exposure
> >> for the just-fixed bugs.
> >>
> >> The copy-on-read behavior is always to a qcow2 image, but the
> >> test is careful to allow running with most image protocol/format
> >> combos as the backing file being copied from (luks being the
> >> exception, as it is harder to pass the right secret to all the
> >> right places).  In fact, for './check nbd', this appears to be
> >> the first time we've had a qcow2 image wrapping NBD, requiring
> >> an additional line in _filter_img_create to match the similar
> >> line in _filter_img_info.
> >>
> >> Signed-off-by: Eric Blake <address@hidden>
> >>
> 
> >> +_cleanup()
> >> +{
> >> +    _cleanup_test_img
> >> +    rm -f "$BLKDBG_CONF"
> >> +}
> >> +trap "_cleanup; exit \$status" 0 1 2 3 15
> > 
> > 
> > Note to myself to add this to my iotests series.
> 
> Yep, and I even thought about that, since I've been pointing it out on
> other patches, but forgot to mention it when composing the email ;)
> 
> 
> >> +$QEMU_IO -c "open -C \
> >> + -o driver=blkdebug,config=$BLKDBG_CONF,image.driver=qcow2 $TEST_WRAP" \
> > 
> > Hmm, this will lead to issues if $TEST_WRAP has spaces, right?
> 
> Probably :(  Although I didn't actually test that setup
> 
> But I don't know what other options we have to work around it. As long
> as we are executing in the correct directory, I guess we can open both
> BLKDBG_CONF and TEST_WRAP relative to ./ rather than as an absolute
> path, and that should be sufficient to avoid spaces.  But I don't know
> how easy that is to achieve, or if _filter_qemu_io will handle it correctly.
> 
> Maybe I take the wimpy way out and skip the test if $PWD contains spaces
> or other problematic characters?
> 

My thought is if the operation is destructive (writes, creates, deletes) a
file, we want to make sure we do not ruin someone's day by destroying a file
(e.g. "/home/jcody/qemu work", and having /home/jcody/qemu overwritten).

Spaces in pathnames for iotests don't work currently, however.  So maybe the
proper thing to do, is for me to add to my iotests series a check for spaces
in TEST_DIR, and just refuse to run any tests at all (with an informative
reason why).  And if it is ever fixed so that tests run (and run safely)
with spaces, we can remove that restriction.

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]