From patchwork Thu Dec 6 06:51:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 204159 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 B5FE12C01C8 for ; Thu, 6 Dec 2012 18:12:50 +1100 (EST) Received: from localhost ([::1]:38319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgVKQ-0004dY-87 for incoming@patchwork.ozlabs.org; Thu, 06 Dec 2012 01:53:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgVJz-0003Or-Gg for qemu-devel@nongnu.org; Thu, 06 Dec 2012 01:52:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgVJt-0006WS-BV for qemu-devel@nongnu.org; Thu, 06 Dec 2012 01:52:35 -0500 Received: from mail-ia0-f171.google.com ([209.85.210.171]:39103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgVJt-0006WM-7H for qemu-devel@nongnu.org; Thu, 06 Dec 2012 01:52:29 -0500 Received: by mail-ia0-f171.google.com with SMTP id k27so5352697iad.16 for ; Wed, 05 Dec 2012 22:52:28 -0800 (PST) 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=DZLItr06tlFC8HBcY1vd/WqQPn6v8Xo3qZAYiagV+Y4=; b=v4ivCFiLw6xXBZs+eK5PRzNWbaNth2UyjUdgmozFz0+31+LBG+6dT4yhZ5mTP5U8UY vIzUMPBrXyrnBxHxfk/voRhOtkG/QZP6dm2ftB+GliJDgfSOtWhkBzIeVKA3ZpH8pIMh 3b3ZAAtAgZjCDYhkKuIHedaQdWhvdrW+wOV66Vpg87LNJ0LUwSZ9A6ZcIb1o2EaBArp0 qA29WyZjdVlbgPsUad5vF+NGh9Q/9De4IJh3ltwd+d8SIKykcsSbbt4uP0D8nlLKPlV5 cg5X/a5Nx8e1yR5UvahjiRc33db8A6i55rnyCXJb2psvQZH7wuKOQdMD12o6O+3mvxuR xU5Q== Received: by 10.50.0.171 with SMTP id 11mr517862igf.14.1354776748539; Wed, 05 Dec 2012 22:52:28 -0800 (PST) Received: from localhost.localdomain ([202.108.130.153]) by mx.google.com with ESMTPS id uj11sm14890561igb.15.2012.12.05.22.52.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Dec 2012 22:52:27 -0800 (PST) From: Dong Xu Wang To: qemu-devel@nongnu.org Date: Thu, 6 Dec 2012 14:51:51 +0800 Message-Id: <1354776711-12449-7-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1354776711-12449-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1354776711-12449-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.210.171 Cc: kwolf@redhat.com, Dong Xu Wang Subject: [Qemu-devel] [PATCH V17 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 --- tests/qemu-iotests/017 | 2 +- tests/qemu-iotests/020 | 2 +- tests/qemu-iotests/common | 6 ++++++ tests/qemu-iotests/common.rc | 15 ++++++++++++++- 4 files changed, 22 insertions(+), 3 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/common b/tests/qemu-iotests/common index b3aad89..1ea4a7f 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 aef5f52..4461f69 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)