Search in sources :

Example 71 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class MultiTableServer42IngressRuleGeneratorTest method inPortOverlappingFlowTest.

@Test
public void inPortOverlappingFlowTest() {
    Flow overlappingFlow = buildOverlappingFlow(PORT_NUMBER_1, OUTER_VLAN_ID_2, INNER_VLAN_ID_1);
    MultiTableServer42IngressRuleGenerator generator = buildGenerator(overlappingFlow);
    FlowEndpoint ingressEndpoint = new FlowEndpoint(SWITCH_ID_1, PORT_NUMBER_1, OUTER_VLAN_ID_1, INNER_VLAN_ID_1);
    assertTrue(generator.needToBuildServer42PreIngressRule(ingressEndpoint));
    assertFalse(generator.needToBuildServer42InputRule(ingressEndpoint));
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 72 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class MultiTableServer42IngressRuleGeneratorTest method overlappingOfFullFlowTest.

@Test
public void overlappingOfFullFlowTest() {
    Flow overlappingFlow = buildOverlappingFlow(PORT_NUMBER_1, OUTER_VLAN_ID_1, INNER_VLAN_ID_1);
    MultiTableServer42IngressRuleGenerator generator = buildGenerator(overlappingFlow);
    FlowEndpoint ingressEndpoint = new FlowEndpoint(SWITCH_ID_1, PORT_NUMBER_1, 0, 0);
    assertFalse(generator.needToBuildServer42PreIngressRule(ingressEndpoint));
    assertFalse(generator.needToBuildServer42InputRule(ingressEndpoint));
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 73 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class MultiTableServer42IngressRuleGeneratorTest method outerVlanInPortOverlappingFlowTest.

@Test
public void outerVlanInPortOverlappingFlowTest() {
    Flow overlappingFlow = buildOverlappingFlow(PORT_NUMBER_1, OUTER_VLAN_ID_1, INNER_VLAN_ID_1);
    MultiTableServer42IngressRuleGenerator generator = buildGenerator(overlappingFlow);
    FlowEndpoint ingressEndpoint = new FlowEndpoint(SWITCH_ID_1, PORT_NUMBER_1, OUTER_VLAN_ID_1, INNER_VLAN_ID_1);
    assertFalse(generator.needToBuildServer42PreIngressRule(ingressEndpoint));
    assertFalse(generator.needToBuildServer42InputRule(ingressEndpoint));
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 74 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class SpeakerFlowSegmentRequestBuilderTest method verifyReverseIngressRequest.

private IngressFlowSegmentRequest verifyReverseIngressRequest(Flow flow, FlowSegmentRequest rawRequest) {
    FlowPath path = Objects.requireNonNull(flow.getReversePath());
    IngressFlowSegmentRequest request = verifyCommonIngressRequest(flow, path, rawRequest);
    assertEquals(flow.getDestSwitchId(), request.getSwitchId());
    FlowEndpoint endpoint = new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan());
    assertEquals(endpoint, request.getEndpoint());
    return request;
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) IngressFlowSegmentRequest(org.openkilda.floodlight.api.request.IngressFlowSegmentRequest) FlowPath(org.openkilda.model.FlowPath)

Example 75 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint 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

FlowEndpoint (org.openkilda.model.FlowEndpoint)105 Test (org.junit.Test)26 Flow (org.openkilda.model.Flow)22 ArrayList (java.util.ArrayList)15 RoutingMetadata (org.openkilda.floodlight.utils.metadata.RoutingMetadata)12 YFlow (org.openkilda.model.YFlow)11 FlowPath (org.openkilda.model.FlowPath)10 FlowSpeakerData (org.openkilda.rulemanager.FlowSpeakerData)9 SpeakerData (org.openkilda.rulemanager.SpeakerData)9 SwitchId (org.openkilda.model.SwitchId)8 YSubFlow (org.openkilda.model.YSubFlow)8 HashSet (java.util.HashSet)7 FlowSideAdapter (org.openkilda.adapter.FlowSideAdapter)7 FlowSourceAdapter (org.openkilda.adapter.FlowSourceAdapter)7 IngressFlowSegmentInstallCommand (org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand)7 EffectiveIds (org.openkilda.floodlight.model.EffectiveIds)7 FlowSegmentWrapperCommand (org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand)6 FlowProcessingException (org.openkilda.wfm.topology.flowhs.exception.FlowProcessingException)6 OFFlowAdd (org.projectfloodlight.openflow.protocol.OFFlowAdd)6 MessageContext (org.openkilda.messaging.MessageContext)5