Search in sources :

Example 76 with Action

use of org.openkilda.rulemanager.action.Action 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);
}
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) PushVxlanAction(org.openkilda.rulemanager.action.PushVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 77 with Action

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

the class IngressMirrorRuleGeneratorTest method buildIngressActionsVxlanEncapsulationDoubleVlanTest.

@Test
public void buildIngressActionsVxlanEncapsulationDoubleVlanTest() {
    Flow flow = buildFlow(MULTI_TABLE_PATH, OUTER_VLAN_ID_1, INNER_VLAN_ID_1);
    IngressMirrorRuleGenerator generator = buildGenerator(MULTI_TABLE_PATH, flow, VXLAN_ENCAPSULATION);
    List<Action> transformActions = generator.buildIngressActions(getEndpoint(flow), GROUP_ID);
    List<Action> expectedActions = newArrayList(new PopVlanAction(), new GroupAction(GROUP_ID));
    assertEquals(expectedActions, transformActions);
}
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) PushVxlanAction(org.openkilda.rulemanager.action.PushVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) Flow(org.openkilda.model.Flow) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) Test(org.junit.Test)

Example 78 with Action

use of org.openkilda.rulemanager.action.Action 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);
}
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) PushVxlanAction(org.openkilda.rulemanager.action.PushVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 79 with Action

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

the class IngressMirrorRuleGeneratorTest method buildIngressActionsVxlanEncapsulationFullPortTest.

@Test
public void buildIngressActionsVxlanEncapsulationFullPortTest() {
    Flow flow = buildFlow(MULTI_TABLE_PATH, 0, 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);
}
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) PushVxlanAction(org.openkilda.rulemanager.action.PushVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 80 with Action

use of org.openkilda.rulemanager.action.Action 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);
}
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) PushVxlanAction(org.openkilda.rulemanager.action.PushVxlanAction) PushVlanAction(org.openkilda.rulemanager.action.PushVlanAction) PopVlanAction(org.openkilda.rulemanager.action.PopVlanAction) PortOutAction(org.openkilda.rulemanager.action.PortOutAction) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Aggregations

Action (org.openkilda.rulemanager.action.Action)196 PortOutAction (org.openkilda.rulemanager.action.PortOutAction)195 SetFieldAction (org.openkilda.rulemanager.action.SetFieldAction)168 Test (org.junit.Test)151 PushVlanAction (org.openkilda.rulemanager.action.PushVlanAction)149 PopVlanAction (org.openkilda.rulemanager.action.PopVlanAction)146 Flow (org.openkilda.model.Flow)136 PushVxlanAction (org.openkilda.rulemanager.action.PushVxlanAction)117 FlowSpeakerData (org.openkilda.rulemanager.FlowSpeakerData)67 SpeakerData (org.openkilda.rulemanager.SpeakerData)67 PortNumber (org.openkilda.rulemanager.ProtoConstants.PortNumber)59 GroupAction (org.openkilda.rulemanager.action.GroupAction)55 FieldMatch (org.openkilda.rulemanager.match.FieldMatch)47 PopVxlanAction (org.openkilda.rulemanager.action.PopVxlanAction)46 Instructions (org.openkilda.rulemanager.Instructions)34 ArrayList (java.util.ArrayList)29 FlowPath (org.openkilda.model.FlowPath)27 GroupSpeakerData (org.openkilda.rulemanager.GroupSpeakerData)23 MeterSpeakerData (org.openkilda.rulemanager.MeterSpeakerData)21 CopyFieldAction (org.openkilda.rulemanager.action.noviflow.CopyFieldAction)20