use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method noResurrectOnBfdFail.
@Test
public void noResurrectOnBfdFail() {
IslReference reference = prepareResurrection();
service.bfdStatusUpdate(reference.getSource(), reference, BfdStatusUpdate.FAIL);
testResurrection(reference, false);
}
use of org.openkilda.wfm.share.model.IslReference 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.share.model.IslReference 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.share.model.IslReference 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);
}
use of org.openkilda.wfm.share.model.IslReference 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