use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class HostFenceActionExecutorTest method hostIsNotPoweredOffWhenFenceStatusReturnsOn.
/**
* Test that host is not powered off when status action returns power on
*/
@Test
public void hostIsNotPoweredOffWhenFenceStatusReturnsOn() {
mockFenceAgent();
// result of fence action invoked on specified agent
mockFenceResult(agentExecutor1, new FenceOperationResult(Status.SUCCESS, PowerStatus.ON));
assertFalse(executor.isHostPoweredOff());
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class HostFenceActionExecutorTest method hostIsNotPoweredOffWhenFenceStatusFailed.
/**
* Test that host is not powered off when status action returns error
*/
@Test
public void hostIsNotPoweredOffWhenFenceStatusFailed() {
mockFenceAgent();
// result of fence action invoked on specified agent
mockFenceResult(agentExecutor1, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
assertFalse(executor.isHostPoweredOff());
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class SingleAgentFenceActionExecutorTest method failedGetStatus.
/**
* Test failed status action
*/
@Test
public void failedGetStatus() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN);
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 SingleAgentFenceActionExecutorTest method failedStopWithStopRetry.
/**
* Test failed stop action, when the 1st start attempt failed and retrying fence for stop is not allowed
*/
@Test
public void failedStopWithStopRetry() {
FenceOperationResult expectedResult = new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN);
FenceOperationResult[] expectedResults = { // result of the 1st stop action
new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN) };
mockFenceActionResults(expectedResults);
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 SingleAgentFenceActionExecutorTest method successfulStart.
/**
* Test successful start action
*/
@Test
public void successfulStart() {
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
expectedResult };
mockFenceActionResults(expectedResults);
FenceOperationResult result = executor.fence(FenceActionType.START);
validateResult(expectedResult, result);
}
Aggregations