use of org.openkilda.rulemanager.factory.generator.service.lldp.LldpPostIngressRuleGenerator in project open-kilda by telstra.
the class RuleManagerServiceRulesTest method shouldUseCorrectServiceRuleGeneratorsForSwitchInMultiTableModeWithSwitchArpAndLldp.
@Test
public void shouldUseCorrectServiceRuleGeneratorsForSwitchInMultiTableModeWithSwitchArpAndLldp() {
Switch sw = buildSwitch("OF_13", Collections.emptySet());
SwitchId switchId = sw.getSwitchId();
SwitchProperties switchProperties = buildSwitchProperties(sw, true, true, true);
List<RuleGenerator> generators = ruleManager.getServiceRuleGenerators(switchId, buildAdapter(switchId, switchProperties, new HashSet<>(), false));
assertEquals(24, generators.size());
assertTrue(generators.stream().anyMatch(g -> g instanceof BroadCastDiscoveryRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof UniCastDiscoveryRuleGenerator));
assertEquals(4, generators.stream().filter(g -> g instanceof TableDefaultRuleGenerator).count());
assertEquals(2, generators.stream().filter(g -> g instanceof TablePassThroughDefaultRuleGenerator).count());
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressVxlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressOneSwitchRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressVxlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressOneSwitchRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpTransitRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpInputPreDropRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpTransitRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpInputPreDropRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpIngressRuleGenerator));
}
use of org.openkilda.rulemanager.factory.generator.service.lldp.LldpPostIngressRuleGenerator in project open-kilda by telstra.
the class RuleManagerServiceRulesTest method shouldUseCorrectServiceRuleGeneratorsForSwitchInMultiTableModeWithAllRules.
@Test
public void shouldUseCorrectServiceRuleGeneratorsForSwitchInMultiTableModeWithAllRules() {
Switch sw = buildSwitch("OF_13", Collections.emptySet());
SwitchId switchId = sw.getSwitchId();
SwitchProperties switchProperties = buildSwitchProperties(sw, true, true, true, true, RttState.ENABLED);
List<RuleGenerator> generators = ruleManager.getServiceRuleGenerators(switchId, buildAdapter(switchId, switchProperties, Sets.newHashSet(ISL_PORT), true));
assertEquals(34, generators.size());
assertTrue(generators.stream().anyMatch(g -> g instanceof BroadCastDiscoveryRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof UniCastDiscoveryRuleGenerator));
assertEquals(4, generators.stream().filter(g -> g instanceof TableDefaultRuleGenerator).count());
assertEquals(2, generators.stream().filter(g -> g instanceof TablePassThroughDefaultRuleGenerator).count());
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressVxlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressOneSwitchRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressVxlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressOneSwitchRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpTransitRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpInputPreDropRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpTransitRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpInputPreDropRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof Server42FlowRttTurningRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof Server42FlowRttVxlanTurningRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof Server42FlowRttOutputVlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof Server42FlowRttOutputVxlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof Server42IslRttInputRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof Server42IslRttTurningRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof Server42IslRttOutputRuleGenerator));
}
use of org.openkilda.rulemanager.factory.generator.service.lldp.LldpPostIngressRuleGenerator in project open-kilda by telstra.
the class RuleManagerServiceRulesTest method shouldUseCorrectServiceRuleGeneratorsForSwitchInMultiTableMode.
@Test
public void shouldUseCorrectServiceRuleGeneratorsForSwitchInMultiTableMode() {
Switch sw = buildSwitch("OF_13", Collections.emptySet());
SwitchId switchId = sw.getSwitchId();
SwitchProperties switchProperties = buildSwitchProperties(sw, true);
List<RuleGenerator> generators = ruleManager.getServiceRuleGenerators(switchId, buildAdapter(switchId, switchProperties, new HashSet<>(), false));
assertEquals(18, generators.size());
assertTrue(generators.stream().anyMatch(g -> g instanceof BroadCastDiscoveryRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof UniCastDiscoveryRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof DropDiscoveryLoopRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof BfdCatchRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof RoundTripLatencyRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof UnicastVerificationVxlanRuleGenerator));
assertEquals(4, generators.stream().filter(g -> g instanceof TableDefaultRuleGenerator).count());
assertEquals(2, generators.stream().filter(g -> g instanceof TablePassThroughDefaultRuleGenerator).count());
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressVxlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof LldpPostIngressOneSwitchRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressVxlanRuleGenerator));
assertTrue(generators.stream().anyMatch(g -> g instanceof ArpPostIngressOneSwitchRuleGenerator));
}
Aggregations