use of org.openkilda.rulemanager.action.PushVlanAction in project open-kilda by telstra.
the class EgressRuleGeneratorTest method buildVxlanMultiTableOuterVlanEgressRuleTest.
@Test
public void buildVxlanMultiTableOuterVlanEgressRuleTest() {
FlowPath path = buildPath(true);
Flow flow = buildFlow(path, OUTER_VLAN_ID, 0);
EgressRuleGenerator generator = buildGenerator(path, flow, VXLAN_ENCAPSULATION);
List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
ArrayList<Action> expectedApplyActions = Lists.newArrayList(new PopVxlanAction(ActionType.POP_VXLAN_NOVIFLOW), new PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(OUTER_VLAN_ID).build(), new PortOutAction(new PortNumber(PORT_NUMBER_4)));
assertEgressCommands(commands, OfTable.EGRESS, VXLAN_ENCAPSULATION, expectedApplyActions);
}
use of org.openkilda.rulemanager.action.PushVlanAction in project open-kilda by telstra.
the class EgressRuleGeneratorTest method buildVxlanMultiTableOuterInnerVlanEgressRuleTest.
@Test
public void buildVxlanMultiTableOuterInnerVlanEgressRuleTest() {
FlowPath path = buildPath(true);
Flow flow = buildFlow(path, OUTER_VLAN_ID, INNER_VLAN_ID);
EgressRuleGenerator generator = buildGenerator(path, flow, VXLAN_ENCAPSULATION);
List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
ArrayList<Action> expectedApplyActions = Lists.newArrayList(new PopVxlanAction(ActionType.POP_VXLAN_NOVIFLOW), new PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(INNER_VLAN_ID).build(), new PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(OUTER_VLAN_ID).build(), new PortOutAction(new PortNumber(PORT_NUMBER_4)));
assertEgressCommands(commands, OfTable.EGRESS, VXLAN_ENCAPSULATION, expectedApplyActions);
}
use of org.openkilda.rulemanager.action.PushVlanAction in project open-kilda by telstra.
the class EgressRuleGeneratorTest method buildVlanMultiTableOuterInnerVlanEgressRuleTest.
@Test
public void buildVlanMultiTableOuterInnerVlanEgressRuleTest() {
FlowPath path = buildPath(true);
Flow flow = buildFlow(path, OUTER_VLAN_ID, INNER_VLAN_ID);
EgressRuleGenerator generator = buildGenerator(path, flow, VLAN_ENCAPSULATION);
List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
ArrayList<Action> expectedApplyActions = Lists.newArrayList(SetFieldAction.builder().field(Field.VLAN_VID).value(INNER_VLAN_ID).build(), new PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(OUTER_VLAN_ID).build(), new PortOutAction(new PortNumber(PORT_NUMBER_4)));
assertEgressCommands(commands, OfTable.EGRESS, VLAN_ENCAPSULATION, expectedApplyActions);
}
use of org.openkilda.rulemanager.action.PushVlanAction in project open-kilda by telstra.
the class IngressMirrorRuleGeneratorTest method buildIngressActionsOneSwitchFullPortInDoubleVlanOutTest.
@Test
public void buildIngressActionsOneSwitchFullPortInDoubleVlanOutTest() {
Flow flow = buildFlow(MULTI_TABLE_ONE_SWITCH_PATH, 0, 0, OUTER_VLAN_ID_2, INNER_VLAN_ID_2);
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 PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(INNER_VLAN_ID_2).build(), new PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(OUTER_VLAN_ID_2).build(), new GroupAction(GROUP_ID));
assertEquals(expectedActions, transformActions);
}
use of org.openkilda.rulemanager.action.PushVlanAction in project open-kilda by telstra.
the class IngressMirrorRuleGeneratorTest method buildIngressActionsOneSwitchSingleVlanInDoubleVlanOutTest.
@Test
public void buildIngressActionsOneSwitchSingleVlanInDoubleVlanOutTest() {
Flow flow = buildFlow(MULTI_TABLE_ONE_SWITCH_PATH, OUTER_VLAN_ID_1, 0, OUTER_VLAN_ID_2, INNER_VLAN_ID_2);
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 PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(INNER_VLAN_ID_2).build(), new PushVlanAction(), SetFieldAction.builder().field(Field.VLAN_VID).value(OUTER_VLAN_ID_2).build(), new GroupAction(GROUP_ID));
assertEquals(expectedActions, transformActions);
}
Aggregations