use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class FenceVdsVDSCommandTest method successfulGetStatus.
/**
* Tests result of successful get power status of host
*/
@Test
public void successfulGetStatus() {
String agentMessage = "Test succeeded: on";
setupCommand(setupCommandParams(FenceActionType.STATUS));
setupBrokerResult(createBrokerResultMap(0, agentMessage, "on", null));
command.execute();
FenceOperationResult result = (FenceOperationResult) command.getVDSReturnValue().getReturnValue();
assertEquals(Status.SUCCESS, result.getStatus());
assertEquals(PowerStatus.ON, result.getPowerStatus());
assertEquals(agentMessage, result.getMessage());
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class GetFenceAgentStatusQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
HostFenceActionExecutor executor = new HostFenceActionExecutor(getHost());
FenceOperationResult result = executor.getFenceAgentStatus(getParameters().getAgent());
getQueryReturnValue().setSucceeded(result.getStatus() == Status.SUCCESS);
getQueryReturnValue().setReturnValue(result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method failedStatusWhenOneReportsOffAndOtherFailed.
/**
* Test failed status action, when one agent reports power off and other reports error
*/
@Test
public void failedStatusWhenOneReportsOffAndOtherFailed() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN);
mockSingleAgentResult(singleExecutor1, new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF));
mockSingleAgentResult(singleExecutor2, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
FenceOperationResult result = executor.fence(FenceActionType.STATUS);
validateResult(expectedResult, result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method statusOnWhenAllReportsOn.
/**
* Test status action with power on result, when both agents reports power on
*/
@Test
public void statusOnWhenAllReportsOn() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.SUCCESS, PowerStatus.ON);
mockSingleAgentResult(singleExecutor1, new FenceOperationResult(Status.SUCCESS, PowerStatus.ON));
mockSingleAgentResult(singleExecutor2, new FenceOperationResult(Status.SUCCESS, PowerStatus.ON));
FenceOperationResult result = executor.fence(FenceActionType.STATUS);
validateResult(expectedResult, result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method statusOnWhenOneReportsOnAndOtherFailed.
/**
* Test status action with power on result, when one agent reports power on and other reports error
*/
@Test
public void statusOnWhenOneReportsOnAndOtherFailed() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.SUCCESS, PowerStatus.ON);
mockSingleAgentResult(singleExecutor1, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
mockSingleAgentResult(singleExecutor2, new FenceOperationResult(Status.SUCCESS, PowerStatus.ON));
FenceOperationResult result = executor.fence(FenceActionType.STATUS);
validateResult(expectedResult, result);
}
Aggregations