use of org.openkilda.wfm.topology.network.model.IslDataHolder 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);
}
use of org.openkilda.wfm.topology.network.model.IslDataHolder in project open-kilda by telstra.
the class NetworkIslServiceTest method bfdUpOverriderPollDown.
@Test
public void bfdUpOverriderPollDown() {
setupIslStorageStub();
IslReference reference = prepareBfdEnabledIsl();
reset(dashboardLogger);
service.islDown(reference.getSource(), reference, IslDownReason.POLL_TIMEOUT);
verifyNoMoreInteractions(dashboardLogger);
service.islUp(reference.getSource(), reference, new IslDataHolder(100, 100, 100));
verifyNoMoreInteractions(dashboardLogger);
service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.DOWN);
service.bfdStatusUpdate(reference.getDest(), reference, BfdStatusUpdate.DOWN);
// from poll point of view ISL is UP but BFD must force status to DOWN
verify(dashboardLogger).onIslDown(eq(reference), any());
}
use of org.openkilda.wfm.topology.network.model.IslDataHolder in project open-kilda by telstra.
the class NetworkUniIslServiceTest method replugIntoSelfLoop.
@Test
public void replugIntoSelfLoop() {
NetworkUniIslService service = new NetworkUniIslService(carrier);
Endpoint endpointA = Endpoint.of(alphaDatapath, 1);
Endpoint endpointZ = Endpoint.of(betaDatapath, 2);
verifyNoMoreInteractions(carrier);
service.uniIslSetup(endpointA, null);
Isl genericIsl = makeIslBuilder(endpointA, endpointZ).build();
IslInfoData genericData = IslMapper.INSTANCE.map(genericIsl);
service.uniIslDiscovery(endpointA, genericData);
verify(carrier).notifyIslUp(eq(endpointA), eq(IslReference.of(genericIsl)), eq(new IslDataHolder(genericData)));
// replug into self-loop
Isl selfLoopIsl = makeIslBuilder(endpointA, Endpoint.of(endpointA.getDatapath(), endpointA.getPortNumber() + 1)).build();
IslInfoData selfLoopData = IslMapper.INSTANCE.map((selfLoopIsl));
service.uniIslDiscovery(endpointA, selfLoopData);
verify(carrier, times(1)).notifyIslMove(eq(endpointA), eq(IslReference.of(genericIsl)));
verify(carrier, times(0)).notifyIslUp(eq(endpointA), eq(IslReference.of(selfLoopIsl)), eq(new IslDataHolder(selfLoopData)));
service.uniIslDiscovery(endpointA, selfLoopData);
// no new move events and no discovery notifications for self-looped ISL
verify(carrier, times(1)).notifyIslMove(eq(endpointA), eq(IslReference.of(genericIsl)));
verify(carrier, times(0)).notifyIslUp(eq(endpointA), eq(IslReference.of(selfLoopIsl)), eq(new IslDataHolder(selfLoopData)));
}
use of org.openkilda.wfm.topology.network.model.IslDataHolder in project open-kilda by telstra.
the class NetworkUniIslServiceTest method selfLoopWhenUp.
@Test
public void selfLoopWhenUp() {
NetworkUniIslService service = new NetworkUniIslService(carrier);
final Endpoint endpointAlpha1 = Endpoint.of(alphaDatapath, 1);
final Endpoint endpointAlpha2 = Endpoint.of(alphaDatapath, 2);
final Endpoint endpointBeta3 = Endpoint.of(betaDatapath, 3);
// setup
service.uniIslSetup(endpointAlpha1, null);
verifyNoMoreInteractions(carrier);
// initial (normal) discovery
Isl normalIsl = makeIslBuilder(endpointAlpha1, endpointBeta3).build();
service.uniIslDiscovery(endpointAlpha1, IslMapper.INSTANCE.map(normalIsl));
verify(carrier).notifyIslUp(endpointAlpha1, new IslReference(endpointAlpha1, endpointBeta3), new IslDataHolder(normalIsl));
verify(carrier).exhaustedPollModeUpdateRequest(endpointAlpha1, false);
verifyNoMoreInteractions(carrier);
reset(carrier);
// self loop must trigger ISL move
Isl selfLoopIsl = makeIslBuilder(endpointAlpha1, endpointAlpha2).build();
service.uniIslDiscovery(endpointAlpha1, IslMapper.INSTANCE.map(selfLoopIsl));
verify(carrier).notifyIslMove(endpointAlpha1, new IslReference(endpointAlpha1, endpointBeta3));
verifyNoMoreInteractions(carrier);
reset(carrier);
// ensure following discovery will be processed
verifyIslCanBeDiscovered(service, normalIsl);
}
use of org.openkilda.wfm.topology.network.model.IslDataHolder in project open-kilda by telstra.
the class NetworkUniIslServiceTest method selfLoopWhenDownAndRemoteIsSet.
@Test
public void selfLoopWhenDownAndRemoteIsSet() {
NetworkUniIslService service = new NetworkUniIslService(carrier);
final Endpoint endpointAlpha1 = Endpoint.of(alphaDatapath, 1);
final Endpoint endpointAlpha2 = Endpoint.of(alphaDatapath, 2);
final Endpoint endpointBeta3 = Endpoint.of(betaDatapath, 3);
// setup
service.uniIslSetup(endpointAlpha1, null);
verifyNoMoreInteractions(carrier);
// initial (normal) discovery
Isl normalIsl = makeIslBuilder(endpointAlpha1, endpointBeta3).build();
service.uniIslDiscovery(endpointAlpha1, IslMapper.INSTANCE.map(normalIsl));
final IslReference reference = new IslReference(endpointAlpha1, endpointBeta3);
verify(carrier).notifyIslUp(endpointAlpha1, reference, new IslDataHolder(normalIsl));
verify(carrier).exhaustedPollModeUpdateRequest(endpointAlpha1, false);
verifyNoMoreInteractions(carrier);
reset(carrier);
// fail
service.uniIslFail(endpointAlpha1);
verify(carrier).notifyIslDown(endpointAlpha1, reference, IslDownReason.POLL_TIMEOUT);
reset(carrier);
// discovery (self-loop)
Isl selfLoopIsl = makeIslBuilder(endpointAlpha1, endpointAlpha2).build();
service.uniIslDiscovery(endpointAlpha1, IslMapper.INSTANCE.map(selfLoopIsl));
verify(carrier).notifyIslMove(endpointAlpha1, reference);
verifyNoMoreInteractions(carrier);
reset(carrier);
// ensure following discovery will be processed
verifyIslCanBeDiscovered(service, normalIsl);
}
Aggregations