From patchwork Fri Aug 10 15:39:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 176513 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9E26A2C00A7 for ; Sat, 11 Aug 2012 01:41:05 +1000 (EST) Received: from localhost ([::1]:33363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzrKh-0006eT-Kh for incoming@patchwork.ozlabs.org; Fri, 10 Aug 2012 11:41:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzrKK-0006Nt-Rb for qemu-devel@nongnu.org; Fri, 10 Aug 2012 11:40:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzrKI-0006aY-Az for qemu-devel@nongnu.org; Fri, 10 Aug 2012 11:40:40 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:53588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzrKI-0006aR-6P for qemu-devel@nongnu.org; Fri, 10 Aug 2012 11:40:38 -0400 Received: by yhpp34 with SMTP id p34so1615754yhp.4 for ; Fri, 10 Aug 2012 08:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=P7ltTA5cUliIjdxKii+8s7Bqaws5ZNEe/5H3VFIWkac=; b=U0a4z2oiM2fR2dKqg1wqPTBQm3uVJbRNt9PhjWCGWXgHW9s9rT6XfuxPNhIGAfJSp+ wSiCYb7PY7C4wNdZb2WjLkE5BIdUowjK2yMMd/fK+ipY5XoOs2wv+1+c8zIu13tXbSMy 3gdcQif4PxRKmZ94XKQPnhMKKYJ5rvcdevEyt/J7ZNpHRo82hlqOvZxT5T4OgtGlJJxI KVKoQd20U3LtWS9WAlnK0yNhXDu69RT7JuJyU4plixSPZWYiz51vLBxSg1r3NCXGRlLg iGh8XgctCzT1RuNmAZ8+9A6uNH5ofOykxlH5ak7djzGQ2dNeANaAHQBoSGdymxPL+pxs FDmQ== Received: by 10.66.75.74 with SMTP id a10mr7066326paw.46.1344613237422; Fri, 10 Aug 2012 08:40:37 -0700 (PDT) Received: from localhost.localdomain ([202.108.130.138]) by mx.google.com with ESMTPS id os2sm3557374pbc.16.2012.08.10.08.40.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Aug 2012 08:40:36 -0700 (PDT) From: Dong Xu Wang To: qemu-devel@nongnu.org Date: Fri, 10 Aug 2012 23:39:45 +0800 Message-Id: <1344613185-12308-7-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1344613185-12308-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1344613185-12308-1-git-send-email-wdongxu@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.45 Cc: kwolf@redhat.com, Dong Xu Wang Subject: [Qemu-devel] [PATCH V12 6/6] add-cow: add qemu-iotests support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add qemu-iotests support for add-cow. Signed-off-by: Dong Xu Wang --- tests/qemu-iotests/017 | 2 +- tests/qemu-iotests/020 | 2 +- tests/qemu-iotests/check | 4 ++-- tests/qemu-iotests/common | 6 ++++++ tests/qemu-iotests/common.rc | 19 +++++++++++++++++++ 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017 index 66951eb..d31432f 100755 --- a/tests/qemu-iotests/017 +++ b/tests/qemu-iotests/017 @@ -40,7 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.pattern # Any format supporting backing files -_supported_fmt qcow qcow2 vmdk qed +_supported_fmt qcow qcow2 vmdk qed add-cow _supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020 index 2fb0ff8..3dbb495 100755 --- a/tests/qemu-iotests/020 +++ b/tests/qemu-iotests/020 @@ -42,7 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.pattern # Any format supporting backing files -_supported_fmt qcow qcow2 vmdk qed +_supported_fmt qcow qcow2 vmdk qed add-cow _supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 432732c..122267b 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -243,7 +243,7 @@ do echo " - no qualified output" err=true else - if diff -w $seq.out $tmp.out >/dev/null 2>&1 + if diff -w -I "^Formatting" $seq.out $tmp.out >/dev/null 2>&1 then echo "" if $err @@ -255,7 +255,7 @@ do else echo " - output mismatch (see $seq.out.bad)" mv $tmp.out $seq.out.bad - $diff -w $seq.out $seq.out.bad + $diff -w -I "^Formatting" $seq.out $seq.out.bad err=true fi fi diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 1f6fdf5..1c81b09 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -128,6 +128,7 @@ common options check options -raw test raw (default) -cow test cow + -add-cow test add-cow -qcow test qcow -qcow2 test qcow2 -qed test qed @@ -163,6 +164,11 @@ testlist options xpand=false ;; + -add-cow) + IMGFMT=add-cow + xpand=false + ;; + -qcow) IMGFMT=qcow xpand=false diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 7782808..ec5afd7 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -97,6 +97,18 @@ _make_test_img() fi if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE" ]; then optstr=$(_optstr_add "$optstr" "cluster_size=$CLUSTER_SIZE") + elif [ "$IMGFMT" = "add-cow" ]; then + local BACKING="$TEST_IMG"".qcow2" + local IMG="$TEST_IMG"".raw" + if [ "$1" = "-b" ]; then + IMG="$IMG"".b" + $QEMU_IMG create -f raw $IMG $image_size>/dev/null + extra_img_options="-o image_file=$IMG $extra_img_options" + else + $QEMU_IMG create -f raw $IMG $image_size>/dev/null + $QEMU_IMG create -f qcow2 $BACKING $image_size>/dev/null + extra_img_options="-o backing_file=$BACKING,image_file=$IMG" + fi fi if [ -n "$optstr" ]; then @@ -125,6 +137,13 @@ _cleanup_test_img() rm -f $TEST_DIR/t.$IMGFMT rm -f $TEST_DIR/t.$IMGFMT.orig rm -f $TEST_DIR/t.$IMGFMT.base + if [ "$IMGFMT" = "add-cow" ]; then + rm -f $TEST_DIR/t.$IMGFMT.qcow2 + rm -f $TEST_DIR/t.$IMGFMT.raw + rm -f $TEST_DIR/t.$IMGFMT.raw.b + rm -f $TEST_DIR/t.$IMGFMT.ct.qcow2 + rm -f $TEST_DIR/t.$IMGFMT.ct.raw + fi ;; rbd)