From patchwork Thu May 30 10:00:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 247520 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 498732C0099 for ; Thu, 30 May 2013 20:14:52 +1000 (EST) Received: from localhost ([::1]:41946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uhzhl-00006k-Uu for incoming@patchwork.ozlabs.org; Thu, 30 May 2013 06:03:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uhzfe-0004gb-Fc for qemu-devel@nongnu.org; Thu, 30 May 2013 06:01:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhzfZ-0007cl-FO for qemu-devel@nongnu.org; Thu, 30 May 2013 06:01:22 -0400 Received: from mail-yh0-x236.google.com ([2607:f8b0:4002:c01::236]:37279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhzfZ-0007ce-AI for qemu-devel@nongnu.org; Thu, 30 May 2013 06:01:17 -0400 Received: by mail-yh0-f54.google.com with SMTP id b12so5449yha.13 for ; Thu, 30 May 2013 03:01:16 -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=g1Cy3PbE63B2IfyGRuEd/0nG9lxCJLkkk/HPV9kh/eg=; b=pEgqxVzeFthRnfG5P/x4F3kQFstIFqMsSfjmm4XHMFGBdHZb5Qu9DUjE8gDa80GLsb FsEMbvz9JeCP4g6FJf5V5uDfKSzGxs6CxMZAf/NEUEe/OVwDJrPMHxtsgikki1rkqaib O9XXg2lL/cJrMzuxIlvGkD5CsBhEyVrnyGi1CTAPhf3HyddM8mDYE5RCaNiri6JLAJFD uJilpFWJritM2kwo3eXExcsVhjdOXR/NpKWv9GpT//N9OWsM/86HxYR3zXNh2ERUJl+d ont10Y96mmzfqziI+MpfzPZrKYdkE4D40tyszXs23RT5G913mg+wOnmLgPHNOjOBBMLh BZQg== X-Received: by 10.236.126.50 with SMTP id a38mr3266345yhi.80.1369908076874; Thu, 30 May 2013 03:01:16 -0700 (PDT) Received: from 11.wdongxu.kvm58 ([202.108.130.153]) by mx.google.com with ESMTPSA id j64sm58764867yhj.25.2013.05.30.03.01.13 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 30 May 2013 03:01:16 -0700 (PDT) From: Dongxu Wang To: qemu-devel@nongnu.org Date: Thu, 30 May 2013 18:00:25 +0800 Message-Id: <1369908025-9556-9-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1369908025-9556-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1369908025-9556-1-git-send-email-wdongxu@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c01::236 Cc: kwolf@redhat.com, Dong Xu Wang , wdongxu@cn.ibm.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH V19 8/8] qemu-iotests: add add-cow 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 From: Dong Xu Wang This patch will use qemu-iotests to test add-cow file format. v17-v18: 1) add 037 and 038 tests. Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- tests/qemu-iotests/017 | 2 +- tests/qemu-iotests/020 | 2 +- tests/qemu-iotests/037 | 2 +- tests/qemu-iotests/038 | 2 +- tests/qemu-iotests/common | 6 ++++++ tests/qemu-iotests/common.rc | 15 ++++++++++++++- 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017 index 45f2c0b..ae0e627 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/037 b/tests/qemu-iotests/037 index c11460b..683e73d 100755 --- a/tests/qemu-iotests/037 +++ b/tests/qemu-iotests/037 @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter -_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/038 b/tests/qemu-iotests/038 index 36125ea..10bacfb 100755 --- a/tests/qemu-iotests/038 +++ b/tests/qemu-iotests/038 @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter -_supported_fmt qcow2 qed +_supported_fmt qcow2 qed add-cow _supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 6826ea7..5110fc1 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 @@ -165,6 +166,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 e9ba358..b203f04 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -110,6 +110,16 @@ _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 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 + extra_img_options="-o image_file=$IMG" + fi fi if [ -n "$optstr" ]; then @@ -130,7 +140,8 @@ _make_test_img() -e "s# zeroed_grain=\\(on\\|off\\)##g" \ -e "s# subformat='[^']*'##g" \ -e "s# adapter_type='[^']*'##g" \ - -e "s# lazy_refcounts=\\(on\\|off\\)##g" + -e "s# lazy_refcounts=\\(on\\|off\\)##g" \ + -e "s# image_file='[^']*'##g" # Start an NBD server on the image file, which is what we'll be talking to if [ $IMGPROTO = "nbd" ]; then @@ -152,6 +163,8 @@ _cleanup_test_img() rm -f $TEST_DIR/t.$IMGFMT rm -f $TEST_DIR/t.$IMGFMT.orig rm -f $TEST_DIR/t.$IMGFMT.base + rm -f $TEST_DIR/t.$IMGFMT.raw + rm -f $TEST_DIR/t.$IMGFMT.raw.b ;; rbd)