diff mbox series

[27/67] iotests/129: Honor $IMGOPTS

Message ID 20191001194715.2796-28-mreitz@redhat.com (mailing list archive)
State New, archived
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/129 | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/qemu-iotests/129 b/tests/qemu-iotests/129
index cd6b9e9ce7..379719d85b 100755
--- a/tests/qemu-iotests/129
+++ b/tests/qemu-iotests/129
@@ -20,6 +20,7 @@ 
 
 import os
 import iotests
+from iotests import create_test_image, remove_test_image
 import time
 
 class TestStopWithBlockJob(iotests.QMPTestCase):
@@ -28,8 +29,8 @@  class TestStopWithBlockJob(iotests.QMPTestCase):
     base_img = os.path.join(iotests.test_dir, 'base.img')
 
     def setUp(self):
-        iotests.qemu_img('create', '-f', iotests.imgfmt, self.base_img, "1G")
-        iotests.qemu_img('create', '-f', iotests.imgfmt, self.test_img, "-b", self.base_img)
+        create_test_image(self.base_img, '1G')
+        create_test_image(self.test_img, backing_file=self.base_img)
         iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write -P0x5d 1M 128M', self.test_img)
         self.vm = iotests.VM().add_drive(self.test_img)
         self.vm.launch()
@@ -46,6 +47,12 @@  class TestStopWithBlockJob(iotests.QMPTestCase):
         result = self.vm.qmp("block_set_io_throttle", conv_keys=False,
                              **params)
         self.vm.shutdown()
+        remove_test_image(self.test_img)
+        remove_test_image(self.base_img)
+        try:
+            os.remove(self.target_img)
+        except OSError:
+            pass
 
     def do_test_stop(self, cmd, **args):
         """Test 'stop' while block job is running on a throttled drive.