]> git.proxmox.com Git - qemu.git/commitdiff
qemu-iotests: Fix test 041
authorMax Reitz <mreitz@redhat.com>
Mon, 25 Nov 2013 19:28:56 +0000 (20:28 +0100)
committerAnthony Liguori <aliguori@amazon.com>
Wed, 27 Nov 2013 15:53:32 +0000 (07:53 -0800)
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>
tests/qemu-iotests/041
tests/qemu-iotests/041.out

index 5d40265fb372eab24bbe0c138a8f5fca77c2f8e3..ec470b200728ee0684961dbfb7df64853004000d 100755 (executable)
@@ -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'])
index 4fd1c2dcd218ecf87e18b7a6b4542c4acd892ea0..6d9bee1a4b3cc501c6d6c3954d56289d4becb04a 100644 (file)
@@ -1,5 +1,5 @@
-.........................
+...........................
 ----------------------------------------------------------------------
-Ran 25 tests
+Ran 27 tests
 
 OK