From patchwork Wed Apr 10 08:11:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 235331 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 9524C2C00C8 for ; Wed, 10 Apr 2013 18:14:39 +1000 (EST) Received: from localhost ([::1]:58601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPqAG-0003YO-IX for incoming@patchwork.ozlabs.org; Wed, 10 Apr 2013 04:13:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPq9e-0003Tq-RI for qemu-devel@nongnu.org; Wed, 10 Apr 2013 04:13:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPq9c-00008n-Qk for qemu-devel@nongnu.org; Wed, 10 Apr 2013 04:13:18 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:65295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPq9c-00008g-Hw for qemu-devel@nongnu.org; Wed, 10 Apr 2013 04:13:16 -0400 Received: by mail-pd0-f176.google.com with SMTP id r11so133241pdi.7 for ; Wed, 10 Apr 2013 01:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=B7fWtqjJ6/h6goYKJJHaIbh+Y303eP9jWc0Zgs3exfI=; b=OJReDFmYuHrFt8Hir8I2nHNQXJqQLm+h2I4zWrXWE9mqz/LoG9Oo0p5XTQAsRwFvhN Y+N/yLh9AM79e2BwbJws5LajcSKZ1Vzdh4xeRvJ01E4M6usqHdIeQIVvoP98rnqy4q0J p6EZxreKxJxQcC1tW081bofcMAA3s7DpEsbQorcjkp3/zKG9pubeGTrvntWT02bTkyBM 6x5PoY7v062DO7m/3/L74HJCs57cvHaRG4x2MlJMoH6Mi7HtLuV505xafhJqbdgIhbbi BoAwuFoWSFrNUWGdy0L1hVmrEzUJzIKGAenH/VdtEEiKj9V1V78ph87wI5QaUIo4iqPQ caeA== X-Received: by 10.68.99.163 with SMTP id er3mr1529133pbb.36.1365581595907; Wed, 10 Apr 2013 01:13:15 -0700 (PDT) Received: from localhost.localdomain ([202.108.130.138]) by mx.google.com with ESMTPS id wl5sm33042619pac.18.2013.04.10.01.13.07 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 01:13:15 -0700 (PDT) From: Dong Xu Wang To: qemu-devel@nongnu.org Date: Wed, 10 Apr 2013 16:11:53 +0800 Message-Id: <1365581513-3475-7-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365581513-3475-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1365581513-3475-1-git-send-email-wdongxu@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.192.176 Cc: Dong Xu Wang , kwol@redhat.com, wdongxu@cn.ibm.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH V18 6/6] 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 This patch will use qemu-iotests to test add-cow file format. Signed-off-by: Dong Xu Wang --- v17-v18: 1) add 037 and 038 tests. 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 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/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 b3aad89..9f651bf 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 @@ -164,6 +165,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 e522d61..45e676c 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -107,6 +107,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 @@ -124,7 +134,8 @@ _make_test_img() -e "s# compat='[^']*'##g" \ -e "s# compat6=\\(on\\|off\\)##g" \ -e "s# static=\\(on\\|off\\)##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 @@ -146,6 +157,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)