Patchwork qemu-iotests: Test subformats for vmdk

login
register
mail settings
Submitter Fam Zheng
Date April 17, 2013, 12:58 p.m.
Message ID <1366203538-28104-1-git-send-email-famz@redhat.com>
Download mbox | patch
Permalink /patch/237213/
State New
Headers show

Comments

Fam Zheng - April 17, 2013, 12:58 p.m.
Added format options for testing vmdk subformats:

    $ ./check -h
    Usage: ./check [options] [testlist]

    common options
        -v          verbose

    check options
        ...
        -vpc                test vpc
        -vmdk               test vmdk (identical to -vmdk-monolithicSparse)
        -vmdk-monolithicSparse
                            test vmdk monolithic sparse
        -vmdk-monolithicFlat
                            test vmdk monolithic flat
        -vmdk-twoGbMaxExtentSparse
                            test vmdk two gb splitted sparse
        -vmdk-twoGbMaxExtentFlat
                            test vmdk two gb splitted sparse
        -rbd                test rbd
        ...

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/common    | 31 +++++++++++++++++++++++++++++--
 tests/qemu-iotests/common.rc |  4 ++++
 2 files changed, 33 insertions(+), 2 deletions(-)
Kevin Wolf - April 17, 2013, 1:06 p.m.
Am 17.04.2013 um 14:58 hat Fam Zheng geschrieben:
> Added format options for testing vmdk subformats:
> 
>     $ ./check -h
>     Usage: ./check [options] [testlist]
> 
>     common options
>         -v          verbose
> 
>     check options
>         ...
>         -vpc                test vpc
>         -vmdk               test vmdk (identical to -vmdk-monolithicSparse)
>         -vmdk-monolithicSparse
>                             test vmdk monolithic sparse
>         -vmdk-monolithicFlat
>                             test vmdk monolithic flat
>         -vmdk-twoGbMaxExtentSparse
>                             test vmdk two gb splitted sparse
>         -vmdk-twoGbMaxExtentFlat
>                             test vmdk two gb splitted sparse
>         -rbd                test rbd
>         ...
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>

Shouldn't -o be enough to cover all of this? For example, we're also
running qcow2 tests with -o compat=[0.10|1.1] and don't introduce a
separate option for each.

In practice, of course, the problem is that the non-default is rarely
run. Maybe we should add a tests/qemu-iotest-slow.sh that covers some
more combinations.

> @@ -124,6 +127,7 @@ _make_test_img()
>              -e "s# compat='[^']*'##g" \
>              -e "s# compat6=\\(on\\|off\\)##g" \
>              -e "s# static=\\(on\\|off\\)##g" \
> +            -e "s# subformat='[^']*'##g" \
>              -e "s# lazy_refcounts=\\(on\\|off\\)##g"
>  
>      # Start an NBD server on the image file, which is what we'll be talking to

This hunk we'll need in any case, of course.

Kevin
Fam Zheng - April 18, 2013, 2:26 a.m.
On Wed, 04/17 15:06, Kevin Wolf wrote:
> Am 17.04.2013 um 14:58 hat Fam Zheng geschrieben:
> > Added format options for testing vmdk subformats:
> > 
> >     $ ./check -h
> >     Usage: ./check [options] [testlist]
> > 
> >     common options
> >         -v          verbose
> > 
> >     check options
> >         ...
> >         -vpc                test vpc
> >         -vmdk               test vmdk (identical to -vmdk-monolithicSparse)
> >         -vmdk-monolithicSparse
> >                             test vmdk monolithic sparse
> >         -vmdk-monolithicFlat
> >                             test vmdk monolithic flat
> >         -vmdk-twoGbMaxExtentSparse
> >                             test vmdk two gb splitted sparse
> >         -vmdk-twoGbMaxExtentFlat
> >                             test vmdk two gb splitted sparse
> >         -rbd                test rbd
> >         ...
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> 
> Shouldn't -o be enough to cover all of this? For example, we're also
> running qcow2 tests with -o compat=[0.10|1.1] and don't introduce a
> separate option for each.

Agreed, OK.

> 
> > @@ -124,6 +127,7 @@ _make_test_img()
> >              -e "s# compat='[^']*'##g" \
> >              -e "s# compat6=\\(on\\|off\\)##g" \
> >              -e "s# static=\\(on\\|off\\)##g" \
> > +            -e "s# subformat='[^']*'##g" \
> >              -e "s# lazy_refcounts=\\(on\\|off\\)##g"
> >  
> >      # Start an NBD server on the image file, which is what we'll be talking to
> 
> This hunk we'll need in any case, of course.

OK.
I'll include this later in with more VMDK tests.

Patch

diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index b3aad89..b7f23bf 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -133,7 +133,15 @@  check options
     -qed                test qed
     -vdi                test vdi
     -vpc                test vpc
-    -vmdk               test vmdk
+    -vmdk               test vmdk (identical to -vmdk-monolithicSparse)
+    -vmdk-monolithicSparse
+                        test vmdk monolithic sparse
+    -vmdk-monolithicFlat
+                        test vmdk monolithic flat
+    -vmdk-twoGbMaxExtentSparse
+                        test vmdk two gb splitted sparse
+    -vmdk-twoGbMaxExtentFlat
+                        test vmdk two gb splitted sparse
     -rbd                test rbd
     -sheepdog           test sheepdog
     -nbd                test nbd
@@ -184,8 +192,27 @@  testlist options
 	    xpand=false
 	    ;;
 
-	-vmdk)
+	-vmdk|-vmdk-monolithicSparse)
 	    IMGFMT=vmdk
+	    export SUBFMT=monolithicSparse
+	    xpand=false
+	    ;;
+
+	-vmdk-monolithicFlat)
+	    IMGFMT=vmdk
+	    export SUBFMT=monolithicFlat
+	    xpand=false
+	    ;;
+
+	-vmdk-twoGbMaxExtentSparse)
+	    IMGFMT=vmdk
+	    export SUBFMT=twoGbMaxExtentSparse
+	    xpand=false
+	    ;;
+
+	-vmdk-twoGbMaxExtentFlat)
+	    IMGFMT=vmdk
+	    export SUBFMT=twoGbMaxExtentFlat
 	    xpand=false
 	    ;;
 
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index e522d61..d786319 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -108,6 +108,9 @@  _make_test_img()
     if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE" ]; then
         optstr=$(_optstr_add "$optstr" "cluster_size=$CLUSTER_SIZE")
     fi
+    if [ -n "$SUBFMT" ]; then
+        optstr=$(_optstr_add "$optstr" "subformat=$SUBFMT")
+    fi
 
     if [ -n "$optstr" ]; then
         extra_img_options="-o $optstr $extra_img_options"
@@ -124,6 +127,7 @@  _make_test_img()
             -e "s# compat='[^']*'##g" \
             -e "s# compat6=\\(on\\|off\\)##g" \
             -e "s# static=\\(on\\|off\\)##g" \
+            -e "s# subformat='[^']*'##g" \
             -e "s# lazy_refcounts=\\(on\\|off\\)##g"
 
     # Start an NBD server on the image file, which is what we'll be talking to