Search in sources :

Example 66 with FlowEndpoint

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

the class MultiTableServer42IngressRuleGeneratorTest method outerVlanOverlappingFlowTest.

@Test
public void outerVlanOverlappingFlowTest() {
    Flow overlappingFlow = buildOverlappingFlow(PORT_NUMBER_2, 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));
    assertTrue(generator.needToBuildServer42InputRule(ingressEndpoint));
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 67 with FlowEndpoint

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

the class InputLldpRuleGeneratorTest method buildLldpRuleWithOverlappedEndpointsTest.

@Test
public void buildLldpRuleWithOverlappedEndpointsTest() {
    FlowEndpoint endpoint = new FlowEndpoint(SW.getSwitchId(), PORT_NUMBER_1, 0, 0, true, false);
    FlowSideAdapter adapter = new FlowSourceAdapter(Flow.builder().flowId("some").srcSwitch(SW).destSwitch(buildSwitch("OF_13", Collections.emptySet())).detectConnectedDevices(DetectConnectedDevices.builder().srcLldp(true).srcSwitchLldp(true).build()).build());
    InputLldpRuleGenerator generator = InputLldpRuleGenerator.builder().ingressEndpoint(endpoint).multiTable(true).overlappingIngressAdapters(Sets.newHashSet(adapter)).build();
    assertEquals(0, generator.generateCommands(SW).size());
}
Also used : FlowSourceAdapter(org.openkilda.adapter.FlowSourceAdapter) FlowEndpoint(org.openkilda.model.FlowEndpoint) FlowSideAdapter(org.openkilda.adapter.FlowSideAdapter) Test(org.junit.Test)

Example 68 with FlowEndpoint

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

the class InputLldpRuleGeneratorTest method buildLldpRuleForSingleTableTest.

@Test
public void buildLldpRuleForSingleTableTest() {
    FlowEndpoint endpoint = new FlowEndpoint(SW.getSwitchId(), PORT_NUMBER_1, 0, 0, true, false);
    InputLldpRuleGenerator generator = InputLldpRuleGenerator.builder().ingressEndpoint(endpoint).multiTable(false).overlappingIngressAdapters(new HashSet<>()).build();
    assertEquals(0, generator.generateCommands(SW).size());
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 69 with FlowEndpoint

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

the class InputArpRuleGeneratorTest method buildArpRuleWithOverlappedEndpointsTest.

@Test
public void buildArpRuleWithOverlappedEndpointsTest() {
    FlowEndpoint endpoint = new FlowEndpoint(SW.getSwitchId(), PORT_NUMBER_1, 0, 0, true, false);
    FlowSideAdapter adapter = new FlowSourceAdapter(Flow.builder().flowId("some").srcSwitch(SW).destSwitch(buildSwitch("OF_13", Collections.emptySet())).detectConnectedDevices(DetectConnectedDevices.builder().srcArp(true).srcSwitchArp(true).build()).build());
    InputArpRuleGenerator generator = InputArpRuleGenerator.builder().ingressEndpoint(endpoint).multiTable(true).overlappingIngressAdapters(Sets.newHashSet(adapter)).build();
    assertEquals(0, generator.generateCommands(SW).size());
}
Also used : FlowSourceAdapter(org.openkilda.adapter.FlowSourceAdapter) FlowEndpoint(org.openkilda.model.FlowEndpoint) FlowSideAdapter(org.openkilda.adapter.FlowSideAdapter) Test(org.junit.Test)

Example 70 with FlowEndpoint

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

the class MultiTableServer42IngressRuleGeneratorTest method fullPortOverlappingFlowTest.

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

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