use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class FenceAgentExecutorTest method successfulFenceWithSameProxyRetry.
/**
* Test that fence attempt is retried with the same proxy host when first fence attempt fails and no alternative
* proxy is found
*/
@Test
public void successfulFenceWithSameProxyRetry() {
FenceOperationResult fenceVdsResult1 = new FenceOperationResult(Status.ERROR);
FenceOperationResult fenceVdsResult2 = new FenceOperationResult(Status.SUCCESS);
mockFenceVdsResult(fenceVdsResult1, fenceVdsResult2);
mockProxyHost(false);
FenceOperationResult result = executor.fence(FenceActionType.START, createAgent());
assertEquals(Status.SUCCESS, result.getStatus());
verifyAttemptToFindDifferentProxy();
verifyAuditFenceExecutionStart(2);
verifyAuditFenceExecutionFailure(1);
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class HostFenceActionExecutorTest method successfulStatusWithSpecifiedFenceAgent.
/**
* Test successful status action using specified fence agent
*/
@Test
public void successfulStatusWithSpecifiedFenceAgent() {
// result of fence action invoked on specified agent
mockFenceResult(agentExecutor1, new FenceOperationResult(Status.SUCCESS, PowerStatus.ON));
FenceOperationResult result = executor.getFenceAgentStatus(createFenceAgent(1));
assertNotNull(result);
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 HostFenceActionExecutorTest method failedStatusWithSpecifiedFenceAgent.
/**
* Test failed status action using specified fence agent
*/
@Test
public void failedStatusWithSpecifiedFenceAgent() {
// result of fence action invoked on specified agent
mockFenceResult(agentExecutor1, new FenceOperationResult(Status.ERROR, PowerStatus.UNKNOWN));
FenceOperationResult result = executor.getFenceAgentStatus(createFenceAgent(1));
assertNotNull(result);
assertEquals(Status.ERROR, result.getStatus());
assertEquals(PowerStatus.UNKNOWN, result.getPowerStatus());
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class HostFenceActionExecutorTest method hostIsPoweredOffWhenFenceStatusReturnsOff.
/**
* Test that host is powered off when status action returns power off
*/
@Test
public void hostIsPoweredOffWhenFenceStatusReturnsOff() {
mockFenceAgent();
// result of fence action invoked on specified agent
mockFenceResult(agentExecutor1, new FenceOperationResult(Status.SUCCESS, PowerStatus.OFF));
assertTrue(executor.isHostPoweredOff());
}
use of org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult in project ovirt-engine by oVirt.
the class HostFenceActionExecutorTest method failedFenceWithAllError.
/**
* Test failed fence action when both of 2 sequential fence agents return error
*/
@Test
public void failedFenceWithAllError() {
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.ERROR, PowerStatus.UNKNOWN));
FenceOperationResult result = executor.fence(FenceActionType.STATUS);
assertEquals(Status.ERROR, result.getStatus());
assertEquals(PowerStatus.UNKNOWN, result.getPowerStatus());
}
Aggregations