iotests: 124: don't reopen qcow2

Don't create two interfaces to the same drive in the recently moved
failure test.

Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
master
John Snow 2015-12-01 18:16:39 -05:00 committed by Kevin Wolf
parent ce2cbc4910
commit 35cea22373
1 changed files with 14 additions and 12 deletions

View File

@ -494,6 +494,12 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase): class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
'''Incremental backup tests that utilize a BlkDebug filter on drive0.''' '''Incremental backup tests that utilize a BlkDebug filter on drive0.'''
def setUp(self):
drive0 = self.add_node('drive0')
self.img_create(drive0['file'], drive0['fmt'])
self.write_default_pattern(drive0['file'])
self.vm.launch()
def test_incremental_failure(self): def test_incremental_failure(self):
'''Test: Verify backups made after a failure are correct. '''Test: Verify backups made after a failure are correct.
@ -502,19 +508,15 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
afterwards and verify that the backup created is correct. afterwards and verify that the backup created is correct.
''' '''
# Create a blkdebug interface to this img as 'drive1', drive0 = self.drives[0]
# 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={ result = self.vm.qmp('blockdev-add', options={
'id': drive1['id'], 'id': drive0['id'],
'driver': drive1['fmt'], 'driver': drive0['fmt'],
'file': { 'file': {
'driver': 'blkdebug', 'driver': 'blkdebug',
'image': { 'image': {
'driver': 'file', 'driver': 'file',
'filename': drive1['file'] 'filename': drive0['file']
}, },
'set-state': [{ 'set-state': [{
'event': 'flush_to_disk', 'event': 'flush_to_disk',
@ -532,18 +534,18 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
}) })
self.assert_qmp(result, 'return', {}) self.assert_qmp(result, 'return', {})
self.create_anchor_backup(self.drives[0]) self.create_anchor_backup(drive0)
self.add_bitmap('bitmap0', drive1) self.add_bitmap('bitmap0', drive0)
# Note: at this point, during a normal execution, # Note: at this point, during a normal execution,
# Assume that the VM resumes and begins issuing IO requests here. # Assume that the VM resumes and begins issuing IO requests here.
self.hmp_io_writes(drive1['id'], (('0xab', 0, 512), self.hmp_io_writes(drive0['id'], (('0xab', 0, 512),
('0xfe', '16M', '256k'), ('0xfe', '16M', '256k'),
('0x64', '32736k', '64k'))) ('0x64', '32736k', '64k')))
result = self.create_incremental(validate=False) result = self.create_incremental(validate=False)
self.assertFalse(result) self.assertFalse(result)
self.hmp_io_writes(drive1['id'], (('0x9a', 0, 512), self.hmp_io_writes(drive0['id'], (('0x9a', 0, 512),
('0x55', '8M', '352k'), ('0x55', '8M', '352k'),
('0x78', '15872k', '1M'))) ('0x78', '15872k', '1M')))
self.create_incremental() self.create_incremental()