Skip to content

Commit

Permalink
qemu-iotests: Fix test 041
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: [email protected]
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
XanClic authored and Anthony Liguori committed Nov 27, 2013
1 parent 117e0c8 commit 171d643
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
32 changes: 24 additions & 8 deletions tests/qemu-iotests/041
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
4 changes: 2 additions & 2 deletions tests/qemu-iotests/041.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.........................
...........................
----------------------------------------------------------------------
Ran 25 tests
Ran 27 tests

OK

0 comments on commit 171d643

Please sign in to comment.