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());
}
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;
}
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());
}
Aggregations