提交 171d6431 编写于 作者: M Max Reitz 提交者: Anthony Liguori

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: NMax Reitz <mreitz@redhat.com>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-id: 1385407736-13941-3-git-send-email-mreitz@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
上级 117e0c82
...@@ -691,16 +691,32 @@ class TestUnbackedSource(ImageMirroringTestCase): ...@@ -691,16 +691,32 @@ class TestUnbackedSource(ImageMirroringTestCase):
os.remove(test_img) os.remove(test_img)
os.remove(target_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() self.assert_no_active_block_jobs()
for sync_mode in ['full', 'top', 'none']: def test_absolute_paths_none(self):
result = self.vm.qmp('drive-mirror', device='drive0', self.assert_no_active_block_jobs()
sync=sync_mode, target=target_img, result = self.vm.qmp('drive-mirror', device='drive0',
mode='absolute-paths') sync='none', target=target_img,
self.assert_qmp(result, 'return', {}) mode='absolute-paths')
self.complete_and_wait() self.assert_qmp(result, 'return', {})
self.assert_no_active_block_jobs() self.complete_and_wait()
self.assert_no_active_block_jobs()
if __name__ == '__main__': if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2', 'qed']) iotests.main(supported_fmts=['qcow2', 'qed'])
......................... ...........................
---------------------------------------------------------------------- ----------------------------------------------------------------------
Ran 25 tests Ran 27 tests
OK OK
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册