Search in sources :

Example 31 with IslReference

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

the class NetworkIslServiceTest method movedOverrideRoundTripState.

@Test
public void movedOverrideRoundTripState() {
    setupIslStorageStub();
    final IslReference reference = prepareActiveIsl();
    // inject round-trip status
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getDest(), IslStatus.ACTIVE));
    Optional<Isl> forward = islStorage.lookup(reference.getSource(), reference.getDest());
    Assert.assertTrue(forward.isPresent());
    Assert.assertNotEquals(IslStatus.ACTIVE, forward.get().getRoundTripStatus());
    Assert.assertEquals(IslStatus.ACTIVE, forward.get().getStatus());
    Optional<Isl> reverse = islStorage.lookup(reference.getDest(), reference.getSource());
    Assert.assertTrue(reverse.isPresent());
    Assert.assertEquals(IslStatus.ACTIVE, reverse.get().getRoundTripStatus());
    Assert.assertEquals(IslStatus.ACTIVE, reverse.get().getStatus());
    service.islMove(reference.getSource(), reference);
    verify(dashboardLogger).onIslMoved(eq(reference), any());
    forward = islStorage.lookup(reference.getSource(), reference.getDest());
    Assert.assertTrue(forward.isPresent());
    Assert.assertEquals(IslStatus.MOVED, forward.get().getActualStatus());
    Assert.assertEquals(IslStatus.MOVED, forward.get().getStatus());
    reverse = islStorage.lookup(reference.getDest(), reference.getSource());
    Assert.assertTrue(reverse.isPresent());
    Assert.assertNotEquals(IslStatus.MOVED, reverse.get().getActualStatus());
    Assert.assertEquals(IslStatus.MOVED, reverse.get().getStatus());
    verify(carrier).islStatusUpdateNotification(any(IslStatusUpdateNotification.class));
    verify(carrier).triggerReroute(any(RerouteAffectedFlows.class));
}
Also used : Isl(org.openkilda.model.Isl) IslStatusUpdateNotification(org.openkilda.messaging.info.event.IslStatusUpdateNotification) IslReference(org.openkilda.wfm.share.model.IslReference) RerouteAffectedFlows(org.openkilda.messaging.command.reroute.RerouteAffectedFlows) RoundTripStatus(org.openkilda.wfm.topology.network.model.RoundTripStatus) Test(org.junit.Test)

Example 32 with IslReference

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

the class NetworkIslServiceTest method resurrectAfterRemoval.

@Test
public void resurrectAfterRemoval() {
    IslReference reference = prepareResurrection();
    service.islUp(reference.getSource(), reference, new IslDataHolder(1000, 1000, 1000));
    testResurrection(reference, true);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder) Test(org.junit.Test)

Example 33 with IslReference

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

the class NetworkIslServiceTest method roundTripDiscoveryOnSourceResetPortDownStatus.

@Test
public void roundTripDiscoveryOnSourceResetPortDownStatus() {
    IslReference reference = preparePortDownStatusReset();
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getSource(), IslStatus.ACTIVE));
    verifyNoMoreInteractions(dashboardLogger);
    service.roundTripStatusNotification(reference, new RoundTripStatus(reference.getSource(), 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 34 with IslReference

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

the class NetworkIslServiceTest method verifyDelete.

private void verifyDelete() {
    verify(carrier).bfdDisableRequest(endpointAlpha1);
    verify(carrier).bfdDisableRequest(endpointBeta2);
    verify(carrier).auxiliaryPollModeUpdateRequest(endpointAlpha1, false);
    verify(carrier).auxiliaryPollModeUpdateRequest(endpointBeta2, false);
    IslReference reference = new IslReference(endpointAlpha1, endpointBeta2);
    verify(carrier).islRemovedNotification(endpointAlpha1, reference);
    verify(carrier).islRemovedNotification(endpointBeta2, reference);
    verify(carrier).islChangedNotifyFlowMonitor(reference, true);
    verifyNoMoreInteractions(carrier);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference)

Example 35 with IslReference

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

the class NetworkIslServiceTest method noResurrectOnBfdKill.

@Test
public void noResurrectOnBfdKill() {
    IslReference reference = prepareResurrection();
    service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.KILL);
    testResurrection(reference, false);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) 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