Search in sources :

Example 41 with IslReference

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);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) Test(org.junit.Test)

Example 42 with IslReference

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());
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder) Test(org.junit.Test)

Example 43 with IslReference

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);
}
Also used : Isl(org.openkilda.model.Isl) Endpoint(org.openkilda.wfm.share.model.Endpoint) IslReference(org.openkilda.wfm.share.model.IslReference) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder) Test(org.junit.Test)

Example 44 with IslReference

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);
}
Also used : Isl(org.openkilda.model.Isl) Endpoint(org.openkilda.wfm.share.model.Endpoint) IslReference(org.openkilda.wfm.share.model.IslReference) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder) Test(org.junit.Test)

Example 45 with IslReference

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);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) RoundTripStatus(org.openkilda.wfm.topology.network.model.RoundTripStatus)

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