'Test cleanup_one_backup for volume status \'restoring\'.'

def test_cleanup_one_restoring_backup(self):

    vol1_id = self._create_volume_db_entry()
    db.volume_update(self.ctxt, vol1_id, {'status': 'restoring-backup'})
    backup = self._create_backup_db_entry(status=fields.BackupStatus.RESTORING, restore_volume_id=vol1_id)
    self.backup_mgr._cleanup_one_backup(self.ctxt, backup)
    self.assertEqual(fields.BackupStatus.AVAILABLE, backup.status)
    volume = objects.Volume.get_by_id(self.ctxt, vol1_id)
    self.assertEqual('error_restoring', volume.status)
