use of org.openkilda.floodlight.error.SwitchErrorResponseException 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);
}
use of org.openkilda.floodlight.error.SwitchErrorResponseException 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);
}
use of org.openkilda.floodlight.error.SwitchErrorResponseException 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);
}
use of org.openkilda.floodlight.error.SwitchErrorResponseException in project open-kilda by telstra.
the class MeterInstallCommand method handleOfError.
@Override
public CompletableFuture<Optional<OFMessage>> handleOfError(OFErrorMsg response) {
CompletableFuture<Optional<OFMessage>> future = new CompletableFuture<>();
if (!isInstallConflict(response)) {
future.completeExceptionally(new SwitchErrorResponseException(getSw().getId(), String.format("Can't install meter %s - %s", meterConfig.getId(), response)));
return future;
}
log.info("Meter conflict detected sw:{} meter:{}", getSw().getId(), meterConfig.getId());
MeterVerifyCommand verifyCommand = new MeterVerifyCommand(messageContext, switchId, meterConfig);
propagateFutureResponse(future, commandProcessor.chain(verifyCommand).thenAccept(this::handleMeterVerify).thenApply(ignore -> Optional.empty()));
return future;
}
use of org.openkilda.floodlight.error.SwitchErrorResponseException in project open-kilda by telstra.
the class GroupInstallCommand method handleOfError.
@Override
public CompletableFuture<Optional<OFMessage>> handleOfError(OFErrorMsg response) {
CompletableFuture<Optional<OFMessage>> future = new CompletableFuture<>();
if (!isInstallConflict(response)) {
future.completeExceptionally(new SwitchErrorResponseException(getSw().getId(), String.format("Can't install group %s - %s", mirrorConfig.getGroupId(), response)));
return future;
}
log.info("Group conflict detected sw:{} group:{}", getSw().getId(), mirrorConfig.getGroupId());
GroupVerifyCommand verifyCommand = new GroupVerifyCommand(messageContext, switchId, mirrorConfig, flowTransitData);
propagateFutureResponse(future, commandProcessor.chain(verifyCommand).thenAccept(this::handleGroupVerify).thenApply(ignore -> Optional.empty()));
return future;
}
Aggregations