use of org.openkilda.rulemanager.factory.generator.service.BfdCatchRuleGenerator in project open-kilda by telstra.
the class RuleManagerServiceRulesTest method shouldUseCorrectServiceRuleGeneratorsForSwitchInSingleTableMode.
@Test
public void shouldUseCorrectServiceRuleGeneratorsForSwitchInSingleTableMode() {
Switch sw = buildSwitch("OF_13", Collections.emptySet());
SwitchId switchId = sw.getSwitchId();
SwitchProperties switchProperties = buildSwitchProperties(sw, false);
List<RuleGenerator> generators = ruleManager.getServiceRuleGenerators(switchId, buildAdapter(switchId, switchProperties, new HashSet<>(), false));
assertEquals(7, generators.size());
assertTrue(generators.stream().anyMatch(g -> g instanceof TableDefaultRuleGenerator));
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));
}
use of org.openkilda.rulemanager.factory.generator.service.BfdCatchRuleGenerator 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