Search in sources :

Example 1 with FlowSegmentReport

use of org.openkilda.floodlight.command.flow.FlowSegmentReport in project open-kilda by telstra.

the class TransitFlowSegmentCommandTest method errorOnFlowMod.

@Test
public void errorOnFlowMod() {
    switchFeaturesSetup(sw, true);
    replayAll();
    TransitFlowSegmentCommand command = makeCommand(encapsulationVlan);
    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 : SwitchErrorResponseException(org.openkilda.floodlight.error.SwitchErrorResponseException) FlowSegmentReport(org.openkilda.floodlight.command.flow.FlowSegmentReport) Test(org.junit.Test) AbstractSpeakerCommandTest(org.openkilda.floodlight.command.AbstractSpeakerCommandTest)

Example 2 with FlowSegmentReport

use of org.openkilda.floodlight.command.flow.FlowSegmentReport in project open-kilda by telstra.

the class EgressFlowSegmentCommandTest method errorOnFlowMod.

@Test
public void errorOnFlowMod() {
    switchFeaturesSetup(sw, true);
    replayAll();
    FlowEndpoint ingressEndpoint = new FlowEndpoint(mapSwitchId(dpId), 1, 0);
    EgressFlowSegmentCommand command = makeCommand(endpointEgressZeroVlan, ingressEndpoint, encapsulationVlan);
    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 : FlowEndpoint(org.openkilda.model.FlowEndpoint) SwitchErrorResponseException(org.openkilda.floodlight.error.SwitchErrorResponseException) FlowSegmentReport(org.openkilda.floodlight.command.flow.FlowSegmentReport) Test(org.junit.Test) AbstractSpeakerCommandTest(org.openkilda.floodlight.command.AbstractSpeakerCommandTest)

Example 3 with FlowSegmentReport

use of org.openkilda.floodlight.command.flow.FlowSegmentReport in project open-kilda by telstra.

the class IngressCommandInstallTest method errorOnMeterManipulation.

@Test
public void errorOnMeterManipulation() {
    switchFeaturesSetup(sw, true);
    expectMeterInstall(new SwitchErrorResponseException(dpIdNext, "fake fail to install meter error"));
    expectNoMoreOfMessages();
    reset(sessionService);
    reset(session);
    replayAll();
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, meterConfig, makeMetadata());
    CompletableFuture<FlowSegmentReport> result = command.execute(commandProcessor);
    verifyErrorCompletion(result, SwitchErrorResponseException.class);
}
Also used : SwitchErrorResponseException(org.openkilda.floodlight.error.SwitchErrorResponseException) FlowSegmentReport(org.openkilda.floodlight.command.flow.FlowSegmentReport) Test(org.junit.Test)

Example 4 with FlowSegmentReport

use of org.openkilda.floodlight.command.flow.FlowSegmentReport in project open-kilda by telstra.

the class IngressCommandInstallTest method noMeterRequested.

@Test
public void noMeterRequested() throws Exception {
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, null, makeMetadata());
    switchFeaturesSetup(sw, true);
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds());
    expectNoMoreOfMessages();
    replayAll();
    CompletableFuture<FlowSegmentReport> result = command.execute(commandProcessor);
    verifySuccessCompletion(result);
    verifyWriteCount(1);
    verifyNoMeterCall((OFFlowAdd) getWriteRecord(0).getRequest());
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) FlowSegmentReport(org.openkilda.floodlight.command.flow.FlowSegmentReport) Test(org.junit.Test)

Example 5 with FlowSegmentReport

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

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