qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Jeff Cody <jcody@redhat.com>
Cc: kwolf@redhat.com, stefanha@gmail.com, pbonzini@redhat.com,
	qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH V5 6/6] qemu-iotests: add test for qcow2 snapshot
Date: Mon, 11 Nov 2013 09:40:46 +0800	[thread overview]
Message-ID: <5280359E.8080504@linux.vnet.ibm.com> (raw)
In-Reply-To: <20131108205045.GF19612@localhost.localdomain>

于 2013/11/9 4:50, Jeff Cody 写道:
> On Tue, Nov 05, 2013 at 08:01:29AM +0800, Wenchao Xia wrote:
>> This test will focus on the low level procedure of qcow2 snapshot
>> operations, now it covers only the create operation. Overlap error
>> paths are not checked since no good way to trigger those errors.
>>
>> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
>> ---
>>   tests/qemu-iotests/070           |  214 ++++++++++++++++++++++++++++++++++++++
>>   tests/qemu-iotests/070.out       |   35 ++++++
>>   tests/qemu-iotests/common.filter |    7 ++
>>   tests/qemu-iotests/group         |    1 +
>>   4 files changed, 257 insertions(+), 0 deletions(-)
>>   create mode 100755 tests/qemu-iotests/070
>>   create mode 100644 tests/qemu-iotests/070.out
>>
>> diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070
>> new file mode 100755
>> index 0000000..37ada84
>> --- /dev/null
>> +++ b/tests/qemu-iotests/070
>> @@ -0,0 +1,214 @@
>> +#!/bin/bash
>> +#
>> +# qcow2 internal snapshot test
>> +#
>> +# Copyright (C) 2013 IBM, Inc.
>> +#
>> +# This program is free software; you can redistribute it and/or modify
>> +# it under the terms of the GNU General Public License as published by
>> +# the Free Software Foundation; either version 2 of the License, or
>> +# (at your option) any later version.
>> +#
>> +# This program is distributed in the hope that it will be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
>> +#
>> +owner=xiawenc@linux.vnet.ibm.com
>> +
>> +seq=`basename $0`
>> +echo "QA output created by $seq"
>> +
>> +here=`pwd`
>> +tmp=/tmp/$$
>> +status=1	# failure is the default!
>> +
>> +_cleanup()
>> +{
>> +    _cleanup_test_img
>> +    rm $TEST_DIR/blkdebug.conf
>
> $TEST_DIR needs quoting (also in later uses in this file as well)
>
>> +}
>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>> +
>> +# get standard environment, filters and checks
>> +. ./common.rc
>> +. ./common.filter
>> +. ./common.pattern
>> +
>> +# only test qcow2
>> +_supported_fmt qcow2
>> +_supported_proto generic
>> +# bind the errno correctly and filter the output of image check and qemu-img,
>> +# if you want to run it on other OS
>> +_supported_os Linux
>> +
>> +
>> +IMGOPTS="compat=1.1"
>> +
>> +CLUSTER_SIZE=65536
>> +
>> +SIZE=1G
>> +
>> +BLKDBG_TEST_IMG="blkdebug:$TEST_DIR/blkdebug.conf:$TEST_IMG"
>> +
>> +errno=5
>> +
>> +once=on
>> +
>> +imm=off
>> +
>> +
>> +# Start test, note that the injected errors are related to qcow2's snapshot
>> +# logic closely, see qcow2-snapshot.c for more details.
>> +
>> +# path 1: fail in L1 table allocation for snapshot
>> +echo
>> +echo "Path 1: fail in allocation of L1 table"
>> +
>> +_make_test_img $SIZE
>> +
>> +cat > $TEST_DIR/blkdebug.conf <<EOF
>> +[inject-error]
>> +event = "cluster_alloc"
>> +errno = "$errno"
>> +immediately = "$imm"
>> +once = "$once"
>> +EOF
>> +
>> +$QEMU_IMG snapshot -c snap1 $BLKDBG_TEST_IMG
>> +$QEMU_IMG snapshot -l $TEST_IMG
>
> Both $BLKDB_TEST_IMG and $TEST_IMG need quoting (also in later uses in
> this file)
>

  will fix that.

      reply	other threads:[~2013-11-11  1:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  0:01 [Qemu-devel] [PATCH V5 0/6] qcow2: rollback the modification on fail in snapshot creation Wenchao Xia
2013-11-05  0:01 ` [Qemu-devel] [PATCH V5 1/6] snapshot: add parameter *errp in snapshot create Wenchao Xia
2013-11-06 19:14   ` Max Reitz
2013-11-05  0:01 ` [Qemu-devel] [PATCH V5 2/6] qcow2: add error message in qcow2_write_snapshots() Wenchao Xia
2013-11-06 19:14   ` Max Reitz
2013-11-05  0:01 ` [Qemu-devel] [PATCH V5 3/6] qcow2: do not free clusters when fail in header update in qcow2_write_snapshots Wenchao Xia
2013-11-05  0:01 ` [Qemu-devel] [PATCH V5 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create() Wenchao Xia
2013-11-05  0:01 ` [Qemu-devel] [PATCH V5 5/6] blkdebug: add debug events for snapshot Wenchao Xia
2013-11-05  0:01 ` [Qemu-devel] [PATCH V5 6/6] qemu-iotests: add test for qcow2 snapshot Wenchao Xia
2013-11-06 19:19   ` Max Reitz
2013-11-08 20:50   ` Jeff Cody
2013-11-11  1:40     ` Wenchao Xia [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=5280359E.8080504@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 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).