use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.
the class IngressServer42FlowInstallCommandTest method server42IngressFlowDoubleTagMultiTableVxlan.
@Test
public void server42IngressFlowDoubleTagMultiTableVxlan() throws Exception {
IngressServer42FlowInstallCommand command = createCommand(VLAN_1, VLAN_2, VXLAN_ENCAPSULATION, true);
OFFlowMod mod = assertModCountAndReturnMod(command.makeFlowModMessages(new EffectiveIds()));
assertCommonMultiTable(mod);
assertEquals(3, stream(mod.getMatch().getMatchFields().spliterator(), false).count());
assertEquals(VLAN_2, mod.getMatch().get(MatchField.VLAN_VID).getVlan());
assertMetadata(mod, VLAN_1, CUSTOMER_PORT);
List<OFAction> applyActions = ((OFInstructionApplyActions) mod.getInstructions().get(0)).getActions();
assertEquals(3, applyActions.size());
assertPopVlanAction(applyActions.get(0));
assertPushVxlanAction(applyActions.get(1));
assertOutputAction(applyActions.get(2));
}
use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.
the class IngressServer42FlowInstallCommandTest method server42IngressFlowDoubleTagMultiTableVlan.
@Test
public void server42IngressFlowDoubleTagMultiTableVlan() throws Exception {
IngressServer42FlowInstallCommand command = createCommand(VLAN_1, VLAN_2, VLAN_ENCAPSULATION, true);
OFFlowMod mod = assertModCountAndReturnMod(command.makeFlowModMessages(new EffectiveIds()));
assertCommonMultiTable(mod);
assertEquals(3, stream(mod.getMatch().getMatchFields().spliterator(), false).count());
assertEquals(VLAN_2, mod.getMatch().get(MatchField.VLAN_VID).getVlan());
assertMetadata(mod, VLAN_1, CUSTOMER_PORT);
List<OFAction> applyActions = ((OFInstructionApplyActions) mod.getInstructions().get(0)).getActions();
assertEquals(4, applyActions.size());
assertSetField(applyActions.get(0), OFOxmEthSrc.class, MacAddress.of(INGRESS_SWITCH_ID.toMacAddress()));
assertSetField(applyActions.get(1), OFOxmEthDst.class, MacAddress.of(EGRESS_SWITCH_ID.toMacAddress()));
assertSetField(applyActions.get(2), OFOxmVlanVid.class, OFVlanVidMatch.ofVlan(VLAN_ENCAPSULATION.getId()));
assertOutputAction(applyActions.get(3));
}
use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.
the class IngressServer42FlowInstallCommandTest method server42IngressFlowDefaultMultiTableVlan.
@Test
public void server42IngressFlowDefaultMultiTableVlan() throws Exception {
IngressServer42FlowInstallCommand command = createCommand(0, 0, VLAN_ENCAPSULATION, true);
OFFlowMod mod = assertModCountAndReturnMod(command.makeFlowModMessages(new EffectiveIds()));
assertCommonMultiTable(mod);
assertEquals(2, stream(mod.getMatch().getMatchFields().spliterator(), false).count());
assertNull(mod.getMatch().get(MatchField.VLAN_VID));
assertMetadata(mod, 0, CUSTOMER_PORT);
List<OFAction> applyActions = ((OFInstructionApplyActions) mod.getInstructions().get(0)).getActions();
assertEquals(5, applyActions.size());
assertSetField(applyActions.get(0), OFOxmEthSrc.class, MacAddress.of(INGRESS_SWITCH_ID.toMacAddress()));
assertSetField(applyActions.get(1), OFOxmEthDst.class, MacAddress.of(EGRESS_SWITCH_ID.toMacAddress()));
assertPushVlanAction(applyActions.get(2));
assertSetField(applyActions.get(3), OFOxmVlanVid.class, OFVlanVidMatch.ofVlan(VLAN_ENCAPSULATION.getId()));
assertOutputAction(applyActions.get(4));
}
use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.
the class IngressServer42FlowInstallCommandTest method server42IngressFlowSingleTagSingleTableVxlan.
@Test
public void server42IngressFlowSingleTagSingleTableVxlan() throws Exception {
IngressServer42FlowInstallCommand command = createCommand(VLAN_1, 0, VXLAN_ENCAPSULATION, false);
OFFlowMod mod = assertModCountAndReturnMod(command.makeFlowModMessages(new EffectiveIds()));
assertCommonSingleTable(mod);
assertEquals(6, stream(mod.getMatch().getMatchFields().spliterator(), false).count());
assertEquals(VLAN_1, mod.getMatch().get(MatchField.VLAN_VID).getVlan());
List<OFAction> applyActions = ((OFInstructionApplyActions) mod.getInstructions().get(0)).getActions();
assertEquals(3, applyActions.size());
assertPopVlanAction(applyActions.get(0));
assertPushVxlanAction(applyActions.get(1));
assertOutputAction(applyActions.get(2));
}
use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.
the class OneSwitchFlowInstallFlowModFactoryTest method testMakeDefaultPortForwardMessageMessage.
private void testMakeDefaultPortForwardMessageMessage(OneSwitchFlowInstallCommand command) {
OFFlowAdd expected = makeForwardingMessage(command, -1, of.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(command.getEndpoint().getPortNumber())).build(), getTargetIngressTableId(), Collections.emptyList());
IngressFlowModFactory factory = makeFactory(command);
verifyOfMessageEquals(expected, factory.makeDefaultPortForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
Aggregations