Search in sources :

Example 6 with FencingPolicy

use of org.ovirt.engine.core.common.businessentities.FencingPolicy in project ovirt-engine by oVirt.

the class HostFenceActionExecutorTest method setup.

@Before
public void setup() {
    when(dbFacade.getFenceAgentDao()).thenReturn(fenceAgentDao);
    when(fencedHost.getId()).thenReturn(FENCECD_HOST_ID);
    executor = spy(new HostFenceActionExecutor(fencedHost, new FencingPolicy()));
    doReturn(dbFacade).when(executor).getDbFacade();
    doReturn(agentExecutor1).doReturn(agentExecutor2).when(executor).createFenceActionExecutor(any());
}
Also used : FencingPolicy(org.ovirt.engine.core.common.businessentities.FencingPolicy) Before(org.junit.Before)

Example 7 with FencingPolicy

use of org.ovirt.engine.core.common.businessentities.FencingPolicy in project ovirt-engine by oVirt.

the class HostFenceActionExecutorTest method testConcurrentAgentsFenceActionExecutorUsage.

/**
 * Tests {@code ConcurrentAgentsFenceActionExecutor} creation for concurrent fence agents
 */
@Test
public void testConcurrentAgentsFenceActionExecutorUsage() {
    HostFenceActionExecutor executor = new HostFenceActionExecutor(fencedHost, new FencingPolicy());
    assertTrue(executor.createFenceActionExecutor(createConcurrentAgentsList(2, 1)) instanceof ConcurrentAgentsFenceActionExecutor);
}
Also used : FencingPolicy(org.ovirt.engine.core.common.businessentities.FencingPolicy) Test(org.junit.Test)

Example 8 with FencingPolicy

use of org.ovirt.engine.core.common.businessentities.FencingPolicy in project ovirt-engine by oVirt.

the class SingleAgentFenceActionExecutorTest method setup.

@Before
public void setup() {
    executor = spy(new SingleAgentFenceActionExecutor(fencedHost, fenceAgent, new FencingPolicy()));
    doReturn(fenceAgentExecutor).when(executor).createAgentExecutor();
    doReturn(0).when(executor).getSleepBeforeFirstAttempt();
    doReturn(0).when(executor).getUnknownResultLimit();
    doNothing().when(executor).auditVerifyStatusRetryLimitExceeded(any());
    doReturn("host1").when(fencedHost).getHostName();
}
Also used : FencingPolicy(org.ovirt.engine.core.common.businessentities.FencingPolicy) Before(org.junit.Before)

Aggregations

FencingPolicy (org.ovirt.engine.core.common.businessentities.FencingPolicy)8 Before (org.junit.Before)3 Test (org.junit.Test)3 VDS (org.ovirt.engine.core.common.businessentities.VDS)2 ArrayList (java.util.ArrayList)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)1 FenceAgent (org.ovirt.engine.core.common.businessentities.pm.FenceAgent)1 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)1