Search in sources :

Example 1 with EgressFlowSegmentRequest

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

the class SpeakerFlowSegmentRequestBuilderTest method verifyReverseEgressRequest.

private void verifyReverseEgressRequest(Flow flow, FlowSegmentRequest rawRequest) {
    FlowPath path = Objects.requireNonNull(flow.getReversePath());
    EgressFlowSegmentRequest request = verifyCommonEgressRequest(flow, path, rawRequest);
    FlowEndpoint expectedEndpoint = new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan());
    assertEquals(expectedEndpoint, request.getEndpoint());
    FlowEndpoint expectedIngressEndpoint = new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan());
    assertEquals(expectedIngressEndpoint, request.getIngressEndpoint());
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) FlowPath(org.openkilda.model.FlowPath) EgressFlowSegmentRequest(org.openkilda.floodlight.api.request.EgressFlowSegmentRequest)

Example 2 with EgressFlowSegmentRequest

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

the class SpeakerFlowSegmentRequestBuilderTest method verifyCommonEgressRequest.

private EgressFlowSegmentRequest verifyCommonEgressRequest(Flow flow, FlowPath path, FlowSegmentRequest rawRequest) {
    assertThat("Should be egress segment request", rawRequest, instanceOf(EgressFlowSegmentRequest.class));
    EgressFlowSegmentRequest request = (EgressFlowSegmentRequest) rawRequest;
    assertEquals(flow.getFlowId(), request.getFlowId());
    assertEquals(path.getDestSwitchId(), request.getSwitchId());
    assertEquals(path.getCookie(), request.getCookie());
    assertEquals(path.getSegments().get(path.getSegments().size() - 1).getDestPort(), (int) request.getIslPort());
    verifyVlanEncapsulation(flow, path, request.getEncapsulation());
    return request;
}
Also used : EgressFlowSegmentRequest(org.openkilda.floodlight.api.request.EgressFlowSegmentRequest)

Example 3 with EgressFlowSegmentRequest

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

the class SpeakerFlowSegmentRequestBuilderTest method verifyForwardEgressRequest.

private void verifyForwardEgressRequest(Flow flow, FlowSegmentRequest rawRequest) {
    FlowPath path = Objects.requireNonNull(flow.getForwardPath());
    EgressFlowSegmentRequest request = verifyCommonEgressRequest(flow, path, rawRequest);
    FlowEndpoint expectedEndpoint = new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan());
    assertEquals(expectedEndpoint, request.getEndpoint());
    FlowEndpoint expectedIngressEndpoint = new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan());
    assertEquals(expectedIngressEndpoint, request.getIngressEndpoint());
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) FlowPath(org.openkilda.model.FlowPath) EgressFlowSegmentRequest(org.openkilda.floodlight.api.request.EgressFlowSegmentRequest)

Aggregations

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