use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method noResurrectOnBfdDown.
@Test
public void noResurrectOnBfdDown() {
IslReference reference = prepareResurrection();
service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.DOWN);
testResurrection(reference, false);
}
use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method prepareBfdEnabledIsl.
private IslReference prepareBfdEnabledIsl() {
IslReference reference = prepareActiveIsl();
service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.UP);
service.bfdStatusUpdate(reference.getDest(), reference, BfdStatusUpdate.UP);
return reference;
}
use of org.openkilda.wfm.share.model.IslReference 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.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method ignoreBfdEventsDuringBfdUpdate.
@Test
public void ignoreBfdEventsDuringBfdUpdate() {
setupIslStorageStub();
IslReference reference = prepareBfdEnabledIsl();
reset(dashboardLogger);
service.bfdPropertiesUpdate(reference);
verifyZeroInteractions(dashboardLogger);
service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.DOWN);
service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.KILL);
verifyZeroInteractions(dashboardLogger);
service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.DOWN);
verifyZeroInteractions(dashboardLogger);
service.bfdStatusUpdate(reference.getDest(), reference, BfdStatusUpdate.DOWN);
verify(dashboardLogger).onIslDown(eq(reference), any());
verifyNoMoreInteractions(dashboardLogger);
}
use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method considerLinkPropsDataOnRediscovery.
@Test
public void considerLinkPropsDataOnRediscovery() {
setupIslStorageStub();
final Isl islAlphaBeta = makeIsl(endpointAlpha1, endpointBeta2, false).defaultMaxBandwidth(300L).availableBandwidth(300L).build();
final Isl islBetaAlpha = makeIsl(endpointBeta2, endpointAlpha1, false).defaultMaxBandwidth(300L).availableBandwidth(300L).build();
// initial discovery
mockPersistenceLinkProps(endpointAlpha1, endpointBeta2, null);
mockPersistenceLinkProps(endpointBeta2, endpointAlpha1, null);
IslReference reference = new IslReference(endpointAlpha1, endpointBeta2);
service.islUp(endpointAlpha1, reference, new IslDataHolder(300L, 300L, 300L));
service.islUp(endpointBeta2, reference, new IslDataHolder(300L, 300L, 300L));
verifyIslBandwidthUpdate(300L, 300L);
// fail
service.islDown(endpointAlpha1, reference, IslDownReason.POLL_TIMEOUT);
service.islDown(endpointBeta2, reference, IslDownReason.POLL_TIMEOUT);
reset(linkPropsRepository);
// rediscovery
mockPersistenceLinkProps(endpointAlpha1, endpointBeta2, makeLinkProps(endpointAlpha1, endpointBeta2).maxBandwidth(50L).build());
mockPersistenceLinkProps(endpointBeta2, endpointAlpha1, null);
service.islUp(endpointAlpha1, reference, new IslDataHolder(300L, 300L, 300L));
service.islUp(endpointBeta2, reference, new IslDataHolder(300L, 300L, 300L));
verifyIslBandwidthUpdate(50L, 300L);
}
Aggregations