'Create backup from snapshot.'

@decorators.idempotent_id('885410c6-cd1d-452c-a409-7c32b7e0be15')
def test_volume_snapshot_backup(self):

    volume = self.create_volume()
    snapshot = self.create_snapshot(volume['id'])
    backup = self.create_backup(volume_id=volume['id'], snapshot_id=snapshot['id'])
    backup = self.backups_client.show_backup(backup['id'])['backup']
    waiters.wait_for_volume_resource_status(self.backups_client, backup['id'], 'available')
    self.assertEqual(volume['id'], backup['volume_id'])
    self.assertEqual(snapshot['id'], backup['snapshot_id'])
    self.snapshots_client.delete_snapshot(snapshot['id'])
    self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
    self.volumes_client.delete_volume(volume['id'])
    self.volumes_client.wait_for_resource_deletion(volume['id'])
