Search in sources :

Example 1 with OneSwitchFlowRequest

use of org.openkilda.floodlight.api.request.OneSwitchFlowRequest in project open-kilda by telstra.

the class SpeakerFlowSegmentRequestBuilderTest method verifyReverseOneSwitchRequest.

private void verifyReverseOneSwitchRequest(Flow flow, FlowSegmentRequest rawRequest) {
    FlowPath path = Objects.requireNonNull(flow.getReversePath());
    OneSwitchFlowRequest request = verifyCommonOneSwitchRequest(flow, path, rawRequest);
    assertEquals(new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan()), request.getEndpoint());
    assertEquals(new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan()), request.getEgressEndpoint());
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) OneSwitchFlowRequest(org.openkilda.floodlight.api.request.OneSwitchFlowRequest) FlowPath(org.openkilda.model.FlowPath)

Example 2 with OneSwitchFlowRequest

use of org.openkilda.floodlight.api.request.OneSwitchFlowRequest in project open-kilda by telstra.

the class SpeakerFlowSegmentRequestBuilderTest method verifyForwardOneSwitchRequest.

private void verifyForwardOneSwitchRequest(Flow flow, FlowSegmentRequest rawRequest) {
    FlowPath path = Objects.requireNonNull(flow.getForwardPath());
    OneSwitchFlowRequest request = verifyCommonOneSwitchRequest(flow, path, rawRequest);
    assertEquals(new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan()), request.getEndpoint());
    assertEquals(new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan()), request.getEgressEndpoint());
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) OneSwitchFlowRequest(org.openkilda.floodlight.api.request.OneSwitchFlowRequest) FlowPath(org.openkilda.model.FlowPath)

Example 3 with OneSwitchFlowRequest

use of org.openkilda.floodlight.api.request.OneSwitchFlowRequest in project open-kilda by telstra.

the class SpeakerFlowSegmentRequestBuilderTest method verifyCommonOneSwitchRequest.

private OneSwitchFlowRequest verifyCommonOneSwitchRequest(Flow flow, FlowPath path, FlowSegmentRequest rawRequest) {
    assertThat("Should be one switch flow request", rawRequest, instanceOf(OneSwitchFlowRequest.class));
    OneSwitchFlowRequest request = (OneSwitchFlowRequest) rawRequest;
    assertEquals(flow.getFlowId(), request.getFlowId());
    assertEquals(path.getCookie(), request.getCookie());
    return request;
}
Also used : OneSwitchFlowRequest(org.openkilda.floodlight.api.request.OneSwitchFlowRequest)

Aggregations

OneSwitchFlowRequest (org.openkilda.floodlight.api.request.OneSwitchFlowRequest)3 FlowEndpoint (org.openkilda.model.FlowEndpoint)2 FlowPath (org.openkilda.model.FlowPath)2