From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Dong Xu Wang <wdongxu@linux.vnet.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/3 v9] qemu-iotests: support add-cow file format
Date: Tue, 8 May 2012 01:34:17 +0800 [thread overview]
Message-ID: <1336412058-13751-2-git-send-email-wdongxu@linux.vnet.ibm.com> (raw)
In-Reply-To: <1336412058-13751-1-git-send-email-wdongxu@linux.vnet.ibm.com>
Add qemu-iotests test cases for add-cow file format.
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
---
tests/qemu-iotests/017 | 2 +-
tests/qemu-iotests/018 | 2 +-
tests/qemu-iotests/019 | 2 +-
tests/qemu-iotests/020 | 2 +-
tests/qemu-iotests/check | 4 ++--
tests/qemu-iotests/common | 6 ++++++
tests/qemu-iotests/common.rc | 19 +++++++++++++++++++
7 files changed, 31 insertions(+), 6 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/018 b/tests/qemu-iotests/018
index bd2db78..aa7444f 100755
--- a/tests/qemu-iotests/018
+++ b/tests/qemu-iotests/018
@@ -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/019 b/tests/qemu-iotests/019
index 8872b30..d938aca 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -44,7 +44,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/check b/tests/qemu-iotests/check
index 432732c..8061059 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -243,7 +243,7 @@ do
echo " - no qualified output"
err=true
else
- if diff -w $seq.out $tmp.out >/dev/null 2>&1
+ if diff -w -I "^Formatting" $seq.out $tmp.out >/dev/null 2>&1
then
echo ""
if $err
@@ -255,7 +255,7 @@ do
else
echo " - output mismatch (see $seq.out.bad)"
mv $tmp.out $seq.out.bad
- $diff -w $seq.out $seq.out.bad
+ $diff -w -I "^Formatting" $seq.out $seq.out.bad
err=true
fi
fi
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index eeb70cb..c80d18c 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -127,6 +127,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
@@ -162,6 +163,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 e535874..93595c3 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -87,6 +87,18 @@ _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 BACKING="$TEST_IMG"".qcow2"
+ 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
+ $QEMU_IMG create -f qcow2 $BACKING $image_size>/dev/null
+ extra_img_options="-o backing_file=$BACKING,image_file=$IMG"
+ fi
fi
if [ -n "$optstr" ]; then
@@ -114,6 +126,13 @@ _cleanup_test_img()
rm -f $TEST_DIR/t.$IMGFMT
rm -f $TEST_DIR/t.$IMGFMT.orig
rm -f $TEST_DIR/t.$IMGFMT.base
+ if [ "$IMGFMT" = "add-cow" ]; then
+ rm -f $TEST_DIR/t.$IMGFMT.qcow2
+ rm -f $TEST_DIR/t.$IMGFMT.raw
+ rm -f $TEST_DIR/t.$IMGFMT.raw.b
+ rm -f $TEST_DIR/t.$IMGFMT.ct.qcow2
+ rm -f $TEST_DIR/t.$IMGFMT.ct.raw
+ fi
;;
rbd)
--
1.7.9.5
next prev parent reply other threads:[~2012-05-07 17:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 17:34 [Qemu-devel] [PATCH 1/3 v9] add-cow file format Dong Xu Wang
2012-05-07 17:34 ` Dong Xu Wang [this message]
2012-05-07 17:34 ` [Qemu-devel] [PATCH 3/3 v9] add-cow: support snapshot_blkdev Dong Xu Wang
[not found] ` <CAJSP0QV0H+kta+tzk7hvBcXHM3q1OM=ofz26Nc4ziTb_Sb13Hg@mail.gmail.com>
[not found] ` <CAGrFBshR4f4oJ7zu2+spkZTG-=ov4S=p_HUkpK_dBcv+mwGNbg@mail.gmail.com>
[not found] ` <CAJSP0QWjfR_8EbgsV-xXFewPc=2syhHPB2BsRA+zMXkwtm_CMw@mail.gmail.com>
2012-06-04 8:15 ` [Qemu-devel] [PATCH 1/3 v9] add-cow file format Dong Xu Wang
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=1336412058-13751-2-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@linux.vnet.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).