qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements for vmdk
@ 2013-11-26  6:40 Fam Zheng
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 1/3] qemu-iotests: Introduce _unsupported_imgopts Fam Zheng
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Fam Zheng @ 2013-11-26  6:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

Patch 1 and 2 add _unsupported_imgopts declaration for vmdk subformats, so the
cases can be skipped if the subformat is not supported.

Patch 3 adds clean up for vmdk extents.

Fam Zheng (3):
  qemu-iotests: Introduce _unsupported_imgopts
  qemu-iotests: Add _unsupported_imgopts for vmdk subformats
  qemu-iotests: Clean up all extents for vmdk

 tests/qemu-iotests/017       |  1 +
 tests/qemu-iotests/018       |  1 +
 tests/qemu-iotests/019       |  3 +++
 tests/qemu-iotests/020       |  3 +++
 tests/qemu-iotests/034       |  3 +++
 tests/qemu-iotests/037       |  3 +++
 tests/qemu-iotests/059       |  3 +++
 tests/qemu-iotests/063       |  3 +++
 tests/qemu-iotests/069       |  1 +
 tests/qemu-iotests/common.rc | 28 +++++++++++++++++++++++++---
 10 files changed, 46 insertions(+), 3 deletions(-)

-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 1/3] qemu-iotests: Introduce _unsupported_imgopts
  2013-11-26  6:40 [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements for vmdk Fam Zheng
@ 2013-11-26  6:40 ` Fam Zheng
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 2/3] qemu-iotests: Add _unsupported_imgopts for vmdk subformats Fam Zheng
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Fam Zheng @ 2013-11-26  6:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

Introduce _unsupported_imgopts that causes _notrun for specific image
options.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/common.rc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 7f62457..d465c48 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -387,6 +387,17 @@ _supported_os()
     _notrun "not suitable for this OS: $HOSTOS"
 }
 
+_unsupported_imgopts()
+{
+    for bad_opt
+    do
+        if echo "$IMGOPTS" | grep -q 2>/dev/null "$bad_opt"
+        then
+            _notrun "not suitable for image option: $bad_opt"
+        fi
+    done
+}
+
 _unsupported_qemu_io_options()
 {
     for bad_opt
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 2/3] qemu-iotests: Add _unsupported_imgopts for vmdk subformats
  2013-11-26  6:40 [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements for vmdk Fam Zheng
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 1/3] qemu-iotests: Introduce _unsupported_imgopts Fam Zheng
@ 2013-11-26  6:40 ` Fam Zheng
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk Fam Zheng
  2014-01-02  9:49 ` [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements " Stefan Hajnoczi
  3 siblings, 0 replies; 6+ messages in thread
From: Fam Zheng @ 2013-11-26  6:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

Some cases are not applicable for vmdk subformats those don't support
certain features, e.g. backing file, and some others can't run on
mult-file image, e.g. monolithicFlat. This adds declaration in test
cases to skip them automatically, so that iotests on vmdk can go
more smoothly (without manually picking of cases for each subformat).

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/017 | 1 +
 tests/qemu-iotests/018 | 1 +
 tests/qemu-iotests/019 | 3 +++
 tests/qemu-iotests/020 | 3 +++
 tests/qemu-iotests/034 | 3 +++
 tests/qemu-iotests/037 | 3 +++
 tests/qemu-iotests/059 | 3 +++
 tests/qemu-iotests/063 | 3 +++
 tests/qemu-iotests/069 | 1 +
 9 files changed, 21 insertions(+)

diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index aba3faf..3af3cdf 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat"
 
 TEST_OFFSETS="0 4294967296"
 
diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018
index 15fcfe5..6f7f054 100755
--- a/tests/qemu-iotests/018
+++ b/tests/qemu-iotests/018
@@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat"
 
 TEST_OFFSETS="0 4294967296"
 
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
index 5bb18d0..b43e70f 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -47,6 +47,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
+                     "subformat=twoGbMaxExtentSparse"
 
 TEST_OFFSETS="0 4294967296"
 CLUSTER_SIZE=65536
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index b3c86d8..73a0429 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -45,6 +45,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
+                     "subformat=twoGbMaxExtentSparse"
 
 TEST_OFFSETS="0 4294967296"
 
diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034
index 67f1959..7349789 100755
--- a/tests/qemu-iotests/034
+++ b/tests/qemu-iotests/034
@@ -41,6 +41,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
+                     "subformat=twoGbMaxExtentSparse"
 
 CLUSTER_SIZE=4k
 size=128M
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
index 743bae3..e444349 100755
--- a/tests/qemu-iotests/037
+++ b/tests/qemu-iotests/037
@@ -41,6 +41,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
+                     "subformat=twoGbMaxExtentSparse"
 
 CLUSTER_SIZE=4k
 size=128M
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index 6a27ac9..bc2a73e 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -42,6 +42,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt vmdk
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
+                     "subformat=twoGbMaxExtentSparse"
 
 capacity_offset=16
 granularity_offset=20
diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063
index 2ab8f20..77503a2 100755
--- a/tests/qemu-iotests/063
+++ b/tests/qemu-iotests/063
@@ -44,6 +44,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed raw
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
+                     "subformat=twoGbMaxExtentSparse"
 
 _make_test_img 4M
 
diff --git a/tests/qemu-iotests/069 b/tests/qemu-iotests/069
index 3042803..50347d9 100755
--- a/tests/qemu-iotests/069
+++ b/tests/qemu-iotests/069
@@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt cow qed qcow qcow2 vmdk
 _supported_proto generic
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat"
 
 IMG_SIZE=128K
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk
  2013-11-26  6:40 [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements for vmdk Fam Zheng
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 1/3] qemu-iotests: Introduce _unsupported_imgopts Fam Zheng
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 2/3] qemu-iotests: Add _unsupported_imgopts for vmdk subformats Fam Zheng
@ 2013-11-26  6:40 ` Fam Zheng
  2014-01-02  9:40   ` Stefan Hajnoczi
  2014-01-02  9:49 ` [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements " Stefan Hajnoczi
  3 siblings, 1 reply; 6+ messages in thread
From: Fam Zheng @ 2013-11-26  6:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

This modifies _cleanup_test_img to remove all the extent files listed by
"qemu-img info"'s format specific information.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/common.rc | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index d465c48..fd635a0 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -170,6 +170,17 @@ _make_test_img()
     fi
 }
 
+_rm_test_img()
+{
+    local img=$1
+    if [ "$IMGFMT" = "vmdk" ]; then
+        # Remove all the extents for vmdk
+        $QEMU_IMG info $img 2>/dev/null | grep 'filename:' | cut -f 2 -d: \
+            | xargs -I {} rm -f "{}"
+    fi
+    rm -f $img
+}
+
 _cleanup_test_img()
 {
     case "$IMGPROTO" in
@@ -179,9 +190,9 @@ _cleanup_test_img()
             rm -f "$TEST_IMG_FILE"
             ;;
         file)
-            rm -f "$TEST_DIR/t.$IMGFMT"
-            rm -f "$TEST_DIR/t.$IMGFMT.orig"
-            rm -f "$TEST_DIR/t.$IMGFMT.base"
+            _rm_test_img "$TEST_DIR/t.$IMGFMT"
+            _rm_test_img "$TEST_DIR/t.$IMGFMT.orig"
+            _rm_test_img "$TEST_DIR/t.$IMGFMT.base"
             if [ -n "$SAMPLE_IMG_FILE" ]
             then
                 rm -f "$TEST_DIR/$SAMPLE_IMG_FILE"
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk Fam Zheng
@ 2014-01-02  9:40   ` Stefan Hajnoczi
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2014-01-02  9:40 UTC (permalink / raw)
  To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha

On Tue, Nov 26, 2013 at 02:40:34PM +0800, Fam Zheng wrote:
> This modifies _cleanup_test_img to remove all the extent files listed by
> "qemu-img info"'s format specific information.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/qemu-iotests/common.rc | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index d465c48..fd635a0 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -170,6 +170,17 @@ _make_test_img()
>      fi
>  }
>  
> +_rm_test_img()
> +{
> +    local img=$1
> +    if [ "$IMGFMT" = "vmdk" ]; then
> +        # Remove all the extents for vmdk
> +        $QEMU_IMG info $img 2>/dev/null | grep 'filename:' | cut -f 2 -d: \
> +            | xargs -I {} rm -f "{}"
> +    fi
> +    rm -f $img
> +}

It would be nice to simply rm -rf "$TEST_DIR" instead of picking
individual files.

Not sure if anything prevents us from doing that.  Anyway, this patch is
okay for now.

Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements for vmdk
  2013-11-26  6:40 [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements for vmdk Fam Zheng
                   ` (2 preceding siblings ...)
  2013-11-26  6:40 ` [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk Fam Zheng
@ 2014-01-02  9:49 ` Stefan Hajnoczi
  3 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2014-01-02  9:49 UTC (permalink / raw)
  To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha

On Tue, Nov 26, 2013 at 02:40:31PM +0800, Fam Zheng wrote:
> Patch 1 and 2 add _unsupported_imgopts declaration for vmdk subformats, so the
> cases can be skipped if the subformat is not supported.
> 
> Patch 3 adds clean up for vmdk extents.
> 
> Fam Zheng (3):
>   qemu-iotests: Introduce _unsupported_imgopts
>   qemu-iotests: Add _unsupported_imgopts for vmdk subformats
>   qemu-iotests: Clean up all extents for vmdk
> 
>  tests/qemu-iotests/017       |  1 +
>  tests/qemu-iotests/018       |  1 +
>  tests/qemu-iotests/019       |  3 +++
>  tests/qemu-iotests/020       |  3 +++
>  tests/qemu-iotests/034       |  3 +++
>  tests/qemu-iotests/037       |  3 +++
>  tests/qemu-iotests/059       |  3 +++
>  tests/qemu-iotests/063       |  3 +++
>  tests/qemu-iotests/069       |  1 +
>  tests/qemu-iotests/common.rc | 28 +++++++++++++++++++++++++---
>  10 files changed, 46 insertions(+), 3 deletions(-)

Thanks, applied to my block-next tree:
https://github.com/stefanha/qemu/commits/block-next

Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-02  9:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-26  6:40 [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements for vmdk Fam Zheng
2013-11-26  6:40 ` [Qemu-devel] [PATCH 1/3] qemu-iotests: Introduce _unsupported_imgopts Fam Zheng
2013-11-26  6:40 ` [Qemu-devel] [PATCH 2/3] qemu-iotests: Add _unsupported_imgopts for vmdk subformats Fam Zheng
2013-11-26  6:40 ` [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk Fam Zheng
2014-01-02  9:40   ` Stefan Hajnoczi
2014-01-02  9:49 ` [Qemu-devel] [PATCH 0/3] qemu-iotests: Improvements " Stefan Hajnoczi

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).