Search in sources :

Example 36 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressCommandRemoveTest method processZeroVlanMultiTable.

protected void processZeroVlanMultiTable(IngressFlowSegmentBase command) throws Exception {
    expectMakeDefaultPortForwardMessage(command, new EffectiveIds(meterConfig.getId(), null));
    executeCommand(command, 1);
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds)

Example 37 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressFlowLoopSegmentInstallCommandTest method ingressFlowLoopDefaultTagSingleTableTest.

@Test
public void ingressFlowLoopDefaultTagSingleTableTest() throws Exception {
    IngressFlowLoopSegmentInstallCommand command = createCommand(0, 0, false);
    OFFlowMod mod = assertModCountAndReturnMod(command.makeFlowModMessages(new EffectiveIds()));
    assertCommon(mod, INPUT_TABLE_ID);
    assertEquals(1, stream(mod.getMatch().getMatchFields().spliterator(), false).count());
    List<OFAction> applyActions = ((OFInstructionApplyActions) mod.getInstructions().get(0)).getActions();
    assertEquals(1, applyActions.size());
    assertOutputAction(applyActions.get(0));
}
Also used : OFInstructionApplyActions(org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) OFAction(org.projectfloodlight.openflow.protocol.action.OFAction) OFFlowMod(org.projectfloodlight.openflow.protocol.OFFlowMod) Test(org.junit.Test)

Example 38 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressFlowLoopSegmentInstallCommandTest method ingressFlowLoopSigleTagMultiTableTest.

@Test
public void ingressFlowLoopSigleTagMultiTableTest() throws Exception {
    IngressFlowLoopSegmentInstallCommand command = createCommand(VLAN_1, 0, true);
    OFFlowMod mod = assertModCountAndReturnMod(command.makeFlowModMessages(new EffectiveIds()));
    assertCommon(mod, INGRESS_TABLE_ID);
    assertEquals(2, stream(mod.getMatch().getMatchFields().spliterator(), false).count());
    assertNull(mod.getMatch().get(MatchField.VLAN_VID));
    assertMetadata(mod.getMatch(), VLAN_1);
    List<OFAction> applyActions = ((OFInstructionApplyActions) mod.getInstructions().get(0)).getActions();
    assertEquals(3, applyActions.size());
    assertPushVlanAction(applyActions.get(0));
    assertSetField(applyActions.get(1), OFOxmVlanVid.class, OFVlanVidMatch.ofVlan(VLAN_1));
    assertOutputAction(applyActions.get(2));
}
Also used : OFInstructionApplyActions(org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) OFAction(org.projectfloodlight.openflow.protocol.action.OFAction) OFFlowMod(org.projectfloodlight.openflow.protocol.OFFlowMod) Test(org.junit.Test)

Example 39 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressFlowLoopSegmentInstallCommandTest method ingressFlowLoopDefaultTagMultiTableTest.

@Test
public void ingressFlowLoopDefaultTagMultiTableTest() throws Exception {
    IngressFlowLoopSegmentInstallCommand command = createCommand(0, 0, true);
    OFFlowMod mod = assertModCountAndReturnMod(command.makeFlowModMessages(new EffectiveIds()));
    assertCommon(mod, INGRESS_TABLE_ID);
    assertEquals(1, stream(mod.getMatch().getMatchFields().spliterator(), false).count());
    List<OFAction> applyActions = ((OFInstructionApplyActions) mod.getInstructions().get(0)).getActions();
    assertEquals(1, applyActions.size());
    assertOutputAction(applyActions.get(0));
}
Also used : OFInstructionApplyActions(org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) OFAction(org.projectfloodlight.openflow.protocol.action.OFAction) OFFlowMod(org.projectfloodlight.openflow.protocol.OFFlowMod) Test(org.junit.Test)

Example 40 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressCommandInstallTest method processDoubleVlanMultiTable.

void processDoubleVlanMultiTable(IngressFlowSegmentBase command) throws Exception {
    expectMakeDoubleVlanForwardMessage(command, new EffectiveIds(meterConfig.getId(), null));
    expectMakeCustomerPortSharedCatchInstallMessage(command);
    expectMakeOuterVlanMatchSharedMessage(command);
    executeCommand(command, 3);
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds)

Aggregations

EffectiveIds (org.openkilda.floodlight.model.EffectiveIds)45 Test (org.junit.Test)24 OFAction (org.projectfloodlight.openflow.protocol.action.OFAction)21 OFFlowMod (org.projectfloodlight.openflow.protocol.OFFlowMod)15 OFInstructionApplyActions (org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions)15 OFFlowAdd (org.projectfloodlight.openflow.protocol.OFFlowAdd)12 FlowEndpoint (org.openkilda.model.FlowEndpoint)9 IngressFlowSegmentInstallCommand (org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand)8 RoutingMetadata (org.openkilda.floodlight.utils.metadata.RoutingMetadata)6 FlowSegmentReport (org.openkilda.floodlight.command.flow.FlowSegmentReport)5 SwitchErrorResponseException (org.openkilda.floodlight.error.SwitchErrorResponseException)3 OneSwitchFlowInstallCommand (org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand)2 UnsupportedSwitchOperationException (org.openkilda.floodlight.error.UnsupportedSwitchOperationException)2