summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/041
diff options
context:
space:
mode:
authorMax Reitz2013-11-06 19:50:45 +0100
committerKevin Wolf2013-11-14 13:09:06 +0100
commitc15badee200f9e743e3639cc5e3e7dd62c69332f (patch)
tree645ef876adca3f7445419fa45b0249fe9afce0b4 /tests/qemu-iotests/041
parentblock/drive-mirror: Check for NULL backing_hd (diff)
downloadqemu-c15badee200f9e743e3639cc5e3e7dd62c69332f.tar.gz
qemu-c15badee200f9e743e3639cc5e3e7dd62c69332f.tar.xz
qemu-c15badee200f9e743e3639cc5e3e7dd62c69332f.zip
qemu-iotests: Extend 041 for unbacked mirroring
Add a new test case in file 041 for mirroring unbacked images in "absolute-paths" mode. This should work, if possible, but most importantly, qemu should never crash. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/041')
-rwxr-xr-xtests/qemu-iotests/04125
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 6661c0395d..5d40265fb3 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -677,5 +677,30 @@ class TestSetSpeed(ImageMirroringTestCase):
self.wait_ready_and_cancel()
+class TestUnbackedSource(ImageMirroringTestCase):
+ image_len = 2 * 1024 * 1024 # MB
+
+ def setUp(self):
+ qemu_img('create', '-f', iotests.imgfmt, test_img,
+ str(TestUnbackedSource.image_len))
+ self.vm = iotests.VM().add_drive(test_img)
+ self.vm.launch()
+
+ def tearDown(self):
+ self.vm.shutdown()
+ os.remove(test_img)
+ os.remove(target_img)
+
+ def test_absolute_paths(self):
+ 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()
+
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2', 'qed'])