Search in sources :

Example 6 with FlowSegmentReport

use of org.openkilda.floodlight.command.flow.FlowSegmentReport 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 7 with FlowSegmentReport

use of org.openkilda.floodlight.command.flow.FlowSegmentReport 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 8 with FlowSegmentReport

use of org.openkilda.floodlight.command.flow.FlowSegmentReport 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

Test (org.junit.Test)8 FlowSegmentReport (org.openkilda.floodlight.command.flow.FlowSegmentReport)8 SwitchErrorResponseException (org.openkilda.floodlight.error.SwitchErrorResponseException)6 EffectiveIds (org.openkilda.floodlight.model.EffectiveIds)5 AbstractSpeakerCommandTest (org.openkilda.floodlight.command.AbstractSpeakerCommandTest)2 UnsupportedSwitchOperationException (org.openkilda.floodlight.error.UnsupportedSwitchOperationException)1 FlowEndpoint (org.openkilda.model.FlowEndpoint)1