From patchwork Thu Oct 25 13:36:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 194176 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 E527C2C00A4 for ; Fri, 26 Oct 2012 01:18:57 +1100 (EST) Received: from localhost ([::1]:55851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRNe6-0007U9-Vc for incoming@patchwork.ozlabs.org; Thu, 25 Oct 2012 09:38:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRNd0-00055n-I9 for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:37:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRNcq-0003Gk-Eb for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:37:42 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:46608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRNcq-0003C7-6l for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:37:32 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so1115017pad.4 for ; Thu, 25 Oct 2012 06:37:31 -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=04R8TqRqh8Vo+ifuA28xXUQmFIHlt9PWvq308AZhQC4=; b=HByX5J4k96mflCnJEVyRuHoqQJarEBNj6LJp26Vpg7Jkb7WJMO2jBW9lG/tS6FQId6 4duO7B/aCrL0ESuGhWa6lgEsntSwVHw+HVvIKNwm0FR8OARnNI4iu5Y8tfmK9ZhPHioS bE3VSHjR7GNAhFLHpsw7i71qz+SMF1WGYepsNY6GP+ykN18LkJBKGYfINVgOS0gg2/GF iJ8+sPhlQgNtEaLsPD+cVYdRCjNgj0cU2/Ine+da0NY895t6wtBz7gr+hQpJTfj9Lv48 OmrYCkWAGyH113zq0hlTdywxOvvYHTdIt0OEFa8ZFZTW3ubTFJyutfdfk2qnLwftIyD/ /2fg== Received: by 10.68.129.72 with SMTP id nu8mr59820926pbb.29.1351172251694; Thu, 25 Oct 2012 06:37:31 -0700 (PDT) Received: from localhost.localdomain ([202.108.130.138]) by mx.google.com with ESMTPS id ix9sm11235269pbc.7.2012.10.25.06.37.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 06:37:30 -0700 (PDT) From: Dong Xu Wang To: qemu-devel@nongnu.org Date: Thu, 25 Oct 2012 21:36:44 +0800 Message-Id: <1351172204-29233-7-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1351172204-29233-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1351172204-29233-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.220.45 Cc: kwolf@redhat.com, Dong Xu Wang Subject: [Qemu-devel] [PATCH V14 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 1f6fdf5..4c06895 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 d534e94..f48b02a 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -97,6 +97,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 @@ -114,7 +124,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" } _cleanup_test_img() @@ -125,6 +136,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)