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