Search in sources :

Example 31 with EffectiveIds

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

the class IngressCommandRemoveTest method errorOnMeterManipulation.

@Test
public void errorOnMeterManipulation() {
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, meterConfig, makeMetadata());
    switchFeaturesSetup(sw, true);
    expectMeterDryRun();
    expectMeterRemove(new SwitchErrorResponseException(dpIdNext, "fake fail to remove meter error"));
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds(meterConfig.getId(), null));
    expectNoMoreOfMessages();
    replayAll();
    CompletableFuture<FlowSegmentReport> result = command.execute(commandProcessor);
    verifyErrorCompletion(result, SwitchErrorResponseException.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 32 with EffectiveIds

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

the class IngressCommandRemoveTest method errorOnFlowMod.

@Test
public void errorOnFlowMod() {
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, meterConfig, makeMetadata());
    switchFeaturesSetup(sw, true);
    expectMeterDryRun();
    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 33 with EffectiveIds

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

the class IngressCommandRemoveTest 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 34 with EffectiveIds

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

the class IngressCommandRemoveTest method processOneVlanSingleTable.

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

Example 35 with EffectiveIds

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

the class IngressCommandRemoveTest method errorNoMeterSupport.

@Test
public void errorNoMeterSupport() throws Exception {
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, meterConfig, makeMetadata());
    switchFeaturesSetup(sw, false);
    expectMeterDryRun(new UnsupportedSwitchOperationException(dpIdNext, "Switch doesn't support meters (unit-test)"));
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds());
    expectNoMoreOfMessages();
    replayAll();
    verifySuccessCompletion(command.execute(commandProcessor));
}
Also used : UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) 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