@@ -21,8 +21,9 @@
# Creator/Owner: Max Reitz <mreitz@redhat.com>
import iotests
-from iotests import log, qemu_img, qemu_io_silent, filter_qmp_testfiles, \
- filter_qmp_imgfmt, filter_json_filename
+from iotests import log, create_test_image, qemu_io_silent, \
+ filter_qmp_testfiles, filter_qmp_imgfmt, \
+ filter_json_filename
import json
import re
@@ -47,17 +48,14 @@ for filter_node_name in False, True:
log('--- filter_node_name: %s ---' % filter_node_name)
log('')
- with iotests.FilePath('base.img') as base_img_path, \
- iotests.FilePath('mid.img') as mid_img_path, \
- iotests.FilePath('top.img') as top_img_path, \
+ with iotests.ImagePath('base.img') as base_img_path, \
+ iotests.ImagePath('mid.img') as mid_img_path, \
+ iotests.ImagePath('top.img') as top_img_path, \
iotests.VM() as vm:
- assert qemu_img('create', '-f', iotests.imgfmt,
- base_img_path, '64M') == 0
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
- mid_img_path) == 0
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
- top_img_path) == 0
+ assert create_test_image(base_img_path, '64M') == 0
+ assert create_test_image(mid_img_path, backing_file=base_img_path) == 0
+ assert create_test_image(top_img_path, backing_file=mid_img_path) == 0
# Something to commit
assert qemu_io_silent(mid_img_path, '-c', 'write -P 1 0 1M') == 0
Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/224 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)