use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method successfulStartWhenAllAgentsSuccessful.
/**
* Test successful start action, when all agents were successful
*/
@Test
public void successfulStartWhenAllAgentsSuccessful() {
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.START);
validateResult(expectedResult, result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class ConcurrentAgentsFenceActionExecutorTest method statusOffWhenAllReportsOff.
/**
* Test status action with power off result, when all agents reports power off
*/
@Test
public void statusOffWhenAllReportsOff() {
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.STATUS);
validateResult(expectedResult, result);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class FenceAgentExecutorTest method successfulFenceWithDifferentProxyRetry.
/**
* Test that fence attempt is retried with a different proxy host when first fence attempt fails
*/
@Test
public void successfulFenceWithDifferentProxyRetry() {
FenceOperationResult fenceVdsResult1 = new FenceOperationResult(Status.ERROR);
FenceOperationResult fenceVdsResult2 = new FenceOperationResult(Status.SUCCESS);
mockFenceVdsResult(fenceVdsResult1, fenceVdsResult2);
mockProxyHost(true);
FenceOperationResult result = executor.fence(FenceActionType.START, createAgent());
assertEquals(Status.SUCCESS, result.getStatus());
verifyAuditFenceExecutionStart(2);
verifyAuditFenceExecutionFailure(1);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class FenceAgentExecutorTest method failedFenceWithDifferentProxyRetry.
/**
* Test that the whole fence execution fails when the first fence attempt fails and the second attempt using
* a different proxy host also fails
*/
@Test
public void failedFenceWithDifferentProxyRetry() {
FenceOperationResult fenceVdsResult1 = new FenceOperationResult(Status.ERROR);
FenceOperationResult fenceVdsResult2 = new FenceOperationResult(Status.ERROR);
mockFenceVdsResult(fenceVdsResult1, fenceVdsResult2);
mockProxyHost(true);
FenceOperationResult result = executor.fence(FenceActionType.START, createAgent());
assertEquals(Status.ERROR, result.getStatus());
verifyAttemptToFindDifferentProxy();
verifyAuditFenceExecutionFailure(2);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class FenceAgentExecutorTest method failedFenceWithSameProxyRetry.
/**
* Test that the whole fence execution fails when the first fence attempt fails and the second attempt using
* the same proxy host also fails
*/
@Test
public void failedFenceWithSameProxyRetry() {
FenceOperationResult fenceVdsResult1 = new FenceOperationResult(Status.ERROR);
FenceOperationResult fenceVdsResult2 = new FenceOperationResult(Status.ERROR);
mockFenceVdsResult(fenceVdsResult1, fenceVdsResult2);
mockProxyHost(false);
FenceOperationResult result = executor.fence(FenceActionType.START, createAgent());
assertEquals(Status.ERROR, result.getStatus());
verifyAttemptToFindDifferentProxy();
verifyAuditFenceExecutionFailure(2);
}
Aggregations