Search in sources :

Example 26 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkIslServiceTest method portDownOverriderBfdUp.

@Test
public void portDownOverriderBfdUp() {
    setupIslStorageStub();
    IslReference reference = prepareBfdEnabledIsl();
    reset(dashboardLogger);
    service.islDown(reference.getSource(), reference, IslDownReason.PORT_DOWN);
    verify(dashboardLogger).onIslDown(eq(reference), any());
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) Test(org.junit.Test)

Example 27 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkIslServiceTest method resurrectOnRoundTripDiscovery.

@Test
public void resurrectOnRoundTripDiscovery() {
    IslReference reference = prepareResurrection();
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getSource(), IslStatus.ACTIVE));
    testResurrection(reference, true);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) RoundTripStatus(org.openkilda.wfm.topology.network.model.RoundTripStatus) Test(org.junit.Test)

Example 28 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkIslServiceTest method noResurrectOnRoundTripFail.

@Test
public void noResurrectOnRoundTripFail() {
    IslReference reference = prepareResurrection();
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getSource(), IslStatus.INACTIVE));
    testResurrection(reference, false);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) RoundTripStatus(org.openkilda.wfm.topology.network.model.RoundTripStatus) Test(org.junit.Test)

Example 29 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkIslServiceTest method testResurrection.

private void testResurrection(IslReference reference, boolean shouldResurrect) {
    final Endpoint alphaEnd = reference.getSource();
    final Endpoint zetaEnd = reference.getDest();
    reset(carrier);
    service.islDefaultRuleDeleted(reference, new RemoveIslDefaultRulesResult(alphaEnd.getDatapath(), alphaEnd.getPortNumber(), zetaEnd.getDatapath(), zetaEnd.getPortNumber(), true));
    service.islDefaultRuleDeleted(reference, new RemoveIslDefaultRulesResult(zetaEnd.getDatapath(), zetaEnd.getPortNumber(), alphaEnd.getDatapath(), alphaEnd.getPortNumber(), true));
    if (!shouldResurrect) {
        verify(carrier).islRemovedNotification(eq(alphaEnd), eq(reference));
        verify(carrier).islRemovedNotification(eq(zetaEnd), eq(reference));
        verify(carrier).islChangedNotifyFlowMonitor(any(IslReference.class), eq(true));
    }
    verifyNoMoreInteractions(carrier);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) IslReference(org.openkilda.wfm.share.model.IslReference) RemoveIslDefaultRulesResult(org.openkilda.messaging.info.discovery.RemoveIslDefaultRulesResult)

Example 30 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkIslServiceTest method considerRoundTripDiscovery.

@Test
public void considerRoundTripDiscovery() {
    setupIslStorageStub();
    final IslReference reference = prepareActiveIsl();
    // round trip discovery (one endpoint enough)
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getSource(), IslStatus.ACTIVE));
    service.islDown(reference.getSource(), reference, IslDownReason.POLL_TIMEOUT);
    service.islDown(reference.getDest(), reference, IslDownReason.POLL_TIMEOUT);
    verify(dashboardLogger, times(0)).onIslDown(eq(reference), any());
    // round trip fail/expire
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getSource(), IslStatus.INACTIVE));
    verify(dashboardLogger).onIslDown(eq(reference), any());
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) RoundTripStatus(org.openkilda.wfm.topology.network.model.RoundTripStatus) Test(org.junit.Test)

Aggregations

IslReference (org.openkilda.wfm.share.model.IslReference)50 Test (org.junit.Test)30 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)16 Isl (org.openkilda.model.Isl)13 RoundTripStatus (org.openkilda.wfm.topology.network.model.RoundTripStatus)10 Endpoint (org.openkilda.wfm.share.model.Endpoint)8 Instant (java.time.Instant)4 Values (org.apache.storm.tuple.Values)4 RemoveIslDefaultRulesResult (org.openkilda.messaging.info.discovery.RemoveIslDefaultRulesResult)4 Ignore (org.junit.Ignore)3 Switch (org.openkilda.model.Switch)3 Duration (java.time.Duration)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2 AllArgsConstructor (lombok.AllArgsConstructor)2 EqualsAndHashCode (lombok.EqualsAndHashCode)2