'Test error handling.
Test error handling when attempting a delete of a backup
with a different service to that used to create the backup.'

def test_delete_backup_with_bad_service(self):

    vol_id = self._create_volume_db_entry(size=1)
    service = 'cinder.tests.backup.bad_service'
    backup = self._create_backup_db_entry(status=fields.BackupStatus.DELETING, volume_id=vol_id, service=service)
    self.assertRaises(exception.InvalidBackup, self.backup_mgr.delete_backup, self.ctxt, backup)
    backup = db.backup_get(self.ctxt, backup.id)
    self.assertEqual(fields.BackupStatus.ERROR, backup['status'])
