Skip to contentSkip to conversation

qemu-iotests: Improvements for vmdk

PATCH Applied Fam Zheng 2 participants 6 messages Nov 26, 2013 – Jan 2, 2014

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

cover qemu-iotests: Improvements for vmdk

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(-)
Signature · 1 line
1.8.4.2
author
#1 lore raw

PATCH 1/3 qemu-iotests: Introduce _unsupported_imgopts

Introduce _unsupported_imgopts that causes _notrun for specific image options.

---
 tests/qemu-iotests/common.rc | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/qemu-iotests/common.rc +11 -0
index 7f62457..d465c48 100644
@@ -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
Signature · 1 line
1.8.4.2
author
#2 lore raw

PATCH 2/3 qemu-iotests: Add _unsupported_imgopts for vmdk subformats

In reply to Fam Zheng

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

---
 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(+)
tests/qemu-iotests/017 +1 -0
index aba3faf..3af3cdf 100755
@@ -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"
 
tests/qemu-iotests/018 +1 -0
index 15fcfe5..6f7f054 100755
@@ -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"
 
tests/qemu-iotests/019 +3 -0
index 5bb18d0..b43e70f 100755
@@ -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
tests/qemu-iotests/020 +3 -0
index b3c86d8..73a0429 100755
@@ -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"
 
tests/qemu-iotests/034 +3 -0
index 67f1959..7349789 100755
@@ -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
tests/qemu-iotests/037 +3 -0
index 743bae3..e444349 100755
@@ -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
tests/qemu-iotests/059 +3 -0
index 6a27ac9..bc2a73e 100755
@@ -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
tests/qemu-iotests/063 +3 -0
index 2ab8f20..77503a2 100755
@@ -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
 
tests/qemu-iotests/069 +1 -0
index 3042803..50347d9 100755
@@ -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
 
Signature · 1 line
1.8.4.2
author
#3 lore raw

PATCH 3/3 qemu-iotests: Clean up all extents for vmdk

In reply to Fam Zheng

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

---
 tests/qemu-iotests/common.rc | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
tests/qemu-iotests/common.rc +14 -3
index d465c48..fd635a0 100644
@@ -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"
Signature · 1 line
1.8.4.2
#4 lore raw

Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk

Quoted 16 lines · Fam Zheng

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

---
 tests/qemu-iotests/common.rc | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
tests/qemu-iotests/common.rc +0 -0
index d465c48..fd635a0 100644
@@ -170,6 +170,17 @@ _make_test_img()
     fi
 }
 

tests/qemu-iotests/common.rc _make_test_img() · line 182

Quoted 10 lines
tests/qemu-iotests/common.rc +10 -0
+_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

#5 lore raw
In reply to Fam Zheng
Quoted 10 lines · Fam Zheng

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

Quoted 11 lines
 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