use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class HostFenceActionExecutorTest method successfulFenceWith1stError2ndSuccess.
/**
* Test successful fence action when the 1st of 2 sequential fence agents returns error and 2nd one return success
*/
@Test
public void successfulFenceWith1stError2ndSuccess() {
mockFenceAgents();
// result of fence action invoked on 1st sequential agent
mockFenceResult(agentExecutor1, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
// result of fence action invoked on 2nd sequential agent
mockFenceResult(agentExecutor2, new FenceOperationResult(Status.SUCCESS, PowerStatus.ON));
FenceOperationResult result = executor.fence(FenceActionType.STATUS);
assertEquals(Status.SUCCESS, result.getStatus());
assertEquals(PowerStatus.ON, result.getPowerStatus());
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class SingleAgentFenceActionExecutorTest method successfulStartWithStatusRetry.
/**
* Test successful start action with 1 status retry
*/
@Test
public void successfulStartWithStatusRetry() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.SUCCESS, PowerStatus.ON);
FenceOperationResult[] expectedResults = { // result of start action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN), // result of 1st status action
new FenceOperationResult(Status.SUCCESS, PowerStatus.ON), expectedResult };
mockFenceActionResults(expectedResults);
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 SingleAgentFenceActionExecutorTest method failedStartStatusRetriesExceeded.
/**
* Test start action with status retries exceeded
*/
@Test
public void failedStartStatusRetriesExceeded() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.ERROR, PowerStatus.OFF);
FenceOperationResult[] expectedResults = { // result of 1st start action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN), // result of 1st status action
new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF), // result of 2nd status action
new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF), // result of 2nd start action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN), // result of 1st status action
new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF), // result of 2nd status action
new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF) };
mockFenceActionResults(expectedResults);
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 SingleAgentFenceActionExecutorTest method failedStartUnknownStatusLimitExceeded.
/**
* Test start action with UNKNOWN power status limit exceeded
*/
@Test
public void failedStartUnknownStatusLimitExceeded() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN);
FenceOperationResult[] expectedResults = { // result of 1st start action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN), // result of 1st status action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN), // result of 2nd start action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN), // result of 1st status action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN) };
mockFenceActionResults(expectedResults);
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 SingleAgentFenceActionExecutorTest method successfulStartWithStartRetry.
/**
* Test successful start action, when the 1st start attempt failed, but the 2nd one was successful
*/
@Test
public void successfulStartWithStartRetry() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.SUCCESS, PowerStatus.ON);
FenceOperationResult[] expectedResults = { // result of the 1st start action
new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN), // result of the 2nd start action
new FenceOperationResult(Status.SUCCESS, PowerStatus.UNKNOWN), // result of status action
expectedResult };
mockFenceActionResults(expectedResults);
FenceOperationResult result = executor.fence(FenceActionType.START);
validateResult(expectedResult, result);
}
Aggregations