Search in sources :

Example 1 with RoundTripStatus

use of org.openkilda.wfm.topology.network.model.RoundTripStatus in project open-kilda by telstra.

the class NetworkIslServiceTest method roundTripDiscoveryOnDestResetPortDownStatus.

@Test
public void roundTripDiscoveryOnDestResetPortDownStatus() {
    IslReference reference = preparePortDownStatusReset();
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getDest(), IslStatus.ACTIVE));
    verifyNoMoreInteractions(dashboardLogger);
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getDest(), IslStatus.ACTIVE));
    verify(dashboardLogger).onIslUp(eq(reference), any());
    verifyNoMoreInteractions(dashboardLogger);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) RoundTripStatus(org.openkilda.wfm.topology.network.model.RoundTripStatus) Test(org.junit.Test)

Example 2 with RoundTripStatus

use of org.openkilda.wfm.topology.network.model.RoundTripStatus in project open-kilda by telstra.

the class NetworkIslServiceTest method considerRecoveryAfterRoundTrip.

@Test
public void considerRecoveryAfterRoundTrip() {
    setupIslStorageStub();
    final IslReference reference = prepareActiveIsl();
    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);
    // still up because of active round trip discovery
    verify(dashboardLogger, times(0)).onIslDown(eq(reference), any());
    // restore one-way discovery status
    service.islUp(reference.getSource(), reference, new IslDataHolder(200L, 200L, 200L));
    service.islUp(reference.getDest(), reference, new IslDataHolder(200L, 200L, 200L));
    // remove round trip discovery
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getSource(), IslStatus.INACTIVE));
    // must not fail, because of successful discovery notifications
    verify(dashboardLogger, times(0)).onIslDown(eq(reference), any());
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) RoundTripStatus(org.openkilda.wfm.topology.network.model.RoundTripStatus) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder) Test(org.junit.Test)

Example 3 with RoundTripStatus

use of org.openkilda.wfm.topology.network.model.RoundTripStatus 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 4 with RoundTripStatus

use of org.openkilda.wfm.topology.network.model.RoundTripStatus 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 5 with RoundTripStatus

use of org.openkilda.wfm.topology.network.model.RoundTripStatus 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)9 RoundTripStatus (org.openkilda.wfm.topology.network.model.RoundTripStatus)9 Test (org.junit.Test)8 RerouteAffectedFlows (org.openkilda.messaging.command.reroute.RerouteAffectedFlows)2 IslStatusUpdateNotification (org.openkilda.messaging.info.event.IslStatusUpdateNotification)2 Isl (org.openkilda.model.Isl)2 Duration (java.time.Duration)1 Instant (java.time.Instant)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 AllArgsConstructor (lombok.AllArgsConstructor)1 EqualsAndHashCode (lombok.EqualsAndHashCode)1 Getter (lombok.Getter)1 Failsafe (net.jodah.failsafe.Failsafe)1 RetryPolicy (net.jodah.failsafe.RetryPolicy)1 Assert (org.junit.Assert)1