[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 69/76] iotests: add incremental backup granularity te
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 69/76] iotests: add incremental backup granularity tests |
Date: |
Tue, 28 Apr 2015 17:00:51 +0200 |
From: John Snow <address@hidden>
Test what happens if you fiddle with the granularity.
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/124 | 58 +++++++++++++++++++++++++++++++++++++---------
tests/qemu-iotests/124.out | 4 ++--
2 files changed, 49 insertions(+), 13 deletions(-)
diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124
index 95f6de5..3ee78cd 100644
--- a/tests/qemu-iotests/124
+++ b/tests/qemu-iotests/124
@@ -158,11 +158,11 @@ class TestIncrementalBackup(iotests.QMPTestCase):
self.assertTrue(res)
- def add_bitmap(self, name, drive):
+ def add_bitmap(self, name, drive, **kwargs):
bitmap = Bitmap(name, drive)
self.bitmaps.append(bitmap)
result = self.vm.qmp('block-dirty-bitmap-add', node=drive['id'],
- name=bitmap.name)
+ name=bitmap.name, **kwargs)
self.assert_qmp(result, 'return', {})
return bitmap
@@ -212,16 +212,9 @@ class TestIncrementalBackup(iotests.QMPTestCase):
self.vm.hmp_qemu_io(drive, 'flush')
- def test_incremental_simple(self):
- '''
- Test: Create and verify three incremental backups.
-
- Create a bitmap and a full backup before VM execution begins,
- then create a series of three incremental backups "during execution,"
- i.e.; after IO requests begin modifying the drive.
- '''
+ def do_incremental_simple(self, **kwargs):
self.create_anchor_backup()
- self.add_bitmap('bitmap0', self.drives[0])
+ self.add_bitmap('bitmap0', self.drives[0], **kwargs)
# Sanity: Create a "hollow" incremental backup
self.create_incremental()
@@ -240,6 +233,37 @@ class TestIncrementalBackup(iotests.QMPTestCase):
self.check_backups()
+ def test_incremental_simple(self):
+ '''
+ Test: Create and verify three incremental backups.
+
+ Create a bitmap and a full backup before VM execution begins,
+ then create a series of three incremental backups "during execution,"
+ i.e.; after IO requests begin modifying the drive.
+ '''
+ return self.do_incremental_simple()
+
+
+ def test_small_granularity(self):
+ '''
+ Test: Create and verify backups made with a small granularity bitmap.
+
+ Perform the same test as test_incremental_simple, but with a
granularity
+ of only 32KiB instead of the present default of 64KiB.
+ '''
+ return self.do_incremental_simple(granularity=32768)
+
+
+ def test_large_granularity(self):
+ '''
+ Test: Create and verify backups made with a large granularity bitmap.
+
+ Perform the same test as test_incremental_simple, but with a
granularity
+ of 128KiB instead of the present default of 64KiB.
+ '''
+ return self.do_incremental_simple(granularity=131072)
+
+
def test_incremental_failure(self):
'''Test: Verify backups made after a failure are correct.
@@ -315,6 +339,18 @@ class TestIncrementalBackup(iotests.QMPTestCase):
self.assert_qmp(result, 'error/class', 'GenericError')
+ def test_sync_dirty_bitmap_bad_granularity(self):
+ '''
+ Test: Test what happens if we provide an improper granularity.
+
+ The granularity must always be a power of 2.
+ '''
+ self.assert_no_active_block_jobs()
+ self.assertRaises(AssertionError, self.add_bitmap,
+ 'bitmap0', self.drives[0],
+ granularity=64000)
+
+
def tearDown(self):
self.vm.shutdown()
for bitmap in self.bitmaps:
diff --git a/tests/qemu-iotests/124.out b/tests/qemu-iotests/124.out
index 89968f3..2f7d390 100644
--- a/tests/qemu-iotests/124.out
+++ b/tests/qemu-iotests/124.out
@@ -1,5 +1,5 @@
-....
+.......
----------------------------------------------------------------------
-Ran 4 tests
+Ran 7 tests
OK
--
1.8.3.1
- [Qemu-devel] [PULL 58/76] qmp: Add support of "dirty-bitmap" sync mode for drive-backup, (continued)
- [Qemu-devel] [PULL 58/76] qmp: Add support of "dirty-bitmap" sync mode for drive-backup, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 57/76] block: Add bitmap successors, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 59/76] qmp: add block-dirty-bitmap-clear, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 60/76] qmp: Add dirty bitmap status field in query-block, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 61/76] block: add BdrvDirtyBitmap documentation, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 62/76] block: Ensure consistent bitmap function prototypes, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 63/76] block: Resize bitmaps on bdrv_truncate, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 64/76] hbitmap: truncate tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 65/76] iotests: add invalid input incremental backup tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 68/76] iotests: add incremental backup failure recovery test, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 69/76] iotests: add incremental backup granularity tests,
Kevin Wolf <=
- [Qemu-devel] [PULL 71/76] block/dmg: make it modular, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 70/76] block/mirror: Always call block_job_sleep_ns(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 73/76] block: replace bdrv_states iteration with bdrv_next(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 67/76] iotests: add simple incremental backup case, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 72/76] vmdk: Widen before shifting 32 bit header field, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 74/76] block: add bdrv_set_dirty()/bdrv_reset_dirty() to block_int.h, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 75/76] block: extract bdrv_setup_io_funcs(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 76/76] block: move I/O request processing to block/io.c, Kevin Wolf, 2015/04/28