use of org.openkilda.wfm.topology.network.model.BfdSessionData in project open-kilda by telstra.
the class NetworkBfdLogicalPortService method enableUpdate.
private void enableUpdate(Endpoint physical, IslReference reference, BfdProperties properties) {
logServiceCall("ENABLE/UPDATE physical={}, reference={}, properties={}", physical, reference, properties);
BfdLogicalPortFsm controller = lookupControllerCreateIfMissing(physical);
BfdLogicalPortFsmContext context = BfdLogicalPortFsmContext.builder().sessionData(new BfdSessionData(reference, properties)).build();
handle(controller, Event.ENABLE_UPDATE, context);
}
use of org.openkilda.wfm.topology.network.model.BfdSessionData in project open-kilda by telstra.
the class NetworkBfdSessionServiceTest method failOnCriticalErrors.
@Test
public void failOnCriticalErrors() {
BfdSession initialBfdSession = makeBfdSession(1);
NoviBfdSession removeRequestPayload = forceCleanupAfterInit(initialBfdSession);
// push speaker error(critical) response
mockBfdSessionLookup(initialBfdSession);
BfdSessionResponse removeResponse = new BfdSessionResponse(removeRequestPayload, NoviBfdSession.Errors.SWITCH_RESPONSE_ERROR);
service.speakerResponse(alphaLogicalEndpoint, removeRequestKey, removeResponse);
verify(carrier).bfdFailNotification(alphaEndpoint);
verifyNoMoreInteractions(carrier);
verifyNoMoreInteractions(bfdSessionRepository);
resetCarrier();
reset(bfdSessionRepository);
// make one more remove attempt on next enable/update request
service.enableUpdate(alphaLogicalEndpoint, alphaEndpoint.getPortNumber(), new BfdSessionData(alphaToBetaIslRef, genericBfdProperties));
verify(carrier).sendWorkerBfdSessionDeleteRequest(removeRequestPayload);
verifyNoMoreInteractions(carrier);
}
use of org.openkilda.wfm.topology.network.model.BfdSessionData in project open-kilda by telstra.
the class NetworkBfdLogicalPortServiceTest method portDeleteDelayedResponse.
@Test
public void portDeleteDelayedResponse() {
NetworkBfdLogicalPortService service = makeService();
final String deleteRequestId = doDisableOnReadyPort(service);
service.apply(physical, reference, propertiesEnabled);
verifyNoInteractions(carrier);
final String createRequestId = "port-create-request";
when(carrier.createLogicalPort(eq(logical), eq(physical.getPortNumber()))).thenReturn(createRequestId);
service.portDel(logical);
verify(carrier).createLogicalPort(eq(logical), eq(physical.getPortNumber()));
reset(carrier);
service.workerSuccess(createRequestId, logical, makePortCreateResponse(physical, logical));
verifyNoInteractions(carrier);
DeleteLogicalPortResponse deleteResponse = new DeleteLogicalPortResponse(logical.getDatapath().toString(), logical.getPortNumber(), true);
service.workerSuccess(deleteRequestId, logical, deleteResponse);
service.portAdd(logical, physical.getPortNumber());
verify(carrier).enableUpdateSession(eq(logical), eq(physical.getPortNumber()), eq(new BfdSessionData(reference, propertiesEnabled)));
}
use of org.openkilda.wfm.topology.network.model.BfdSessionData in project open-kilda by telstra.
the class NetworkBfdLogicalPortServiceTest method enableDuringCleanup.
@Test
public void enableDuringCleanup() {
NetworkBfdLogicalPortService service = makeService();
switchOnlineStatusMonitor.update(physical.getDatapath(), true);
service.portAdd(logical, physical.getPortNumber());
service.apply(physical, reference, propertiesEnabled);
verify(carrier).logicalPortControllerAddNotification(eq(physical));
reset(carrier);
final String deleteRequestId = "port-delete-request";
when(carrier.deleteLogicalPort(eq(logical))).thenReturn(deleteRequestId);
service.disable(physical);
service.sessionCompleteNotification(physical);
verify(carrier).deleteLogicalPort(eq(logical));
reset(carrier);
final String createRequestId = "port-create-request";
when(carrier.createLogicalPort(eq(logical), eq(physical.getPortNumber()))).thenReturn(createRequestId);
BfdProperties altProperties = new BfdProperties(Duration.ofMillis(propertiesEnabled.getInterval().toMillis() + 100), (short) (propertiesEnabled.getMultiplier() + 1));
service.apply(physical, reference, altProperties);
service.portDel(logical);
service.portAdd(logical, physical.getPortNumber());
verify(carrier).enableUpdateSession(eq(logical), eq(physical.getPortNumber()), eq(new BfdSessionData(reference, altProperties)));
}
use of org.openkilda.wfm.topology.network.model.BfdSessionData in project open-kilda by telstra.
the class NetworkBfdLogicalPortServiceTest method portDeleteDelayedPortEvent.
@Test
public void portDeleteDelayedPortEvent() {
NetworkBfdLogicalPortService service = makeService();
final String deleteRequestId = doDisableOnReadyPort(service);
service.apply(physical, reference, propertiesEnabled);
verifyNoInteractions(carrier);
final String createRequestId1 = "port-create-request-1";
when(carrier.createLogicalPort(eq(logical), eq(physical.getPortNumber()))).thenReturn(createRequestId1);
DeleteLogicalPortResponse deleteResponse = new DeleteLogicalPortResponse(logical.getDatapath().toString(), logical.getPortNumber(), true);
service.workerSuccess(deleteRequestId, logical, deleteResponse);
verify(carrier).createLogicalPort(eq(logical), eq(physical.getPortNumber()));
reset(carrier);
final String createRequestId2 = "port-create-request-2";
when(carrier.createLogicalPort(eq(logical), eq(physical.getPortNumber()))).thenReturn(createRequestId2);
service.portDel(logical);
verify(carrier).createLogicalPort(eq(logical), eq(physical.getPortNumber()));
reset(carrier);
service.workerSuccess(createRequestId1, logical, makePortCreateResponse(physical, logical));
verifyNoInteractions(carrier);
service.portAdd(logical, physical.getPortNumber());
verify(carrier).enableUpdateSession(eq(logical), eq(physical.getPortNumber()), eq(new BfdSessionData(reference, propertiesEnabled)));
}
Aggregations