Search in sources :

Example 31 with GroupAction

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

the class IngressMirrorRuleGeneratorTest method buildIngressActionsOneSwitchFullPortInSingleVlanOutTest.

@Test
public void buildIngressActionsOneSwitchFullPortInSingleVlanOutTest() {
    Flow flow = buildFlow(MULTI_TABLE_ONE_SWITCH_PATH, 0, 0, OUTER_VLAN_ID_2, 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 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 32 with GroupAction

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

the class IngressMirrorRuleGeneratorTest method buildSingleTableIngressActionsOneSwitchFullPortInFullPortOutTest.

@Test
public void buildSingleTableIngressActionsOneSwitchFullPortInFullPortOutTest() {
    Flow flow = buildFlow(SINGLE_TABLE_ONE_SWITCH_PATH, 0, 0, 0, 0);
    IngressMirrorRuleGenerator generator = buildGenerator(SINGLE_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)

Example 33 with GroupAction

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

the class IngressMirrorRuleGeneratorTest method buildIngressActionsOneSwitchDoubleVlanInSingleVlanOutTest.

@Test
public void buildIngressActionsOneSwitchDoubleVlanInSingleVlanOutTest() {
    Flow flow = buildFlow(MULTI_TABLE_ONE_SWITCH_PATH, OUTER_VLAN_ID_1, INNER_VLAN_ID_1, OUTER_VLAN_ID_2, 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(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) Flow(org.openkilda.model.Flow) Test(org.junit.Test)

Example 34 with GroupAction

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

the class IngressMirrorRuleGeneratorTest method buildSingleTableIngressActionsOneSwitchFullPortInSingleVlanOutTest.

@Test
public void buildSingleTableIngressActionsOneSwitchFullPortInSingleVlanOutTest() {
    Flow flow = buildFlow(SINGLE_TABLE_ONE_SWITCH_PATH, 0, 0, OUTER_VLAN_ID_2, 0);
    IngressMirrorRuleGenerator generator = buildGenerator(SINGLE_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(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 35 with GroupAction

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

the class IngressMirrorRuleGeneratorTest method buildIngressActionsOneSwitchDoubleVlanInDoubleVlanOutTest.

@Test
public void buildIngressActionsOneSwitchDoubleVlanInDoubleVlanOutTest() {
    Flow flow = buildFlow(MULTI_TABLE_ONE_SWITCH_PATH, OUTER_VLAN_ID_1, INNER_VLAN_ID_1, 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(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)

Aggregations

GroupAction (org.openkilda.rulemanager.action.GroupAction)49 PortOutAction (org.openkilda.rulemanager.action.PortOutAction)48 Action (org.openkilda.rulemanager.action.Action)46 SetFieldAction (org.openkilda.rulemanager.action.SetFieldAction)45 PopVlanAction (org.openkilda.rulemanager.action.PopVlanAction)44 PushVlanAction (org.openkilda.rulemanager.action.PushVlanAction)44 Test (org.junit.Test)41 Flow (org.openkilda.model.Flow)41 PushVxlanAction (org.openkilda.rulemanager.action.PushVxlanAction)31 FlowSpeakerData (org.openkilda.rulemanager.FlowSpeakerData)18 GroupSpeakerData (org.openkilda.rulemanager.GroupSpeakerData)18 SpeakerData (org.openkilda.rulemanager.SpeakerData)18 PopVxlanAction (org.openkilda.rulemanager.action.PopVxlanAction)16 FlowPath (org.openkilda.model.FlowPath)13 PortNumber (org.openkilda.rulemanager.ProtoConstants.PortNumber)7 ArrayList (java.util.ArrayList)4 FieldMatch (org.openkilda.rulemanager.match.FieldMatch)4 MeterAction (org.openkilda.rulemanager.action.MeterAction)3 CopyFieldAction (org.openkilda.rulemanager.action.noviflow.CopyFieldAction)3 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)2