Search in sources :

Example 41 with EffectiveIds

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

the class IngressCommandInstallTest method errorOnFlowMod.

@Test
public void errorOnFlowMod() {
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, meterConfig, makeMetadata(false));
    switchFeaturesSetup(sw, true);
    expectMeterInstall();
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds(meterConfig.getId(), null));
    expectNoMoreOfMessages();
    replayAll();
    CompletableFuture<FlowSegmentReport> result = command.execute(commandProcessor);
    getWriteRecord(0).getFuture().completeExceptionally(new SwitchErrorResponseException(dpIdNext, of.errorMsgs().buildBadRequestErrorMsg().setCode(OFBadRequestCode.BAD_LEN).build()));
    verifyErrorCompletion(result, SwitchOperationException.class);
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) SwitchErrorResponseException(org.openkilda.floodlight.error.SwitchErrorResponseException) FlowSegmentReport(org.openkilda.floodlight.command.flow.FlowSegmentReport) Test(org.junit.Test)

Example 42 with EffectiveIds

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

the class IngressCommandInstallTest method processZeroVlanMultiTable.

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

Example 43 with EffectiveIds

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

the class IngressCommandInstallTest method processOneVlanMultiTable.

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

Example 44 with EffectiveIds

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

the class IngressCommandInstallTest method processZeroVlanSingleTable.

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

Example 45 with EffectiveIds

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

the class IngressCommandInstallTest method errorNoMeterSupport.

@Test
public void errorNoMeterSupport() throws Exception {
    switchFeaturesSetup(sw, false);
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, meterConfig, makeMetadata());
    expectMeterInstall(new UnsupportedSwitchOperationException(dpIdNext, "Switch doesn't support meters (unit-test)"));
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds());
    expectNoMoreOfMessages();
    replayAll();
    CompletableFuture<FlowSegmentReport> result = command.execute(commandProcessor);
    verifyWriteCount(1);
    verifySuccessCompletion(result);
    verifyNoMeterCall((OFFlowAdd) getWriteRecord(0).getRequest());
}
Also used : UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) FlowSegmentReport(org.openkilda.floodlight.command.flow.FlowSegmentReport) Test(org.junit.Test)

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