qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH for-1.7 2/2] qemu-iotests: Fix test 041


From: Max Reitz
Subject: [Qemu-devel] [PATCH for-1.7 2/2] qemu-iotests: Fix test 041
Date: Mon, 25 Nov 2013 20:28:56 +0100

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 <address@hidden>
---
 tests/qemu-iotests/041     | 32 ++++++++++++++++++++++++--------
 tests/qemu-iotests/041.out |  4 ++--
 2 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 5d40265..ec470b2 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'])
diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out
index 4fd1c2d..6d9bee1 100644
--- a/tests/qemu-iotests/041.out
+++ b/tests/qemu-iotests/041.out
@@ -1,5 +1,5 @@
-.........................
+...........................
 ----------------------------------------------------------------------
-Ran 25 tests
+Ran 27 tests
 
 OK
-- 
1.8.4.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]