From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfgV0-0000OE-Ve for qemu-devel@nongnu.org; Sun, 10 Nov 2013 20:41:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfgUt-0001pW-DU for qemu-devel@nongnu.org; Sun, 10 Nov 2013 20:41:06 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:35483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfgUs-0001p9-PG for qemu-devel@nongnu.org; Sun, 10 Nov 2013 20:40:59 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Nov 2013 11:40:45 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 947852CE8052 for ; Mon, 11 Nov 2013 12:40:43 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAB1eVNN10027316 for ; Mon, 11 Nov 2013 12:40:31 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAB1egxk027763 for ; Mon, 11 Nov 2013 12:40:42 +1100 Message-ID: <5280359E.8080504@linux.vnet.ibm.com> Date: Mon, 11 Nov 2013 09:40:46 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1383609689-4417-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1383609689-4417-7-git-send-email-xiawenc@linux.vnet.ibm.com> <20131108205045.GF19612@localhost.localdomain> In-Reply-To: <20131108205045.GF19612@localhost.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V5 6/6] qemu-iotests: add test for qcow2 snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, stefanha@gmail.com, pbonzini@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com 于 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 >> --- >> 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 . >> +# >> +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 <> +[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.