qemu-iotests: Improvements for vmdk
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
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
@@ -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
PATCH 2/3 qemu-iotests: Add _unsupported_imgopts for vmdk subformats
In reply to Fam ZhengSome 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 3/3 qemu-iotests: Clean up all extents for vmdk
In reply to Fam ZhengThis 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
@@ -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
Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk
Quoted 16 lines · Fam Zheng
This modifies
_cleanup_test_imgto remove all the extent files listed by "qemu-img info"'s format specific information.Signed-off-by Fam Zheng <[email protected]>--- tests/qemu-iotests/common.rc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)tests/qemu-iotests/common.rc +0
-0@@ -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
Stefan Hajnoczi
AppliedQuoted 10 lines · Fam Zheng
Patch 1 and 2 add
_unsupported_imgoptsdeclaration 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_imgoptsfor 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