use of org.ovirt.engine.core.common.errors.VDSError in project ovirt-engine by oVirt.
the class AddGlusterHookCommandTest method mockBackend.
private void mockBackend(boolean succeeded, EngineError errorCode) {
VDSReturnValue vdsReturnValue = new VDSReturnValue();
vdsReturnValue.setSucceeded(succeeded);
if (!succeeded) {
vdsReturnValue.setVdsError(new VDSError(errorCode, ""));
}
when(vdsBrokerFrontend.runVdsCommand(eq(VDSCommandType.AddGlusterHook), any())).thenReturn(vdsReturnValue);
}
use of org.ovirt.engine.core.common.errors.VDSError in project ovirt-engine by oVirt.
the class CommitRemoveGlusterVolumeBricksCommandTest method mockBackend.
@SuppressWarnings("unchecked")
private void mockBackend(boolean succeeded, EngineError errorCode) {
doNothing().when(cmd).endStepJobCommitted();
doNothing().when(cmd).releaseVolumeLock();
VDSReturnValue vdsReturnValue = new VDSReturnValue();
vdsReturnValue.setSucceeded(succeeded);
if (!succeeded) {
vdsReturnValue.setVdsError(new VDSError(errorCode, ""));
}
when(vdsBrokerFrontend.runVdsCommand(eq(VDSCommandType.CommitRemoveGlusterVolumeBricks), any())).thenReturn(vdsReturnValue);
}
use of org.ovirt.engine.core.common.errors.VDSError in project ovirt-engine by oVirt.
the class GlusterServiceSyncJobTest method createVDSReturnValueForFailure.
private VDSReturnValue createVDSReturnValueForFailure() {
VDSReturnValue ret = new VDSReturnValue();
ret.setSucceeded(false);
ret.setVdsError(new VDSError(EngineError.GlusterServicesActionFailed, "VDSM Error"));
return ret;
}
use of org.ovirt.engine.core.common.errors.VDSError in project ovirt-engine by oVirt.
the class ManageGlusterServiceCommandTest method mockBackend.
private void mockBackend(boolean succeeded, EngineError errorCode, GlusterServiceStatus status) {
VDSReturnValue vdsReturnValue = new VDSReturnValue();
vdsReturnValue.setSucceeded(succeeded);
if (!succeeded) {
vdsReturnValue.setVdsError(new VDSError(errorCode, ""));
} else {
if (status == GlusterServiceStatus.STOPPED) {
vdsReturnValue.setReturnValue(getGlusterServerServicesByServerIdAndServiceType(Guid.newGuid(), ServiceType.GLUSTER_SWIFT, status));
} else {
// Adding one additional service for the case of stop so that save mechanism can be tested out
Guid serverId = Guid.newGuid();
List<GlusterServerService> serverServiceList = getGlusterServerServicesByServerIdAndServiceType(serverId, ServiceType.GLUSTER_SWIFT, status);
GlusterServerService srvc3 = new GlusterServerService();
srvc3.setMessage("test-msg3");
srvc3.setPid(10000);
srvc3.setPort(20000);
srvc3.setServerId(serverId);
srvc3.setServiceId(Guid.newGuid());
srvc3.setServiceName("srvc3");
srvc3.setServiceType(ServiceType.GLUSTER_SWIFT);
srvc3.setStatus(status);
serverServiceList.add(srvc3);
vdsReturnValue.setReturnValue(serverServiceList);
}
}
when(vdsBrokerFrontend.runVdsCommand(eq(VDSCommandType.ManageGlusterService), any())).thenReturn(vdsReturnValue);
}
use of org.ovirt.engine.core.common.errors.VDSError in project ovirt-engine by oVirt.
the class StopRemoveGlusterVolumeBricksCommandTest method mockBackend.
private void mockBackend(boolean succeeded, EngineError errorCode) {
doNothing().when(cmd).endStepJobAborted(any());
doNothing().when(cmd).releaseVolumeLock();
VDSReturnValue vdsReturnValue = new VDSReturnValue();
vdsReturnValue.setSucceeded(succeeded);
if (!succeeded) {
vdsReturnValue.setVdsError(new VDSError(errorCode, ""));
} else {
vdsReturnValue.setReturnValue(new GlusterVolumeTaskStatusEntity());
}
when(vdsBrokerFrontend.runVdsCommand(eq(VDSCommandType.StopRemoveGlusterVolumeBricks), any())).thenReturn(vdsReturnValue);
}
Aggregations