use of org.openkilda.rulemanager.action.GroupAction in project open-kilda by telstra.
the class IngressMirrorRuleGeneratorTest method buildIngressActionsOneSwitchSingleVlanInFullPortOutTest.
@Test
public void buildIngressActionsOneSwitchSingleVlanInFullPortOutTest() {
Flow flow = buildFlow(MULTI_TABLE_ONE_SWITCH_PATH, OUTER_VLAN_ID_1, 0, 0, 0);
IngressMirrorRuleGenerator generator = buildGenerator(MULTI_TABLE_ONE_SWITCH_PATH, flow, VLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildIngressActions(getEndpoint(flow), GROUP_ID);
List<Action> expectedActions = newArrayList(new GroupAction(GROUP_ID));
assertEquals(expectedActions, transformActions);
}
use of org.openkilda.rulemanager.action.GroupAction in project open-kilda by telstra.
the class IngressMirrorRuleGeneratorTest method buildIngressActionsOneSwitchDoubleVlanInFullPortOutTest.
@Test
public void buildIngressActionsOneSwitchDoubleVlanInFullPortOutTest() {
Flow flow = buildFlow(MULTI_TABLE_ONE_SWITCH_PATH, OUTER_VLAN_ID_1, INNER_VLAN_ID_1, 0, 0);
IngressMirrorRuleGenerator generator = buildGenerator(MULTI_TABLE_ONE_SWITCH_PATH, flow, VLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildIngressActions(getEndpoint(flow), GROUP_ID);
List<Action> expectedActions = newArrayList(new PopVlanAction(), new GroupAction(GROUP_ID));
assertEquals(expectedActions, transformActions);
}
use of org.openkilda.rulemanager.action.GroupAction in project open-kilda by telstra.
the class IngressMirrorRuleGeneratorTest method buildIngressActionsVxlanEncapsulationSingleVlanTest.
@Test
public void buildIngressActionsVxlanEncapsulationSingleVlanTest() {
Flow flow = buildFlow(MULTI_TABLE_PATH, OUTER_VLAN_ID_1, 0);
IngressMirrorRuleGenerator generator = buildGenerator(MULTI_TABLE_PATH, flow, VXLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildIngressActions(getEndpoint(flow), GROUP_ID);
List<Action> expectedActions = newArrayList(new GroupAction(GROUP_ID));
assertEquals(expectedActions, transformActions);
}
use of org.openkilda.rulemanager.action.GroupAction in project open-kilda by telstra.
the class IngressMirrorRuleGeneratorTest method buildSingleTableCommandsOneSwitchFullPortTest.
@Test
public void buildSingleTableCommandsOneSwitchFullPortTest() {
Flow flow = buildFlow(SINGLE_TABLE_ONE_SWITCH_PATH, 0, 0, 0, 0);
IngressMirrorRuleGenerator generator = buildGenerator(SINGLE_TABLE_ONE_SWITCH_PATH, flow, VXLAN_ENCAPSULATION);
List<SpeakerData> commands = generator.generateCommands(SWITCH_1);
assertEquals(2, commands.size());
FlowSpeakerData ingressCommand = getCommand(FlowSpeakerData.class, commands);
GroupSpeakerData groupCommand = getCommand(GroupSpeakerData.class, commands);
Set<FieldMatch> expectedIngressMatch = Sets.newHashSet(FieldMatch.builder().field(Field.IN_PORT).value(PORT_NUMBER_1).build());
List<Action> expectedIngressActions = newArrayList(new GroupAction(GROUP_ID));
assertIngressCommand(ingressCommand, Priority.MIRROR_DEFAULT_FLOW_PRIORITY, INPUT, expectedIngressMatch, expectedIngressActions, null, groupCommand.getUuid());
Set<Action> expectedFlowBucketActions = newHashSet(new PortOutAction(new PortNumber(PORT_NUMBER_2)));
assertGroupCommand(groupCommand, expectedFlowBucketActions);
}
use of org.openkilda.rulemanager.action.GroupAction in project open-kilda by telstra.
the class IngressMirrorRuleGeneratorTest method buildSingleTableIngressActionsVxlanEncapsulationFullPortTest.
@Test
public void buildSingleTableIngressActionsVxlanEncapsulationFullPortTest() {
Flow flow = buildFlow(SINGLE_TABLE_PATH, 0, 0);
IngressMirrorRuleGenerator generator = buildGenerator(SINGLE_TABLE_PATH, flow, VXLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildIngressActions(getEndpoint(flow), GROUP_ID);
List<Action> expectedActions = newArrayList(new GroupAction(GROUP_ID));
assertEquals(expectedActions, transformActions);
}
Aggregations