qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dongxu Wang <wdongxu@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Dong Xu Wang <wdongxu@linux.vnet.ibm.com>,
	wdongxu@cn.ibm.com, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH V19 8/8] qemu-iotests: add add-cow iotests support
Date: Thu, 30 May 2013 18:00:25 +0800	[thread overview]
Message-ID: <1369908025-9556-9-git-send-email-wdongxu@linux.vnet.ibm.com> (raw)
In-Reply-To: <1369908025-9556-1-git-send-email-wdongxu@linux.vnet.ibm.com>

From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>

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 <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Dongxu Wang <wdongxu@linux.vnet.ibm.com>
---
 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)
-- 
1.7.11.7

  parent reply	other threads:[~2013-05-30 10:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 10:00 [Qemu-devel] [PATCH V19 0/8] add-cow file format Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 1/8] V18: docs: document for " Dongxu Wang
2013-06-03  1:48   ` Fam Zheng
2013-06-03  1:55     ` Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 2/8] make path_has_protocol non static Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 3/8] qed_read_string to bdrv_read_string Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 4/8] rename qcow2-cache.c to block-cache.c Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 5/8] Make block-cache.c be common interface Dongxu Wang
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 6/8] add debug event for add-cow Dongxu Wang
2013-06-05 13:35   ` Stefan Hajnoczi
2013-06-05 13:46   ` Kevin Wolf
2013-06-06  7:30     ` Stefan Hajnoczi
2013-05-30 10:00 ` [Qemu-devel] [PATCH V19 7/8] add-cow file format core code Dongxu Wang
2013-06-05 14:21   ` Stefan Hajnoczi
2013-05-30 10:00 ` Dongxu Wang [this message]
2013-06-03  1:47 ` [Qemu-devel] [PATCH V19 0/8] add-cow file format Fam Zheng
2013-07-22  5:10 ` Wenchao Xia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369908025-9556-9-git-send-email-wdongxu@linux.vnet.ibm.com \
    --to=wdongxu@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wdongxu@cn.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).