use of org.openkilda.floodlight.api.request.SpeakerRequest in project open-kilda by telstra.
the class SpeakerWorkerBolt method onHubRequest.
@Override
protected void onHubRequest(Tuple input) throws PipelineException {
SpeakerRequest command = pullValue(input, FIELD_ID_PAYLOAD, SpeakerRequest.class);
service.sendCommand(pullKey(), command);
}
use of org.openkilda.floodlight.api.request.SpeakerRequest in project open-kilda by telstra.
the class FlowPathSwapServiceTest method shouldFailSwapOnTimeoutDuringInstallation.
@Test
public void shouldFailSwapOnTimeoutDuringInstallation() {
// given
Flow origin = dummyFactory.makeFlowWithProtectedPath(flowSource, flowDestination, singletonList(islSourceDest), singletonList(islSourceDestAlt));
// when
FlowPathSwapService service = makeService();
FlowPathSwapRequest request = new FlowPathSwapRequest(origin.getFlowId(), true);
service.handleRequest(dummyRequestKey, commandContext, request);
verifyFlowStatus(origin.getFlowId(), FlowStatus.IN_PROGRESS);
service.handleTimeout(dummyRequestKey);
SpeakerRequest speakerRequest;
while ((speakerRequest = requests.poll()) != null) {
produceAsyncResponse(service, dummyRequestKey, speakerRequest);
}
// then
Flow result = verifyFlowStatus(origin.getFlowId(), FlowStatus.UP);
verifyPathNotSwapped(origin, result);
verifyNorthboundSuccessResponse(carrier);
}
use of org.openkilda.floodlight.api.request.SpeakerRequest in project open-kilda by telstra.
the class FlowPathSwapServiceTest method shouldSuccessfullySwapFlowPaths.
@Test
public void shouldSuccessfullySwapFlowPaths() {
// given
Flow origin = dummyFactory.makeFlowWithProtectedPath(flowSource, flowDestination, singletonList(islSourceDest), singletonList(islSourceDestAlt));
// when
FlowPathSwapService service = makeService();
FlowPathSwapRequest request = new FlowPathSwapRequest(origin.getFlowId(), true);
service.handleRequest(dummyRequestKey, commandContext, request);
verifyFlowStatus(origin.getFlowId(), FlowStatus.IN_PROGRESS);
SpeakerRequest speakerRequest;
while ((speakerRequest = requests.poll()) != null) {
produceAsyncResponse(service, dummyRequestKey, speakerRequest);
}
// then
Flow result = verifyFlowStatus(origin.getFlowId(), FlowStatus.UP);
verifyPathSwapped(origin, result);
verifyNorthboundSuccessResponse(carrier);
}
use of org.openkilda.floodlight.api.request.SpeakerRequest in project open-kilda by telstra.
the class FlowPathSwapServiceTest method shouldSuccessfullySwapYFlowPaths.
@Test
public void shouldSuccessfullySwapYFlowPaths() {
// given
Flow origin = dummyFactory.makeFlowWithProtectedPath(flowSource, flowDestination, singletonList(islSourceDest), singletonList(islSourceDestAlt));
createTestYFlowForSubFlow(origin);
// when
FlowPathSwapService service = makeService();
FlowPathSwapRequest request = new FlowPathSwapRequest(origin.getFlowId(), false);
service.handleRequest(dummyRequestKey, commandContext, request);
verifyFlowStatus(origin.getFlowId(), FlowStatus.IN_PROGRESS);
SpeakerRequest speakerRequest;
while ((speakerRequest = requests.poll()) != null) {
produceAsyncResponse(service, dummyRequestKey, speakerRequest);
}
// then
Flow result = verifyFlowStatus(origin.getFlowId(), FlowStatus.UP);
verifyPathSwapped(origin, result);
verifyNorthboundSuccessResponse(carrier);
}
Aggregations