Search in sources :

Example 6 with SpeakerRequest

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);
}
Also used : SpeakerRequest(org.openkilda.floodlight.api.request.SpeakerRequest)

Example 7 with SpeakerRequest

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);
}
Also used : FlowPathSwapRequest(org.openkilda.messaging.command.flow.FlowPathSwapRequest) SpeakerRequest(org.openkilda.floodlight.api.request.SpeakerRequest) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 8 with SpeakerRequest

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);
}
Also used : FlowPathSwapRequest(org.openkilda.messaging.command.flow.FlowPathSwapRequest) SpeakerRequest(org.openkilda.floodlight.api.request.SpeakerRequest) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 9 with SpeakerRequest

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);
}
Also used : FlowPathSwapRequest(org.openkilda.messaging.command.flow.FlowPathSwapRequest) SpeakerRequest(org.openkilda.floodlight.api.request.SpeakerRequest) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Aggregations

SpeakerRequest (org.openkilda.floodlight.api.request.SpeakerRequest)9 Test (org.junit.Test)6 FlowPathSwapRequest (org.openkilda.messaging.command.flow.FlowPathSwapRequest)6 Flow (org.openkilda.model.Flow)6 FlowSegmentRequest (org.openkilda.floodlight.api.request.FlowSegmentRequest)4 BaseSpeakerCommandsRequest (org.openkilda.floodlight.api.request.rulemanager.BaseSpeakerCommandsRequest)3 FlowCommand (org.openkilda.floodlight.api.request.rulemanager.FlowCommand)1 GroupCommand (org.openkilda.floodlight.api.request.rulemanager.GroupCommand)1 MeterCommand (org.openkilda.floodlight.api.request.rulemanager.MeterCommand)1 SpeakerFlowSegmentResponse (org.openkilda.floodlight.api.response.SpeakerFlowSegmentResponse)1 SpeakerResponse (org.openkilda.floodlight.api.response.SpeakerResponse)1 SpeakerCommandResponse (org.openkilda.floodlight.api.response.rulemanager.SpeakerCommandResponse)1 SpeakerData (org.openkilda.rulemanager.SpeakerData)1