Extending testing scope of Incremental Backup

This patch adds the test to restore from an incremental backup.

Change-Id: I10272d737bbe3b196dfaf6ce242c8ccdf0787f5c
This commit is contained in:
Sofia Enriquez 2019-04-16 01:35:38 -03:00 committed by Luigi Toscano
parent f44ff14f1a
commit efef4f5fec
1 changed files with 23 additions and 0 deletions

View File

@ -67,6 +67,29 @@ class VolumesBackupsTest(base.BaseVolumeTest):
self.assertEqual(src_vol['id'], restore['volume_id'])
self.assertEqual(backup['id'], restore['backup_id'])
@decorators.idempotent_id('b5d837b0-7066-455d-88fc-4a721a899306')
def test_incr_backup_create_and_restore_to_an_existing_volume(self):
"""Test incr backup create and restore to an existing volume."""
# Create volume
src_vol = self.create_volume()
# Create a full backup
self.create_backup(volume_id=src_vol['id'])
# Create an inc backup
backup = self.create_backup(volume_id=src_vol['id'],
incremental=True)
# Restore to existing volume
restore = self.backups_client.restore_backup(
backup_id=backup['id'],
volume_id=src_vol['id'])['restore']
waiters.wait_for_volume_resource_status(
self.backups_client,
backup['id'], 'available')
waiters.wait_for_volume_resource_status(
self.volumes_client,
src_vol['id'], 'available')
self.assertEqual(src_vol['id'], restore['volume_id'])
self.assertEqual(backup['id'], restore['backup_id'])
@decorators.idempotent_id('c810fe2c-cb40-43ab-96aa-471b74516a98')
def test_incremental_backup(self):
"""Test create incremental backup."""