[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 11/19] iotests: add test-case to 165 to test reopening qcow2 bi
From: |
John Snow |
Subject: |
[PULL v3 11/19] iotests: add test-case to 165 to test reopening qcow2 bitmaps to RW |
Date: |
Thu, 17 Oct 2019 17:54:28 -0400 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Reopening bitmaps to RW was broken prior to previous commit. Check that
it works now.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
tests/qemu-iotests/165 | 57 ++++++++++++++++++++++++++++++++++++--
tests/qemu-iotests/165.out | 4 +--
2 files changed, 57 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165
index 5650dc7c87..951ea011a2 100755
--- a/tests/qemu-iotests/165
+++ b/tests/qemu-iotests/165
@@ -43,10 +43,10 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase):
os.remove(disk)
def mkVm(self):
- return iotests.VM().add_drive(disk)
+ return iotests.VM().add_drive(disk, opts='node-name=node0')
def mkVmRo(self):
- return iotests.VM().add_drive(disk, opts='readonly=on')
+ return iotests.VM().add_drive(disk, opts='readonly=on,node-name=node0')
def getSha256(self):
result = self.vm.qmp('x-debug-block-dirty-bitmap-sha256',
@@ -102,6 +102,59 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase):
self.vm.shutdown()
+ def test_reopen_rw(self):
+ self.vm = self.mkVm()
+ self.vm.launch()
+ self.qmpAddBitmap()
+
+ # Calculate hashes
+
+ self.writeRegions(regions1)
+ sha256_1 = self.getSha256()
+
+ self.writeRegions(regions2)
+ sha256_2 = self.getSha256()
+ assert sha256_1 != sha256_2 # Otherwise, it's not very interesting.
+
+ result = self.vm.qmp('block-dirty-bitmap-clear', node='drive0',
+ name='bitmap0')
+ self.assert_qmp(result, 'return', {})
+
+ # Start with regions1
+
+ self.writeRegions(regions1)
+ assert sha256_1 == self.getSha256()
+
+ self.vm.shutdown()
+
+ self.vm = self.mkVmRo()
+ self.vm.launch()
+
+ assert sha256_1 == self.getSha256()
+
+ # Check that we are in RO mode and can't modify bitmap.
+ self.writeRegions(regions2)
+ assert sha256_1 == self.getSha256()
+
+ # Reopen to RW
+ result = self.vm.qmp('x-blockdev-reopen', **{
+ 'node-name': 'node0',
+ 'driver': iotests.imgfmt,
+ 'file': {
+ 'driver': 'file',
+ 'filename': disk
+ },
+ 'read-only': False
+ })
+ self.assert_qmp(result, 'return', {})
+
+ # Check that bitmap is reopened to RW and we can write to it.
+ self.writeRegions(regions2)
+ assert sha256_2 == self.getSha256()
+
+ self.vm.shutdown()
+
+
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2'],
supported_protocols=['file'])
diff --git a/tests/qemu-iotests/165.out b/tests/qemu-iotests/165.out
index ae1213e6f8..fbc63e62f8 100644
--- a/tests/qemu-iotests/165.out
+++ b/tests/qemu-iotests/165.out
@@ -1,5 +1,5 @@
-.
+..
----------------------------------------------------------------------
-Ran 1 tests
+Ran 2 tests
OK
--
2.21.0
- [PULL v3 02/19] block: move bdrv_can_store_new_dirty_bitmap to block/dirty-bitmap.c, (continued)
- [PULL v3 02/19] block: move bdrv_can_store_new_dirty_bitmap to block/dirty-bitmap.c, John Snow, 2019/10/17
- [PULL v3 03/19] block/dirty-bitmap: return int from bdrv_remove_persistent_dirty_bitmap, John Snow, 2019/10/17
- [PULL v3 04/19] block/qcow2: proper locking on bitmap add/remove paths, John Snow, 2019/10/17
- [PULL v3 05/19] block/dirty-bitmap: drop meta, John Snow, 2019/10/17
- [PULL v3 07/19] block/dirty-bitmap: drop BdrvDirtyBitmap.mutex, John Snow, 2019/10/17
- [PULL v3 06/19] block/dirty-bitmap: add bs link, John Snow, 2019/10/17
- [PULL v3 08/19] block/dirty-bitmap: refactor bdrv_dirty_bitmap_next, John Snow, 2019/10/17
- [PULL v3 10/19] block: reverse order for reopen commits, John Snow, 2019/10/17
- [PULL v3 09/19] block: switch reopen queue from QSIMPLEQ to QTAILQ, John Snow, 2019/10/17
- [PULL v3 12/19] block/qcow2-bitmap: get rid of bdrv_has_changed_persistent_bitmaps, John Snow, 2019/10/17
- [PULL v3 11/19] iotests: add test-case to 165 to test reopening qcow2 bitmaps to RW,
John Snow <=
- [PULL v3 13/19] block/qcow2-bitmap: drop qcow2_reopen_bitmaps_rw_hint(), John Snow, 2019/10/17
- [PULL v3 15/19] iotests: add test 260 to check bitmap life after snapshot + commit, John Snow, 2019/10/17
- [PULL v3 14/19] block/qcow2-bitmap: do not remove bitmaps on reopen-ro, John Snow, 2019/10/17
- [PULL v3 16/19] block/qcow2-bitmap: fix and improve qcow2_reopen_bitmaps_rw, John Snow, 2019/10/17
- [PULL v3 17/19] qcow2-bitmap: move bitmap reopen-rw code to qcow2_reopen_commit, John Snow, 2019/10/17
- [PULL v3 18/19] MAINTAINERS: Add Vladimir as a reviewer for bitmaps, John Snow, 2019/10/17
- [PULL v3 19/19] dirty-bitmaps: remove deprecated autoload parameter, John Snow, 2019/10/17
- Re: [PULL v3 00/19] Bitmaps patches, Peter Maydell, 2019/10/18