[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/48] iotests: 124: move incremental failure test
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 02/48] iotests: 124: move incremental failure test |
Date: |
Fri, 18 Dec 2015 16:07:08 +0100 |
From: John Snow <address@hidden>
Code motion only, in preparation for adjusting
the setUp procedure for this test.
Signed-off-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/124 | 117 +++++++++++++++++++++++++------------------------
1 file changed, 60 insertions(+), 57 deletions(-)
diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124
index 778bfdd..2a0119d 100644
--- a/tests/qemu-iotests/124
+++ b/tests/qemu-iotests/124
@@ -344,63 +344,6 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
self.check_backups()
- def test_incremental_failure(self):
- '''Test: Verify backups made after a failure are correct.
-
- Simulate a failure during an incremental backup block job,
- emulate additional writes, then create another incremental backup
- afterwards and verify that the backup created is correct.
- '''
-
- # Create a blkdebug interface to this img as 'drive1',
- # but don't actually create a new image.
- drive1 = self.add_node('drive1', self.drives[0]['fmt'],
- path=self.drives[0]['file'],
- backup=self.drives[0]['backup'])
- result = self.vm.qmp('blockdev-add', options={
- 'id': drive1['id'],
- 'driver': drive1['fmt'],
- 'file': {
- 'driver': 'blkdebug',
- 'image': {
- 'driver': 'file',
- 'filename': drive1['file']
- },
- 'set-state': [{
- 'event': 'flush_to_disk',
- 'state': 1,
- 'new_state': 2
- }],
- 'inject-error': [{
- 'event': 'read_aio',
- 'errno': 5,
- 'state': 2,
- 'immediately': False,
- 'once': True
- }],
- }
- })
- self.assert_qmp(result, 'return', {})
-
- self.create_anchor_backup(self.drives[0])
- self.add_bitmap('bitmap0', drive1)
- # Note: at this point, during a normal execution,
- # Assume that the VM resumes and begins issuing IO requests here.
-
- self.hmp_io_writes(drive1['id'], (('0xab', 0, 512),
- ('0xfe', '16M', '256k'),
- ('0x64', '32736k', '64k')))
-
- result = self.create_incremental(validate=False)
- self.assertFalse(result)
- self.hmp_io_writes(drive1['id'], (('0x9a', 0, 512),
- ('0x55', '8M', '352k'),
- ('0x78', '15872k', '1M')))
- self.create_incremental()
- self.vm.shutdown()
- self.check_backups()
-
-
def test_transaction_failure(self):
'''Test: Verify backups made from a transaction that partially fails.
@@ -548,5 +491,65 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
granularity=64000)
+class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
+ '''Incremental backup tests that utilize a BlkDebug filter on drive0.'''
+
+ def test_incremental_failure(self):
+ '''Test: Verify backups made after a failure are correct.
+
+ Simulate a failure during an incremental backup block job,
+ emulate additional writes, then create another incremental backup
+ afterwards and verify that the backup created is correct.
+ '''
+
+ # Create a blkdebug interface to this img as 'drive1',
+ # but don't actually create a new image.
+ drive1 = self.add_node('drive1', self.drives[0]['fmt'],
+ path=self.drives[0]['file'],
+ backup=self.drives[0]['backup'])
+ result = self.vm.qmp('blockdev-add', options={
+ 'id': drive1['id'],
+ 'driver': drive1['fmt'],
+ 'file': {
+ 'driver': 'blkdebug',
+ 'image': {
+ 'driver': 'file',
+ 'filename': drive1['file']
+ },
+ 'set-state': [{
+ 'event': 'flush_to_disk',
+ 'state': 1,
+ 'new_state': 2
+ }],
+ 'inject-error': [{
+ 'event': 'read_aio',
+ 'errno': 5,
+ 'state': 2,
+ 'immediately': False,
+ 'once': True
+ }],
+ }
+ })
+ self.assert_qmp(result, 'return', {})
+
+ self.create_anchor_backup(self.drives[0])
+ self.add_bitmap('bitmap0', drive1)
+ # Note: at this point, during a normal execution,
+ # Assume that the VM resumes and begins issuing IO requests here.
+
+ self.hmp_io_writes(drive1['id'], (('0xab', 0, 512),
+ ('0xfe', '16M', '256k'),
+ ('0x64', '32736k', '64k')))
+
+ result = self.create_incremental(validate=False)
+ self.assertFalse(result)
+ self.hmp_io_writes(drive1['id'], (('0x9a', 0, 512),
+ ('0x55', '8M', '352k'),
+ ('0x78', '15872k', '1M')))
+ self.create_incremental()
+ self.vm.shutdown()
+ self.check_backups()
+
+
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2'])
--
1.8.3.1
- [Qemu-devel] [PULL 39/48] block: use drained section around bdrv_snapshot_delete, (continued)
- [Qemu-devel] [PULL 39/48] block: use drained section around bdrv_snapshot_delete, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 38/48] iotests: Update comments for bdrv_swap() in 094, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 40/48] block: fix bdrv_ioctl called from coroutine, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 31/48] qcow2: Add function for refcount order amendment, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 29/48] qcow2: Split upgrade/downgrade paths for amend, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 30/48] qcow2: Use intermediate helper CB for amend, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 41/48] qemu-iotests: refine common.config, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 23/48] qemu-iotests: Test cache mode option inheritance, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 32/48] qcow2: Invoke refcount order amendment function, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 42/48] qemu-iotests: s390x: fix test 051, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 02/48] iotests: 124: move incremental failure test,
Kevin Wolf <=
- [Qemu-devel] [PULL 01/48] iotests: 124: Split into two test classes, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 47/48] qemu-img: abort when full_backing_filename not present, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 28/48] qcow2: Use abort() instead of assert(false), Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 21/48] blkdebug: Enable reopen, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 05/48] block: Fix reopen with semantically overlapping options, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 43/48] qemu-iotests: s390x: fix test 068, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 06/48] mirror: Error out when a BDS would get two BBs, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 34/48] iotests: Extend test 112 for qemu-img amend, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 07/48] block: Allow references for backing files, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 27/48] qcow2: Use error_report() in qcow2_amend_options(), Kevin Wolf, 2015/12/18