diff mbox series

[50/67] iotests/224: Honor $IMGOPTS

Message ID 20191001194715.2796-51-mreitz@redhat.com
State New
Headers show
Series iotests: Honor $IMGOPTS in Python tests | expand

Commit Message

Max Reitz Oct. 1, 2019, 7:46 p.m. UTC
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/224 | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/tests/qemu-iotests/224 b/tests/qemu-iotests/224
index e227d3ab3c..e9f5729c33 100755
--- a/tests/qemu-iotests/224
+++ b/tests/qemu-iotests/224
@@ -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