qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v8 14/14] iotests: add persistent bitmap migration t


From: Vladimir Sementsov-Ogievskiy
Subject: [Qemu-devel] [PATCH v8 14/14] iotests: add persistent bitmap migration test
Date: Mon, 30 Oct 2017 19:33:09 +0300

Test that persistent bitmap migrates and its persistance property
migrates too.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
 tests/qemu-iotests/169     | 21 ++++++++++++++++++---
 tests/qemu-iotests/169.out |  4 ++--
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index 4ecef2f23f..b0270f40f7 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -46,7 +46,7 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
         self.vm_a.launch()
         self.vm_b.launch()
 
-    def test_migration(self):
+    def do_test_migration(self, persistent=False):
         self.init(0x400000000) # 1G
         granularity = 512
         regions = [
@@ -55,8 +55,13 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
             { 'start': 0x399900000, 'count': 0x100000  }
             ]
 
-        result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
-                               name='bitmap', granularity=granularity)
+        if persistent:
+            result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
+                                   name='bitmap', granularity=granularity,
+                                   persistent=True, autoload=True)
+        else:
+            result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
+                                   name='bitmap', granularity=granularity)
         self.assert_qmp(result, 'return', {});
 
         for r in regions:
@@ -77,10 +82,20 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
         self.assertNotEqual(self.vm_b.event_wait("RESUME"), None)
         time.sleep(2)
 
+        if persistent:
+            self.vm_b.shutdown()
+            self.vm_b.launch()
+
         result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
         self.assert_qmp(result, 'return/sha256', sha256);
 
+    def test_migration(self):
+        self.do_test_migration()
+
+    def test_migration_persistent(self):
+        self.do_test_migration(persistent=True)
+
     def test_postcopy(self):
         self.init(0x4000000000) # 256G
         write_size = 0x40000000
diff --git a/tests/qemu-iotests/169.out b/tests/qemu-iotests/169.out
index fbc63e62f8..8d7e996700 100644
--- a/tests/qemu-iotests/169.out
+++ b/tests/qemu-iotests/169.out
@@ -1,5 +1,5 @@
-..
+...
 ----------------------------------------------------------------------
-Ran 2 tests
+Ran 3 tests
 
 OK
-- 
2.11.1




reply via email to

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