use of org.openkilda.wfm.topology.network.model.RoundTripStatus 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));
}
use of org.openkilda.wfm.topology.network.model.RoundTripStatus 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);
}
use of org.openkilda.wfm.topology.network.model.RoundTripStatus in project open-kilda by telstra.
the class NetworkIslServiceTest method continuousReplugVsRoundTripAlive.
@Test
public void continuousReplugVsRoundTripAlive() {
setupIslStorageStub();
IslReference referenceAlpha = prepareActiveIsl();
IslReference referenceBeta = new IslReference(Endpoint.of(referenceAlpha.getSource().getDatapath(), referenceAlpha.getSource().getPortNumber() + 1), referenceAlpha.getDest());
Instant lastSeen = clock.instant();
service.roundTripStatusNotification(referenceAlpha, new RoundTripStatus(referenceAlpha.getSource(), IslStatus.ACTIVE));
IslDataHolder alphaSource = new IslDataHolder(lookupIsl(referenceAlpha.getSource(), referenceAlpha.getDest()));
IslDataHolder alphaDest = new IslDataHolder(lookupIsl(referenceAlpha.getDest(), referenceAlpha.getSource()));
IslDataHolder betaSource = new IslDataHolder(makeIsl(referenceBeta.getSource(), referenceBeta.getDest(), false).build());
IslDataHolder betaDest = new IslDataHolder(makeIsl(referenceBeta.getDest(), referenceBeta.getSource(), false).build());
IslStatusUpdateNotification alphaNotification = new IslStatusUpdateNotification(referenceAlpha.getSource().getDatapath(), referenceAlpha.getSource().getPortNumber(), referenceAlpha.getDest().getDatapath(), referenceAlpha.getDest().getPortNumber(), IslStatus.MOVED);
IslStatusUpdateNotification betaNotification = new IslStatusUpdateNotification(referenceBeta.getSource().getDatapath(), referenceBeta.getSource().getPortNumber(), referenceBeta.getDest().getDatapath(), referenceBeta.getDest().getPortNumber(), IslStatus.MOVED);
for (int i = 0; i < 100; i++) {
// alpha -> beta
service.islMove(referenceAlpha.getSource(), referenceAlpha);
service.islUp(referenceBeta.getSource(), referenceBeta, betaSource);
service.islUp(referenceBeta.getDest(), referenceBeta, betaDest);
service.roundTripStatusNotification(referenceBeta, new RoundTripStatus(referenceBeta.getSource(), IslStatus.ACTIVE));
verifyStatus(referenceAlpha, IslStatus.MOVED);
verifyStatus(referenceBeta, IslStatus.ACTIVE);
verify(carrier, times(i + 1)).islStatusUpdateNotification(eq(alphaNotification));
verify(carrier, times(i + 1)).triggerReroute(argThat(entry -> entry instanceof RerouteAffectedFlows && Objects.equals(new PathNode(referenceAlpha.getSource().getDatapath(), referenceAlpha.getSource().getPortNumber(), 0), entry.getPathNode())));
verify(carrier, times(i + 1)).triggerReroute(argThat(entry -> entry instanceof RerouteInactiveFlows && Objects.equals(new PathNode(referenceBeta.getSource().getDatapath(), referenceBeta.getSource().getPortNumber(), 0), entry.getPathNode())));
// beta -> alpha
service.islMove(referenceBeta.getSource(), referenceBeta);
service.islUp(referenceAlpha.getSource(), referenceAlpha, alphaSource);
service.islUp(referenceAlpha.getDest(), referenceAlpha, alphaDest);
service.roundTripStatusNotification(referenceAlpha, new RoundTripStatus(referenceAlpha.getSource(), IslStatus.ACTIVE));
verifyStatus(referenceAlpha, IslStatus.ACTIVE);
verifyStatus(referenceBeta, IslStatus.MOVED);
verify(carrier, times(i + 1)).islStatusUpdateNotification(eq(betaNotification));
verify(carrier, times(i + 1)).triggerReroute(argThat(entry -> entry instanceof RerouteAffectedFlows && Objects.equals(new PathNode(referenceBeta.getSource().getDatapath(), referenceBeta.getSource().getPortNumber(), 0), entry.getPathNode())));
verify(carrier, times(i + 1)).triggerReroute(argThat(entry -> entry instanceof RerouteInactiveFlows && Objects.equals(new PathNode(referenceAlpha.getSource().getDatapath(), referenceAlpha.getSource().getPortNumber(), 0), entry.getPathNode())));
}
}
use of org.openkilda.wfm.topology.network.model.RoundTripStatus in project open-kilda by telstra.
the class NetworkUniIslServiceTest method verifyProxyRoundTripStatus.
private void verifyProxyRoundTripStatus(NetworkUniIslService service, Endpoint endpoint, Endpoint remote) {
RoundTripStatus status = new RoundTripStatus(endpoint, IslStatus.ACTIVE);
service.roundTripStatusNotification(status);
IslReference reference = new IslReference(endpoint, remote);
verify(carrier).notifyIslRoundTripStatus(eq(reference), eq(status));
reset(carrier);
}
Aggregations