def test_retry_on_limit_exceeded(self, failures):
        serv = FakeServer(initial_failures=failures,
                          exc=exception.MigrationLimitExceeded())
        dom, src = make_env()
        src._destServer = serv
        cfg = make_config([('vars', 'migration_retry_timeout', '0')])
        with MonkeyPatchScope([(migration, 'config', cfg)]):
            src.run()

        assert serv.attempts == failures + 1  # +1 for success
        assert dom.migrations == 1
Beispiel #2
0
    'updateVmPolicyErr': exception.UpdateVMPolicyFailed().response(),
    'updateIoTuneErr': exception.UpdateIOTuneError().response(),
    'V2VConnection': exception.V2VConnectionError().response(),
    'NoSuchJob': exception.NoSuchJob().response(),
    'V2VNoSuchOvf': exception.V2VNoSuchOVF().response(),
    'JobNotDone': exception.JobNotDone().response(),
    'JobExists': exception.JobExists().response(),
    'JobNotActive': exception.JobNotActive().response(),
    'hotplugMem': exception.HotplugMemFailed().response(),
    'ksmErr': exception.KSMUpdateFailed().response(),
    'secretBadRequestErr': exception.BadSecretRequest().response(),
    'secretRegisterErr': exception.SecretRegistrationFailed().response(),
    'secretUnregisterErr': exception.SecretUnregistrationFailed().response(),
    'unsupportedOperationErr': exception.UnsupportedOperation().response(),
    'freezeErr': exception.FreezeGuestFSFailed().response(),
    'thawErr': exception.ThawGuestFSFailed().response(),
    'hookError': exception.HookFailed().response(),
    'destVolumeTooSmall': exception.DestinationVolumeTooSmall().response(),
    'AbortNotSupported': exception.AbortNotSupported().response(),
    'migNotInProgress': exception.MigrationNotInProgress().response(),
    'migrateLimit': exception.MigrationLimitExceeded().response(),
    'recovery': exception.RecoveryInProgress().response(),
    'hostdevDetachErr': exception.HostdevDetachFailed().response(),
}

doneCode = {'code': 0, 'message': 'Done'}

# exitCodes
ERROR = 1
NORMAL = 0