use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method initialMoveEvent.
@Test
@Ignore("become invalid due to change initialisation logic")
public void initialMoveEvent() {
emulateEmptyPersistentDb();
IslReference ref = new IslReference(endpointAlpha1, endpointBeta2);
service.islMove(ref.getSource(), ref);
// System.out.println(mockingDetails(carrier).printInvocations());
verify(carrier, times(2)).triggerReroute(any(RerouteAffectedFlows.class));
// System.out.println(mockingDetails(islRepository).printInvocations());
verify(islRepository).add(argThat(link -> link.getSrcSwitchId().equals(endpointAlpha1.getDatapath()) && link.getSrcPort() == endpointAlpha1.getPortNumber() && link.getDestSwitchId().equals(endpointBeta2.getDatapath()) && link.getDestPort() == endpointBeta2.getPortNumber() && link.getActualStatus() == IslStatus.INACTIVE && link.getStatus() == IslStatus.INACTIVE));
verify(islRepository).add(argThat(link -> link.getSrcSwitchId().equals(endpointBeta2.getDatapath()) && link.getSrcPort() == endpointBeta2.getPortNumber() && link.getDestSwitchId().equals(endpointAlpha1.getDatapath()) && link.getDestPort() == endpointAlpha1.getPortNumber() && link.getActualStatus() == IslStatus.INACTIVE && link.getStatus() == IslStatus.INACTIVE));
verifyNoMoreInteractions(carrier);
}
use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method considerLinkPropsDataOnCreate.
@Test
public void considerLinkPropsDataOnCreate() {
setupIslStorageStub();
mockPersistenceLinkProps(endpointAlpha1, endpointBeta2, makeLinkProps(endpointAlpha1, endpointBeta2).maxBandwidth(50L).build());
mockPersistenceLinkProps(endpointBeta2, endpointAlpha1, null);
mockPersistenceBandwidthAllocation(endpointAlpha1, endpointBeta2, 0L);
mockPersistenceBandwidthAllocation(endpointBeta2, endpointAlpha1, 0L);
IslReference reference = new IslReference(endpointAlpha1, endpointBeta2);
service.islUp(endpointAlpha1, reference, new IslDataHolder(200L, 200L, 200L));
service.islUp(endpointBeta2, reference, new IslDataHolder(200L, 200L, 200L));
verifyIslBandwidthUpdate(50L, 200L);
}
use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method noIslCreationOnIslDown.
@Test
public void noIslCreationOnIslDown() {
setupIslStorageStub();
IslReference reference = new IslReference(endpointAlpha1, endpointBeta2);
for (IslDownReason reason : IslDownReason.values()) {
try {
service.islDown(reference.getSource(), reference, reason);
Assert.fail("No expected exception IslControllerNotFoundException");
} catch (IslControllerNotFoundException e) {
// expected
}
}
}
use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method prepareResurrection.
private IslReference prepareResurrection() {
setupIslStorageStub();
IslReference reference = prepareActiveIsl(true);
final Endpoint alphaEnd = reference.getSource();
final Endpoint zetaEnd = reference.getDest();
service.islDown(alphaEnd, reference, IslDownReason.POLL_TIMEOUT);
service.islDown(zetaEnd, reference, IslDownReason.POLL_TIMEOUT);
reset(carrier);
service.remove(reference);
verify(carrier).islDefaultRulesDelete(eq(alphaEnd), eq(zetaEnd));
verify(carrier).islDefaultRulesDelete(eq(zetaEnd), eq(alphaEnd));
verify(carrier).bfdDisableRequest(eq(alphaEnd));
verify(carrier).bfdDisableRequest(eq(zetaEnd));
verify(carrier).auxiliaryPollModeUpdateRequest(alphaEnd, false);
verify(carrier).auxiliaryPollModeUpdateRequest(zetaEnd, false);
verifyNoMoreInteractions(carrier);
Assert.assertTrue(islStorage.lookup(alphaEnd, zetaEnd).isPresent());
return reference;
}
use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.
the class NetworkIslServiceTest method noResurrectOnPollFail.
@Test
public void noResurrectOnPollFail() {
IslReference reference = prepareResurrection();
service.islDown(reference.getSource(), reference, IslDownReason.POLL_TIMEOUT);
testResurrection(reference, false);
}
Aggregations