0a122b
From 8a95de5d6c85d1db0f32ab5083ff9e00166a7ee8 Mon Sep 17 00:00:00 2001
0a122b
From: Max Reitz <mreitz@redhat.com>
0a122b
Date: Sun, 19 Jan 2014 18:08:01 +0100
0a122b
Subject: [PATCH 27/34] qemu-iotests: Fix test 041
0a122b
0a122b
RH-Author: Max Reitz <mreitz@redhat.com>
0a122b
Message-id: <1390154881-17140-8-git-send-email-mreitz@redhat.com>
0a122b
Patchwork-id: 56820
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 7/7] qemu-iotests: Fix test 041
0a122b
Bugzilla: 921890
0a122b
RH-Acked-by: Fam Zheng <famz@redhat.com>
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
0a122b
0a122b
BZ: 921890
0a122b
0a122b
Performing multiple drive-mirror blockjobs on the same qemu instance
0a122b
results in the image file used for the block device being replaced by
0a122b
the newly mirrored file, which is not what we want.
0a122b
0a122b
Fix this by performing one dedicated test per sync mode.
0a122b
0a122b
Signed-off-by: Max Reitz <mreitz@redhat.com>
0a122b
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
0a122b
Reviewed-by: Eric Blake <eblake@redhat.com>
0a122b
Message-id: 1385407736-13941-3-git-send-email-mreitz@redhat.com
0a122b
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
0a122b
(cherry picked from commit 171d64319c9604228429b0580edf764a69b67c75)
0a122b
0a122b
Signed-off-by: Max Reitz <mreitz@redhat.com>
0a122b
---
0a122b
 tests/qemu-iotests/041     | 32 ++++++++++++++++++++++++--------
0a122b
 tests/qemu-iotests/041.out |  4 ++--
0a122b
 2 files changed, 26 insertions(+), 10 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 tests/qemu-iotests/041     |   32 ++++++++++++++++++++++++--------
0a122b
 tests/qemu-iotests/041.out |    4 ++--
0a122b
 2 files changed, 26 insertions(+), 10 deletions(-)
0a122b
0a122b
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
0a122b
index eccfe38..bcfb759 100755
0a122b
--- a/tests/qemu-iotests/041
0a122b
+++ b/tests/qemu-iotests/041
0a122b
@@ -750,16 +750,32 @@ class TestUnbackedSource(ImageMirroringTestCase):
0a122b
         os.remove(test_img)
0a122b
         os.remove(target_img)
0a122b
 
0a122b
-    def test_absolute_paths(self):
0a122b
+    def test_absolute_paths_full(self):
0a122b
+        self.assert_no_active_block_jobs()
0a122b
+        result = self.vm.qmp('drive-mirror', device='drive0',
0a122b
+                             sync='full', target=target_img,
0a122b
+                             mode='absolute-paths')
0a122b
+        self.assert_qmp(result, 'return', {})
0a122b
+        self.complete_and_wait()
0a122b
+        self.assert_no_active_block_jobs()
0a122b
+
0a122b
+    def test_absolute_paths_top(self):
0a122b
+        self.assert_no_active_block_jobs()
0a122b
+        result = self.vm.qmp('drive-mirror', device='drive0',
0a122b
+                             sync='top', target=target_img,
0a122b
+                             mode='absolute-paths')
0a122b
+        self.assert_qmp(result, 'return', {})
0a122b
+        self.complete_and_wait()
0a122b
         self.assert_no_active_block_jobs()
0a122b
 
0a122b
-        for sync_mode in ['full', 'top', 'none']:
0a122b
-            result = self.vm.qmp('drive-mirror', device='drive0',
0a122b
-                                 sync=sync_mode, target=target_img,
0a122b
-                                 mode='absolute-paths')
0a122b
-            self.assert_qmp(result, 'return', {})
0a122b
-            self.complete_and_wait()
0a122b
-            self.assert_no_active_block_jobs()
0a122b
+    def test_absolute_paths_none(self):
0a122b
+        self.assert_no_active_block_jobs()
0a122b
+        result = self.vm.qmp('drive-mirror', device='drive0',
0a122b
+                             sync='none', target=target_img,
0a122b
+                             mode='absolute-paths')
0a122b
+        self.assert_qmp(result, 'return', {})
0a122b
+        self.complete_and_wait()
0a122b
+        self.assert_no_active_block_jobs()
0a122b
 
0a122b
 if __name__ == '__main__':
0a122b
     iotests.main(supported_fmts=['qcow2', 'qed'])
0a122b
diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out
0a122b
index 4fd1c2d..6d9bee1 100644
0a122b
--- a/tests/qemu-iotests/041.out
0a122b
+++ b/tests/qemu-iotests/041.out
0a122b
@@ -1,5 +1,5 @@
0a122b
-.........................
0a122b
+...........................
0a122b
 ----------------------------------------------------------------------
0a122b
-Ran 25 tests
0a122b
+Ran 27 tests
0a122b
 
0a122b
 OK
0a122b
-- 
0a122b
1.7.1
0a122b