[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/67] iotests/040: Honor $IMGOPTS
From: |
Max Reitz |
Subject: |
[PATCH 16/67] iotests/040: Honor $IMGOPTS |
Date: |
Tue, 1 Oct 2019 21:46:24 +0200 |
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/040 | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index 762ad1ebcb..9584eeeb1f 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -24,7 +24,7 @@
import time
import os
import iotests
-from iotests import qemu_img, qemu_io
+from iotests import create_test_image, remove_test_image, qemu_img, qemu_io
import struct
import errno
@@ -80,8 +80,8 @@ class TestSingleDrive(ImageCommitTestCase):
def setUp(self):
iotests.create_image(backing_img, self.image_len)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
backing_img, mid_img)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
mid_img, test_img)
+ create_test_image(mid_img, backing_file=backing_img)
+ create_test_image(test_img, backing_file=mid_img)
qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img)
qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288',
mid_img)
self.vm = iotests.VM().add_drive(test_img,
"node-name=top,backing.node-name=mid,backing.backing.node-name=base",
interface="none")
@@ -92,8 +92,8 @@ class TestSingleDrive(ImageCommitTestCase):
def tearDown(self):
self.vm.shutdown(has_quit=self.has_quit)
- os.remove(test_img)
- os.remove(mid_img)
+ remove_test_image(test_img)
+ remove_test_image(mid_img)
os.remove(backing_img)
def test_commit(self):
@@ -303,8 +303,8 @@ class TestRelativePaths(ImageCommitTestCase):
if exception.errno != errno.EEXIST:
raise
iotests.create_image(self.backing_img_abs, TestRelativePaths.image_len)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
self.backing_img_abs, self.mid_img_abs)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
self.mid_img_abs, self.test_img)
+ create_test_image(self.mid_img_abs, backing_file=self.backing_img_abs)
+ create_test_image(self.test_img, backing_file=self.mid_img_abs)
qemu_img('rebase', '-u', '-b', self.backing_img, self.mid_img_abs)
qemu_img('rebase', '-u', '-b', self.mid_img, self.test_img)
qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288',
self.backing_img_abs)
@@ -314,8 +314,8 @@ class TestRelativePaths(ImageCommitTestCase):
def tearDown(self):
self.vm.shutdown()
- os.remove(self.test_img)
- os.remove(self.mid_img_abs)
+ remove_test_image(self.test_img)
+ remove_test_image(self.mid_img_abs)
os.remove(self.backing_img_abs)
try:
os.rmdir(os.path.join(iotests.test_dir, self.dir1))
@@ -368,9 +368,9 @@ class TestSetSpeed(ImageCommitTestCase):
image_len = 80 * 1024 * 1024 # MB
def setUp(self):
- qemu_img('create', backing_img, str(TestSetSpeed.image_len))
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
backing_img, mid_img)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
mid_img, test_img)
+ create_test_image(backing_img, TestSetSpeed.image_len)
+ create_test_image(mid_img, backing_file=backing_img)
+ create_test_image(test_img, backing_file=mid_img)
qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 0 512', test_img)
qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288',
mid_img)
self.vm = iotests.VM().add_drive('blkdebug::' + test_img)
@@ -378,9 +378,9 @@ class TestSetSpeed(ImageCommitTestCase):
def tearDown(self):
self.vm.shutdown()
- os.remove(test_img)
- os.remove(mid_img)
- os.remove(backing_img)
+ remove_test_image(test_img)
+ remove_test_image(mid_img)
+ remove_test_image(backing_img)
def test_set_speed(self):
self.assert_no_active_block_jobs()
@@ -408,9 +408,9 @@ class TestReopenOverlay(ImageCommitTestCase):
def setUp(self):
iotests.create_image(self.img0, self.image_len)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
self.img0, self.img1)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
self.img1, self.img2)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
self.img2, self.img3)
+ create_test_image(self.img1, backing_file=self.img0)
+ create_test_image(self.img2, backing_file=self.img1)
+ create_test_image(self.img3, backing_file=self.img2)
qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xab 0 128K', self.img1)
self.vm = iotests.VM().add_drive(self.img3)
self.vm.launch()
@@ -418,9 +418,9 @@ class TestReopenOverlay(ImageCommitTestCase):
def tearDown(self):
self.vm.shutdown()
os.remove(self.img0)
- os.remove(self.img1)
- os.remove(self.img2)
- os.remove(self.img3)
+ remove_test_image(self.img1)
+ remove_test_image(self.img2)
+ remove_test_image(self.img3)
# This tests what happens when the overlay image of the 'top' node
# needs to be reopened in read-write mode in order to update the
--
2.21.0
- [PATCH 09/67] iotests.py: Add @hide_fields to img_info_log, (continued)
- [PATCH 09/67] iotests.py: Add @hide_fields to img_info_log, Max Reitz, 2019/10/01
- [PATCH 05/67] iotests.py: Add ImagePaths, Max Reitz, 2019/10/01
- [PATCH 12/67] iotests/228: Filter json:{} filenames, Max Reitz, 2019/10/01
- [PATCH 13/67] iotests/242: Hide refcount bit information, Max Reitz, 2019/10/01
- [PATCH 07/67] iotests.py: Filter data_file in filter_img_info, Max Reitz, 2019/10/01
- [PATCH 11/67] iotests/224: Filter json:{} from commit command, Max Reitz, 2019/10/01
- [PATCH 14/67] iotests: Use unsupported_imgopts in Python tests, Max Reitz, 2019/10/01
- [PATCH 10/67] iotests/169: Skip persistent cases for compat=0.10, Max Reitz, 2019/10/01
- [PATCH 15/67] iotests/030: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 18/67] iotests/044: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 16/67] iotests/040: Honor $IMGOPTS,
Max Reitz <=
- [PATCH 17/67] iotests/041: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 19/67] iotests/045: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 21/67] iotests/056: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 22/67] iotests/057: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 23/67] iotests/065: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 20/67] iotests/055: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 24/67] iotests/096: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 25/67] iotests/118: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 28/67] iotests/132: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 26/67] iotests/124: Honor $IMGOPTS, Max Reitz, 2019/10/01