aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/041
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2013-11-25 20:28:56 +0100
committerAnthony Liguori <aliguori@amazon.com>2013-11-27 07:53:32 -0800
commit171d64319c9604228429b0580edf764a69b67c75 (patch)
treedff0c6bd919659fe603a791a0d8d76e5cc302c3b /tests/qemu-iotests/041
parent117e0c82881f05d88902d4059a3171bc6cd02df0 (diff)
qemu-iotests: Fix test 041
Performing multiple drive-mirror blockjobs on the same qemu instance results in the image file used for the block device being replaced by the newly mirrored file, which is not what we want. Fix this by performing one dedicated test per sync mode. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1385407736-13941-3-git-send-email-mreitz@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'tests/qemu-iotests/041')
-rwxr-xr-xtests/qemu-iotests/04132
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 5d40265fb3..ec470b2007 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -691,16 +691,32 @@ class TestUnbackedSource(ImageMirroringTestCase):
os.remove(test_img)
os.remove(target_img)
- def test_absolute_paths(self):
+ def test_absolute_paths_full(self):
+ self.assert_no_active_block_jobs()
+ result = self.vm.qmp('drive-mirror', device='drive0',
+ sync='full', target=target_img,
+ mode='absolute-paths')
+ self.assert_qmp(result, 'return', {})
+ self.complete_and_wait()
+ self.assert_no_active_block_jobs()
+
+ def test_absolute_paths_top(self):
+ self.assert_no_active_block_jobs()
+ result = self.vm.qmp('drive-mirror', device='drive0',
+ sync='top', target=target_img,
+ mode='absolute-paths')
+ self.assert_qmp(result, 'return', {})
+ self.complete_and_wait()
self.assert_no_active_block_jobs()
- for sync_mode in ['full', 'top', 'none']:
- result = self.vm.qmp('drive-mirror', device='drive0',
- sync=sync_mode, target=target_img,
- mode='absolute-paths')
- self.assert_qmp(result, 'return', {})
- self.complete_and_wait()
- self.assert_no_active_block_jobs()
+ def test_absolute_paths_none(self):
+ self.assert_no_active_block_jobs()
+ result = self.vm.qmp('drive-mirror', device='drive0',
+ sync='none', target=target_img,
+ mode='absolute-paths')
+ self.assert_qmp(result, 'return', {})
+ self.complete_and_wait()
+ self.assert_no_active_block_jobs()
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2', 'qed'])