Search in sources :

Example 11 with FlowPathSwapRequest

use of org.openkilda.messaging.command.flow.FlowPathSwapRequest 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 12 with FlowPathSwapRequest

use of org.openkilda.messaging.command.flow.FlowPathSwapRequest 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

FlowPathSwapRequest (org.openkilda.messaging.command.flow.FlowPathSwapRequest)12 Test (org.junit.Test)7 SpeakerRequest (org.openkilda.floodlight.api.request.SpeakerRequest)6 Flow (org.openkilda.model.Flow)6 FlowSegmentRequest (org.openkilda.floodlight.api.request.FlowSegmentRequest)3 Values (org.apache.storm.tuple.Values)2 BaseSpeakerCommandsRequest (org.openkilda.floodlight.api.request.rulemanager.BaseSpeakerCommandsRequest)2 MessageData (org.openkilda.messaging.MessageData)2 CommandMessage (org.openkilda.messaging.command.CommandMessage)2 FlowRerouteRequest (org.openkilda.messaging.command.flow.FlowRerouteRequest)2 YFlowRerouteRequest (org.openkilda.messaging.command.yflow.YFlowRerouteRequest)2 CommandContext (org.openkilda.wfm.CommandContext)2 SpeakerResponse (org.openkilda.floodlight.api.response.SpeakerResponse)1 CreateFlowLoopRequest (org.openkilda.messaging.command.flow.CreateFlowLoopRequest)1 DeleteFlowLoopRequest (org.openkilda.messaging.command.flow.DeleteFlowLoopRequest)1 FlowDeleteRequest (org.openkilda.messaging.command.flow.FlowDeleteRequest)1 FlowMirrorPointCreateRequest (org.openkilda.messaging.command.flow.FlowMirrorPointCreateRequest)1 FlowMirrorPointDeleteRequest (org.openkilda.messaging.command.flow.FlowMirrorPointDeleteRequest)1 FlowRequest (org.openkilda.messaging.command.flow.FlowRequest)1 FlowValidationRequest (org.openkilda.messaging.command.flow.FlowValidationRequest)1