@@ -20,7 +20,7 @@
import os
import iotests
-from iotests import qemu_img
+from iotests import create_test_image, remove_test_image
image0 = os.path.join(iotests.test_dir, 'image0')
image1 = os.path.join(iotests.test_dir, 'image1')
@@ -32,11 +32,11 @@ class TestFdSets(iotests.QMPTestCase):
def setUp(self):
self.vm = iotests.VM()
- qemu_img('create', '-f', iotests.imgfmt, image0, '128K')
- qemu_img('create', '-f', iotests.imgfmt, image1, '128K')
- qemu_img('create', '-f', iotests.imgfmt, image2, '128K')
- qemu_img('create', '-f', iotests.imgfmt, image3, '128K')
- qemu_img('create', '-f', iotests.imgfmt, image4, '128K')
+ create_test_image(image0, '128K')
+ create_test_image(image1, '128K')
+ create_test_image(image2, '128K')
+ create_test_image(image3, '128K')
+ create_test_image(image4, '128K')
self.file0 = open(image0, 'r')
self.file1 = open(image1, 'w+')
self.file2 = open(image2, 'r')
@@ -57,11 +57,11 @@ class TestFdSets(iotests.QMPTestCase):
self.file2.close()
self.file3.close()
self.file4.close()
- os.remove(image0)
- os.remove(image1)
- os.remove(image2)
- os.remove(image3)
- os.remove(image4)
+ remove_test_image(image0)
+ remove_test_image(image1)
+ remove_test_image(image2)
+ remove_test_image(image3)
+ remove_test_image(image4)
def test_query_fdset(self):
result = self.vm.qmp('query-fdsets')
@@ -129,7 +129,7 @@ class TestFdSets(iotests.QMPTestCase):
class TestSCMFd(iotests.QMPTestCase):
def setUp(self):
self.vm = iotests.VM()
- qemu_img('create', '-f', iotests.imgfmt, image0, '128K')
+ create_test_image(image0, '128K')
# Add an unused monitor, to verify it works fine when two monitor
# instances present
self.vm.add_monitor_null()
@@ -137,7 +137,7 @@ class TestSCMFd(iotests.QMPTestCase):
def tearDown(self):
self.vm.shutdown()
- os.remove(image0)
+ remove_test_image(image0)
def _send_fd_by_SCM(self):
ret = self.vm.send_fd_scm(file_path=image0)
Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/045 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)