diff mbox series

[63/67] iotests/257: Honor $IMGOPTS

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

Commit Message

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

Patch

diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257
index 82c10e9b52..ea38945a71 100755
--- a/tests/qemu-iotests/257
+++ b/tests/qemu-iotests/257
@@ -23,7 +23,7 @@  import math
 import os
 
 import iotests
-from iotests import log, qemu_img
+from iotests import log, create_test_image, qemu_img
 
 SIZE = 64 * 1024 * 1024
 GRANULARITY = 64 * 1024
@@ -152,7 +152,7 @@  class Drive:
     def img_create(self, fmt, size):
         self.fmt = fmt
         self.size = size
-        iotests.qemu_img_create('-f', self.fmt, self.path, str(self.size))
+        create_test_image(self.path, self.size)
 
     def create_target(self, name, fmt, size):
         basename = os.path.basename(self.path)
@@ -273,10 +273,10 @@  def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None):
                         an incomplete backup. Testing limitations prevent
                         testing competing writes.
     """
-    with iotests.FilePaths(['img', 'bsync1', 'bsync2',
+    with iotests.ImagePath('img') as img_path, \
+        iotests.FilePaths(['bsync1', 'bsync2',
                             'fbackup0', 'fbackup1', 'fbackup2']) as \
-                            (img_path, bsync1, bsync2,
-                             fbackup0, fbackup1, fbackup2), \
+                            (bsync1, bsync2, fbackup0, fbackup1, fbackup2), \
          iotests.VM() as vm:
 
         mode = "Mode {:s}; Bitmap Sync {:s}".format(msync_mode, bsync_mode)
@@ -439,8 +439,8 @@  def test_backup_api():
     """
     Test malformed and prohibited invocations of the backup API.
     """
-    with iotests.FilePaths(['img', 'bsync1']) as \
-         (img_path, backup_path), \
+    with iotests.ImagePath('img') as img_path, \
+         iotests.FilePath('bsync1') as backup_path, \
          iotests.VM() as vm:
 
         log("\n=== API failure tests ===\n")