[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 09/58] iotests: 055: Don't attach the target image al
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 09/58] iotests: 055: Don't attach the target image already for drive-backup |
Date: |
Thu, 11 May 2017 16:32:12 +0200 |
From: Fam Zheng <address@hidden>
Double attach is not a valid usage of the target image, drive-backup
will open the blockdev itself so skip the add_drive call in this case.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/055 | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
index aafcd24..ba4da65 100755
--- a/tests/qemu-iotests/055
+++ b/tests/qemu-iotests/055
@@ -458,17 +458,18 @@ class TestDriveCompression(iotests.QMPTestCase):
except OSError:
pass
- def do_prepare_drives(self, fmt, args):
+ def do_prepare_drives(self, fmt, args, attach_target):
self.vm = iotests.VM().add_drive(test_img)
qemu_img('create', '-f', fmt, blockdev_target_img,
str(TestDriveCompression.image_len), *args)
- self.vm.add_drive(blockdev_target_img, format=fmt, interface="none")
+ if attach_target:
+ self.vm.add_drive(blockdev_target_img, format=fmt,
interface="none")
self.vm.launch()
- def do_test_compress_complete(self, cmd, format, **args):
- self.do_prepare_drives(format['type'], format['args'])
+ def do_test_compress_complete(self, cmd, format, attach_target, **args):
+ self.do_prepare_drives(format['type'], format['args'], attach_target)
self.assert_no_active_block_jobs()
@@ -484,15 +485,16 @@ class TestDriveCompression(iotests.QMPTestCase):
def test_complete_compress_drive_backup(self):
for format in TestDriveCompression.fmt_supports_compression:
- self.do_test_compress_complete('drive-backup', format,
+ self.do_test_compress_complete('drive-backup', format, False,
target=blockdev_target_img,
mode='existing')
def test_complete_compress_blockdev_backup(self):
for format in TestDriveCompression.fmt_supports_compression:
- self.do_test_compress_complete('blockdev-backup', format,
target='drive1')
+ self.do_test_compress_complete('blockdev-backup', format, True,
+ target='drive1')
- def do_test_compress_cancel(self, cmd, format, **args):
- self.do_prepare_drives(format['type'], format['args'])
+ def do_test_compress_cancel(self, cmd, format, attach_target, **args):
+ self.do_prepare_drives(format['type'], format['args'], attach_target)
self.assert_no_active_block_jobs()
@@ -506,15 +508,16 @@ class TestDriveCompression(iotests.QMPTestCase):
def test_compress_cancel_drive_backup(self):
for format in TestDriveCompression.fmt_supports_compression:
- self.do_test_compress_cancel('drive-backup', format,
+ self.do_test_compress_cancel('drive-backup', format, False,
target=blockdev_target_img,
mode='existing')
def test_compress_cancel_blockdev_backup(self):
for format in TestDriveCompression.fmt_supports_compression:
- self.do_test_compress_cancel('blockdev-backup', format,
target='drive1')
+ self.do_test_compress_cancel('blockdev-backup', format, True,
+ target='drive1')
- def do_test_compress_pause(self, cmd, format, **args):
- self.do_prepare_drives(format['type'], format['args'])
+ def do_test_compress_pause(self, cmd, format, attach_target, **args):
+ self.do_prepare_drives(format['type'], format['args'], attach_target)
self.assert_no_active_block_jobs()
@@ -546,12 +549,13 @@ class TestDriveCompression(iotests.QMPTestCase):
def test_compress_pause_drive_backup(self):
for format in TestDriveCompression.fmt_supports_compression:
- self.do_test_compress_pause('drive-backup', format,
+ self.do_test_compress_pause('drive-backup', format, False,
target=blockdev_target_img,
mode='existing')
def test_compress_pause_blockdev_backup(self):
for format in TestDriveCompression.fmt_supports_compression:
- self.do_test_compress_pause('blockdev-backup', format,
target='drive1')
+ self.do_test_compress_pause('blockdev-backup', format, True,
+ target='drive1')
if __name__ == '__main__':
iotests.main(supported_fmts=['raw', 'qcow2'])
--
1.8.3.1
- [Qemu-block] [PULL 00/58] Block layer patches, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 01/58] block: Make bdrv_perm_names public, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 03/58] block: Respect "force-share" in perm propagating, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 02/58] block: Add, parse and store "force-share" option, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 06/58] qemu-io: Add --force-share option, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 04/58] qemu-img: Add --force-share option to subcommands, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 09/58] iotests: 055: Don't attach the target image already for drive-backup,
Kevin Wolf <=
- [Qemu-block] [PULL 05/58] qemu-img: Update documentation for -U, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 08/58] iotests: 046: Prepare for image locking, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 07/58] iotests: 030: Prepare for image locking, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 10/58] iotests: 085: Avoid image locking conflict, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 11/58] iotests: 087: Don't attach test image twice, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 12/58] iotests: 091: Quit QEMU before checking image, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 13/58] iotests: 172: Use separate images for multiple devices, Kevin Wolf, 2017/05/11
- [Qemu-block] [PULL 17/58] tests: Disable image lock in test-replication, Kevin Wolf, 2017/05/11