aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common.rc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/common.rc')
-rw-r--r--tests/qemu-iotests/common.rc28
1 files changed, 25 insertions, 3 deletions
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 28ba0d9ad5..0f68156400 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"
@@ -406,6 +417,17 @@ _default_cache_mode()
fi
}
+_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
+}
+
# this test requires that a specified command (executable) exists
#
_require_command()