Search in sources :

Example 6 with GroupSpeakerData

use of org.openkilda.rulemanager.GroupSpeakerData in project open-kilda by telstra.

the class EgressMirrorRuleGeneratorTest method buildVxlanSingleTableFullPortEgressMirrorRuleTest.

@Test
public void buildVxlanSingleTableFullPortEgressMirrorRuleTest() {
    FlowPath path = buildPathWithMirror(false);
    Flow flow = buildFlow(path, 0, 0);
    EgressMirrorRuleGenerator generator = buildGenerator(path, flow, VXLAN_ENCAPSULATION);
    List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
    assertEquals(2, commands.size());
    FlowSpeakerData egressCommand = getCommand(FlowSpeakerData.class, commands);
    GroupSpeakerData groupCommand = getCommand(GroupSpeakerData.class, commands);
    ArrayList<Action> expectedApplyActions = Lists.newArrayList(new PopVxlanAction(ActionType.POP_VXLAN_NOVIFLOW), new GroupAction(GROUP_ID));
    assertEgressCommand(egressCommand, OfTable.INPUT, VXLAN_ENCAPSULATION, expectedApplyActions, groupCommand.getUuid());
    assertGroupCommand(groupCommand);
}
Also used : GroupAction(org.openkilda.rulemanager.action.GroupAction) GroupAction(org.openkilda.rulemanager.action.GroupAction) SetFieldAction(org.openkilda.rulemanager.action.SetFieldAction) Action(org.openkilda.rulemanager.action.Action) PopVxlanAction(org.openkilda.rulemanager.action.PopVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) PopVxlanAction(org.openkilda.rulemanager.action.PopVxlanAction) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) FlowPath(org.openkilda.model.FlowPath) SpeakerData(org.openkilda.rulemanager.SpeakerData) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 7 with GroupSpeakerData

use of org.openkilda.rulemanager.GroupSpeakerData in project open-kilda by telstra.

the class EgressMirrorRuleGeneratorTest method buildVlanMultiTableOuterVlanEqualsTransitEgressMirrorRuleTest.

@Test
public void buildVlanMultiTableOuterVlanEqualsTransitEgressMirrorRuleTest() {
    FlowPath path = buildPathWithMirror(true);
    Flow flow = buildFlow(path, VLAN_ENCAPSULATION.getId(), 0);
    EgressMirrorRuleGenerator generator = buildGenerator(path, flow, VLAN_ENCAPSULATION);
    List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
    assertEquals(2, commands.size());
    FlowSpeakerData egressCommand = getCommand(FlowSpeakerData.class, commands);
    GroupSpeakerData groupCommand = getCommand(GroupSpeakerData.class, commands);
    ArrayList<Action> expectedApplyActions = Lists.newArrayList(new GroupAction(GROUP_ID));
    assertEgressCommand(egressCommand, OfTable.EGRESS, VLAN_ENCAPSULATION, expectedApplyActions, groupCommand.getUuid());
    assertGroupCommand(groupCommand);
}
Also used : GroupAction(org.openkilda.rulemanager.action.GroupAction) GroupAction(org.openkilda.rulemanager.action.GroupAction) SetFieldAction(org.openkilda.rulemanager.action.SetFieldAction) Action(org.openkilda.rulemanager.action.Action) PopVxlanAction(org.openkilda.rulemanager.action.PopVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) FlowPath(org.openkilda.model.FlowPath) SpeakerData(org.openkilda.rulemanager.SpeakerData) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 8 with GroupSpeakerData

use of org.openkilda.rulemanager.GroupSpeakerData in project open-kilda by telstra.

the class EgressMirrorRuleGeneratorTest method buildVlanSingleTableOuterVlanEgressMirrorRuleTest.

@Test
public void buildVlanSingleTableOuterVlanEgressMirrorRuleTest() {
    FlowPath path = buildPathWithMirror(false);
    Flow flow = buildFlow(path, OUTER_VLAN_ID, 0);
    EgressMirrorRuleGenerator generator = buildGenerator(path, flow, VLAN_ENCAPSULATION);
    List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
    assertEquals(2, commands.size());
    FlowSpeakerData egressCommand = getCommand(FlowSpeakerData.class, commands);
    GroupSpeakerData groupCommand = getCommand(GroupSpeakerData.class, commands);
    ArrayList<Action> expectedApplyActions = Lists.newArrayList(SetFieldAction.builder().field(Field.VLAN_VID).value(OUTER_VLAN_ID).build(), new GroupAction(GROUP_ID));
    assertEgressCommand(egressCommand, OfTable.INPUT, VLAN_ENCAPSULATION, expectedApplyActions, groupCommand.getUuid());
    assertGroupCommand(groupCommand);
}
Also used : GroupAction(org.openkilda.rulemanager.action.GroupAction) GroupAction(org.openkilda.rulemanager.action.GroupAction) SetFieldAction(org.openkilda.rulemanager.action.SetFieldAction) Action(org.openkilda.rulemanager.action.Action) PopVxlanAction(org.openkilda.rulemanager.action.PopVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) FlowPath(org.openkilda.model.FlowPath) SpeakerData(org.openkilda.rulemanager.SpeakerData) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 9 with GroupSpeakerData

use of org.openkilda.rulemanager.GroupSpeakerData in project open-kilda by telstra.

the class EgressMirrorRuleGeneratorTest method buildVlanMultiTableFullPortEgressMirrorRuleTest.

@Test
public void buildVlanMultiTableFullPortEgressMirrorRuleTest() {
    FlowPath path = buildPathWithMirror(true);
    Flow flow = buildFlow(path, 0, 0);
    EgressMirrorRuleGenerator generator = buildGenerator(path, flow, VLAN_ENCAPSULATION);
    List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
    assertEquals(2, commands.size());
    FlowSpeakerData egressCommand = getCommand(FlowSpeakerData.class, commands);
    GroupSpeakerData groupCommand = getCommand(GroupSpeakerData.class, commands);
    ArrayList<Action> expectedApplyActions = Lists.newArrayList(new PopVlanAction(), new GroupAction(GROUP_ID));
    assertEgressCommand(egressCommand, OfTable.EGRESS, VLAN_ENCAPSULATION, expectedApplyActions, groupCommand.getUuid());
    assertGroupCommand(groupCommand);
}
Also used : GroupAction(org.openkilda.rulemanager.action.GroupAction) GroupAction(org.openkilda.rulemanager.action.GroupAction) SetFieldAction(org.openkilda.rulemanager.action.SetFieldAction) Action(org.openkilda.rulemanager.action.Action) PopVxlanAction(org.openkilda.rulemanager.action.PopVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) FlowPath(org.openkilda.model.FlowPath) SpeakerData(org.openkilda.rulemanager.SpeakerData) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) Flow(org.openkilda.model.Flow) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) Test(org.junit.Test)

Example 10 with GroupSpeakerData

use of org.openkilda.rulemanager.GroupSpeakerData in project open-kilda by telstra.

the class EgressMirrorRuleGeneratorTest method buildVlanSingleTableOuterVlanEqualsTransitVlanEgressMirrorRuleTest.

@Test
public void buildVlanSingleTableOuterVlanEqualsTransitVlanEgressMirrorRuleTest() {
    FlowPath path = buildPathWithMirror(false);
    Flow flow = buildFlow(path, VLAN_ENCAPSULATION.getId(), 0);
    EgressMirrorRuleGenerator generator = buildGenerator(path, flow, VLAN_ENCAPSULATION);
    List<SpeakerData> commands = generator.generateCommands(SWITCH_2);
    assertEquals(2, commands.size());
    FlowSpeakerData egressCommand = getCommand(FlowSpeakerData.class, commands);
    GroupSpeakerData groupCommand = getCommand(GroupSpeakerData.class, commands);
    ArrayList<Action> expectedApplyActions = Lists.newArrayList(new GroupAction(GROUP_ID));
    assertEgressCommand(egressCommand, OfTable.INPUT, VLAN_ENCAPSULATION, expectedApplyActions, groupCommand.getUuid());
    assertGroupCommand(groupCommand);
}
Also used : GroupAction(org.openkilda.rulemanager.action.GroupAction) GroupAction(org.openkilda.rulemanager.action.GroupAction) SetFieldAction(org.openkilda.rulemanager.action.SetFieldAction) Action(org.openkilda.rulemanager.action.Action) PopVxlanAction(org.openkilda.rulemanager.action.PopVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) FlowPath(org.openkilda.model.FlowPath) SpeakerData(org.openkilda.rulemanager.SpeakerData) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Aggregations

GroupSpeakerData (org.openkilda.rulemanager.GroupSpeakerData)32 Test (org.junit.Test)28 FlowSpeakerData (org.openkilda.rulemanager.FlowSpeakerData)25 SpeakerData (org.openkilda.rulemanager.SpeakerData)24 PortOutAction (org.openkilda.rulemanager.action.PortOutAction)23 Action (org.openkilda.rulemanager.action.Action)20 GroupAction (org.openkilda.rulemanager.action.GroupAction)20 SetFieldAction (org.openkilda.rulemanager.action.SetFieldAction)20 Flow (org.openkilda.model.Flow)17 PopVlanAction (org.openkilda.rulemanager.action.PopVlanAction)17 PushVlanAction (org.openkilda.rulemanager.action.PushVlanAction)17 FlowPath (org.openkilda.model.FlowPath)14 PopVxlanAction (org.openkilda.rulemanager.action.PopVxlanAction)13 FieldMatch (org.openkilda.rulemanager.match.FieldMatch)9 PortNumber (org.openkilda.rulemanager.ProtoConstants.PortNumber)8 MeterSpeakerData (org.openkilda.rulemanager.MeterSpeakerData)6 ArrayList (java.util.ArrayList)5 PushVxlanAction (org.openkilda.rulemanager.action.PushVxlanAction)4 GroupId (org.openkilda.model.GroupId)3 Instructions (org.openkilda.rulemanager.Instructions)3