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

def test_cleanup_one_creating_backup(self):

    vol1_id = self._create_volume_db_entry()
    self._create_volume_attach(vol1_id)
    db.volume_update(self.ctxt, vol1_id, {'status': 'backing-up'})
    backup = self._create_backup_db_entry(status=fields.BackupStatus.CREATING, volume_id=vol1_id)
    self.backup_mgr._cleanup_one_backup(self.ctxt, backup)
    self.assertEqual(fields.BackupStatus.ERROR, backup.status)
    volume = objects.Volume.get_by_id(self.ctxt, vol1_id)
    self.assertEqual('available', volume.status)
