[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 21/67] iotests/056: Honor $IMGOPTS
From: |
Max Reitz |
Subject: |
[PATCH 21/67] iotests/056: Honor $IMGOPTS |
Date: |
Tue, 1 Oct 2019 21:46:29 +0200 |
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/056 | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056
index 98c55d8e5a..58b4103cd9 100755
--- a/tests/qemu-iotests/056
+++ b/tests/qemu-iotests/056
@@ -23,7 +23,7 @@
import time
import os
import iotests
-from iotests import qemu_img, qemu_io, create_image
+from iotests import create_test_image, remove_test_image, qemu_io, create_image
backing_img = os.path.join(iotests.test_dir, 'backing.img')
test_img = os.path.join(iotests.test_dir, 'test.img')
@@ -31,18 +31,12 @@ target_img = os.path.join(iotests.test_dir, 'target.img')
def img_create(img, fmt=iotests.imgfmt, size='64M', **kwargs):
fullname = os.path.join(iotests.test_dir, '%s.%s' % (img, fmt))
- optargs = []
- for k,v in kwargs.items():
- optargs = optargs + ['-o', '%s=%s' % (k,v)]
- args = ['create', '-f', fmt] + optargs + [fullname, size]
- iotests.qemu_img(*args)
+ opts = []
+ for k, v in kwargs.items():
+ opts.append('%s=%s' % (k, v))
+ create_test_image(fullname, size, fmt=fmt, opts=opts)
return fullname
-def try_remove(img):
- try:
- os.remove(img)
- except OSError:
- pass
def io_write_patterns(img, patterns):
for pattern in patterns:
@@ -54,7 +48,7 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase):
def setUp(self):
create_image(backing_img, TestSyncModesNoneAndTop.image_len)
- qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
backing_img, test_img)
+ create_test_image(test_img, backing_file=backing_img)
qemu_io('-c', 'write -P0x41 0 512', test_img)
qemu_io('-c', 'write -P0xd5 1M 32k', test_img)
qemu_io('-c', 'write -P0xdc 32M 124k', test_img)
@@ -64,7 +58,7 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase):
def tearDown(self):
self.vm.shutdown()
- os.remove(test_img)
+ remove_test_image(test_img)
os.remove(backing_img)
try:
os.remove(target_img)
@@ -103,6 +97,8 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase):
self.assertEqual(-1, qemu_io('-c', 'read -P0x41 0 512',
target_img).find("verification failed"))
class TestBeforeWriteNotifier(iotests.QMPTestCase):
+ # blkdebug does not work with an external data file
+ @iotests.skip_for_imgopts(['data_file'])
def setUp(self):
self.vm =
iotests.VM().add_drive_raw("file=blkdebug::null-co://,id=drive0,align=65536,driver=blkdebug")
self.vm.launch()
@@ -139,9 +135,9 @@ class BackupTest(iotests.QMPTestCase):
def tearDown(self):
self.vm.shutdown()
- try_remove(self.test_img)
- try_remove(self.dest_img)
- try_remove(self.ref_img)
+ remove_test_image(self.test_img)
+ remove_test_image(self.dest_img)
+ remove_test_image(self.ref_img)
def hmp_io_writes(self, drive, patterns):
for pattern in patterns:
@@ -268,6 +264,8 @@ class BackupTest(iotests.QMPTestCase):
sync='full', target=self.dest_img,
auto_dismiss=False)
+ # blkdebug does not work with an external data file
+ @iotests.skip_for_imgopts(['data_file'])
def dismissal_failure(self, dismissal_opt):
res = self.vm.qmp('query-block-jobs')
self.assert_qmp(res, 'return', [])
--
2.21.0
- [PATCH 13/67] iotests/242: Hide refcount bit information, (continued)
- [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, 2019/10/01
- [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 <=
- [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
- [PATCH 27/67] iotests/129: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 29/67] iotests/139: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 30/67] iotests/147: Honor $IMGOPTS, Max Reitz, 2019/10/01