use of org.openkilda.floodlight.api.request.TransitFlowSegmentRequest in project open-kilda by telstra.
the class SpeakerFlowSegmentRequestBuilderTest method verifyCommonTransitRequest.
private TransitFlowSegmentRequest verifyCommonTransitRequest(Flow flow, FlowPath path, SwitchId datapath, FlowSegmentRequest rawRequest) {
assertThat("Should be egress segment request", rawRequest, instanceOf(TransitFlowSegmentRequest.class));
TransitFlowSegmentRequest request = (TransitFlowSegmentRequest) rawRequest;
assertEquals(flow.getFlowId(), request.getFlowId());
assertEquals(path.getCookie(), request.getCookie());
assertEquals(SWITCH_2, request.getSwitchId());
PathSegment ingress = null;
PathSegment egress = null;
for (PathSegment segment : path.getSegments()) {
if (datapath.equals(segment.getDestSwitchId())) {
ingress = segment;
} else if (datapath.equals(segment.getSrcSwitchId())) {
egress = segment;
}
}
assertNotNull(ingress);
assertNotNull(egress);
assertEquals(ingress.getDestPort(), (int) request.getIngressIslPort());
assertEquals(egress.getSrcPort(), (int) request.getEgressIslPort());
verifyVlanEncapsulation(flow, path, request.getEncapsulation());
return request;
}
Aggregations