use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class SingleAgentFenceActionExecutorTest method successfulStartUnknownStatusLimitExceededOn1stAttempt.
/**
* Test start action with UNKNOWN power status limit exceeded on 1st attempt, but 2nd attempt is successful
*/
@Test
public void successfulStartUnknownStatusLimitExceededOn1stAttempt() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.SUCCESS, PowerStatus.ON);
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.ON) };
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 successfulGetStatus.
/**
* Test successful status action
*/
@Test
public void successfulGetStatus() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.SUCCESS, PowerStatus.ON);
FenceOperationResult[] expectedResults = { expectedResult };
mockFenceActionResults(expectedResults);
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 BackendHostResource method getFenceStatus.
private Response getFenceStatus(Action action) {
FenceOperationResult result = getEntity(FenceOperationResult.class, QueryType.GetVdsFenceStatus, new IdQueryParameters(guid), guid.toString());
if (result.getStatus() == Status.SUCCESS) {
PowerManagement pm = new PowerManagement();
pm.setStatus(convertPowerStatus(result.getPowerStatus()));
action.setPowerManagement(pm);
return actionSuccess(action);
} else {
return handleFailure(action, result.getMessage());
}
}
Aggregations