use of org.openkilda.rulemanager.action.Action in project open-kilda by telstra.
the class MultiTableServer42IngressRuleGeneratorTest method buildTransformActionsVlanEncapsulationDoubleVlanTest.
@Test
public void buildTransformActionsVlanEncapsulationDoubleVlanTest() {
Flow flow = buildFlow(PATH, OUTER_VLAN_ID_1, INNER_VLAN_ID_1);
MultiTableServer42IngressRuleGenerator generator = buildGenerator(PATH, flow, VLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildTransformActions(INNER_VLAN_ID_1, FEATURES);
List<Action> expectedActions = newArrayList(SetFieldAction.builder().field(Field.ETH_SRC).value(SWITCH_ID_1.toMacAddressAsLong()).build(), SetFieldAction.builder().field(Field.ETH_DST).value(SWITCH_ID_2.toMacAddressAsLong()).build(), SetFieldAction.builder().field(Field.VLAN_VID).value(TRANSIT_VLAN_ID).build());
assertEquals(expectedActions, transformActions);
}
use of org.openkilda.rulemanager.action.Action in project open-kilda by telstra.
the class SingleTableIngressYRuleGeneratorTest method buildTransformActionsVlanEncapsulationOuterVlanEqualTransitVlanTest.
@Test
public void buildTransformActionsVlanEncapsulationOuterVlanEqualTransitVlanTest() {
Flow flow = buildFlow(PATH, TRANSIT_VLAN_ID, 0);
SingleTableIngressYRuleGenerator generator = buildGenerator(PATH, flow, VLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildTransformActions(TRANSIT_VLAN_ID, FEATURES);
assertTrue(transformActions.isEmpty());
}
use of org.openkilda.rulemanager.action.Action in project open-kilda by telstra.
the class SingleTableIngressYRuleGeneratorTest method buildTransformActionsOneSwitchSingleVlanInFullPortOutTest.
@Test
public void buildTransformActionsOneSwitchSingleVlanInFullPortOutTest() {
Flow flow = buildFlow(ONE_SWITCH_PATH, OUTER_VLAN_ID_1, 0);
SingleTableIngressYRuleGenerator generator = buildGenerator(ONE_SWITCH_PATH, flow, VLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildTransformActions(OUTER_VLAN_ID_1, FEATURES);
List<Action> expectedActions = newArrayList(new PopVlanAction());
assertEquals(expectedActions, transformActions);
}
use of org.openkilda.rulemanager.action.Action in project open-kilda by telstra.
the class SingleTableIngressYRuleGeneratorTest method buildTransformActionsOneSwitchFullPortInFullPortOutTest.
@Test
public void buildTransformActionsOneSwitchFullPortInFullPortOutTest() {
Flow flow = buildFlow(ONE_SWITCH_PATH, 0, 0);
SingleTableIngressYRuleGenerator generator = buildGenerator(ONE_SWITCH_PATH, flow, VLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildTransformActions(0, FEATURES);
List<Action> expectedActions = newArrayList();
assertEquals(expectedActions, transformActions);
}
use of org.openkilda.rulemanager.action.Action in project open-kilda by telstra.
the class SingleTableIngressYRuleGeneratorTest method buildTransformActionsOneSwitchSingleVlanInSingleVlanOutTest.
@Test
public void buildTransformActionsOneSwitchSingleVlanInSingleVlanOutTest() {
Flow flow = buildFlow(ONE_SWITCH_PATH, OUTER_VLAN_ID_1, OUTER_VLAN_ID_2);
SingleTableIngressYRuleGenerator generator = buildGenerator(ONE_SWITCH_PATH, flow, VLAN_ENCAPSULATION);
List<Action> transformActions = generator.buildTransformActions(OUTER_VLAN_ID_1, FEATURES);
List<Action> expectedActions = newArrayList(SetFieldAction.builder().field(Field.VLAN_VID).value(OUTER_VLAN_ID_2).build());
assertEquals(expectedActions, transformActions);
}
Aggregations