use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method successfulStopWhenAllAgentsSuccessful.
/**
* Test successful stop action, when all agents were successful
*/
@Test
public void successfulStopWhenAllAgentsSuccessful() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF);
mockSingleAgentResult(singleExecutor1, new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF));
mockSingleAgentResult(singleExecutor2, new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF));
FenceOperationResult result = executor.fence(FenceActionType.STOP);
validateResult(expectedResult, result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method successfulStartWhenOneSuccessfulAndAnotherFailed.
/**
* Test successful start action, when one agent was successful and another failed
*/
@Test
public void successfulStartWhenOneSuccessfulAndAnotherFailed() {
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.START);
validateResult(expectedResult, result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method failedStartWhenAllAgentsFailed.
/**
* Test failed start action, when all agents failed
*/
@Test
public void failedStartWhenAllAgentsFailed() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN);
mockSingleAgentResult(singleExecutor1, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
mockSingleAgentResult(singleExecutor2, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
FenceOperationResult result = executor.fence(FenceActionType.START);
validateResult(expectedResult, result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class FenceAgentExecutorTest method successfulFence.
/**
* Test that the return value is correct when fencing succeeds.
*/
@Test
public void successfulFence() {
FenceOperationResult fenceVdsResult = new FenceOperationResult(Status.SUCCESS);
mockFenceVdsResult(fenceVdsResult, null);
mockProxyHost();
FenceOperationResult result = executor.fence(FenceActionType.START, createAgent());
assertEquals(Status.SUCCESS, result.getStatus());
verifyAuditFenceExecutionStart(1);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class HostFenceActionExecutorTest method successfulFenceWith1stSuccess.
/**
* Test successful fence action when the 1st of 2 sequential fence agents returns success
*/
@Test
public void successfulFenceWith1stSuccess() {
mockFenceAgents();
// result of fence action invoked on 1st sequential agent
mockFenceResult(agentExecutor1, new FenceOperationResult(Status.SUCCESS, PowerStatus.ON));
// result of fence action invoked on 2nd sequential agent - set it to error, so we verify that it's not used
mockFenceResult(agentExecutor2, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
FenceOperationResult result = executor.fence(FenceActionType.STATUS);
assertEquals(Status.SUCCESS, result.getStatus());
assertEquals(PowerStatus.ON, result.getPowerStatus());
}
Aggregations