[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 26/67] iotests/124: Honor $IMGOPTS
From: |
Max Reitz |
Subject: |
[PATCH 26/67] iotests/124: Honor $IMGOPTS |
Date: |
Tue, 1 Oct 2019 21:46:34 +0200 |
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/124 | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124
index d3e851e1ae..145dccb2b0 100755
--- a/tests/qemu-iotests/124
+++ b/tests/qemu-iotests/124
@@ -22,6 +22,7 @@
import os
import iotests
+from iotests import create_test_image, remove_test_image
def io_write_patterns(img, patterns):
@@ -29,13 +30,6 @@ def io_write_patterns(img, patterns):
iotests.qemu_io('-c', 'write -P%s %s %s' % pattern, img)
-def try_remove(img):
- try:
- os.remove(img)
- except OSError:
- pass
-
-
def transaction_action(action, **kwargs):
return {
'type': action,
@@ -82,13 +76,13 @@ class Bitmap:
def del_target(self):
for image in self.backups.pop():
- try_remove(image)
+ remove_test_image(image)
self.num -= 1
def cleanup(self):
for backup in self.backups:
for image in backup:
- try_remove(image)
+ remove_test_image(image)
class TestIncrementalBackupBase(iotests.QMPTestCase):
@@ -133,15 +127,14 @@ class TestIncrementalBackupBase(iotests.QMPTestCase):
def img_create(self, img, fmt=iotests.imgfmt, size='64M',
parent=None, parentFormat=None, **kwargs):
- optargs = []
- for k,v in kwargs.items():
- optargs = optargs + ['-o', '%s=%s' % (k,v)]
- args = ['create', '-f', fmt] + optargs + [img, size]
+ opts = []
+ for k, v in kwargs.items():
+ opts.append('%s=%s' % (k, v))
if parent:
if parentFormat is None:
parentFormat = fmt
- args = args + ['-b', parent, '-F', parentFormat]
- iotests.qemu_img(*args)
+ create_test_image(img, size, fmt=fmt, backing_file=parent,
+ backing_fmt=parentFormat, opts=opts)
self.files.append(img)
@@ -287,7 +280,7 @@ class TestIncrementalBackupBase(iotests.QMPTestCase):
for bitmap in self.bitmaps:
bitmap.cleanup()
for filename in self.files:
- try_remove(filename)
+ remove_test_image(filename)
@@ -414,6 +407,8 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
self.check_backups()
+ # blkdebug does not work with an external data file
+ @iotests.skip_for_imgopts(['data_file'])
def do_transaction_failure_test(self, race=False):
# Create a second drive, with pattern:
drive1 = self.add_node('drive1')
@@ -608,6 +603,8 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
'''Incremental backup tests that utilize a BlkDebug filter on drive0.'''
+ # blkdebug does not work with an external data file
+ @iotests.skip_for_imgopts(['data_file'])
def setUp(self):
drive0 = self.add_node('drive0')
self.img_create(drive0['file'], drive0['fmt'])
--
2.21.0
- [PATCH 16/67] iotests/040: Honor $IMGOPTS, (continued)
- [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, 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 <=
- [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
- [PATCH 32/67] iotests/151: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 31/67] iotests/148: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 33/67] iotests/152: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 34/67] iotests/155: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 35/67] iotests/163: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 36/67] iotests/165: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 37/67] iotests/169: Honor $IMGOPTS, Max Reitz, 2019/10/01