use of org.openkilda.model.IslEndpoint in project open-kilda by telstra.
the class YFlowRerouteServiceTest method shouldRerouteFlowWithTransitSwitchesWithAffectedIsl.
@Test
public void shouldRerouteFlowWithTransitSwitchesWithAffectedIsl() throws UnroutableFlowException, RecoverableException, DuplicateKeyException {
// given
YFlowRequest createYFlowRequest = createYFlow();
YFlowRerouteRequest request = new YFlowRerouteRequest(createYFlowRequest.getYFlowId(), "reason");
request.setAffectedIsl(Collections.singleton(new IslEndpoint(SWITCH_TRANSIT, 25)));
preparePathComputationForReroute("test_flow_1", buildFirstSubFlowPathPairWithNewTransit());
preparePathComputationForReroute("test_flow_2", buildSecondSubFlowPathPairWithNewTransit());
prepareYPointComputation(SWITCH_SHARED, SWITCH_FIRST_EP, SWITCH_SECOND_EP, SWITCH_NEW_TRANSIT);
// when
processRerouteRequestAndSpeakerCommands(request);
verifyNorthboundSuccessResponse(yFlowRerouteHubCarrier, YFlowRerouteResponse.class);
verifyYFlowStatus(request.getYFlowId(), FlowStatus.UP);
verifyAffinity(request.getYFlowId());
verify(yFlowRerouteHubCarrier).sendYFlowRerouteResultStatus(eq(createYFlowRequest.getYFlowId()), eq(null), anyString());
}
use of org.openkilda.model.IslEndpoint in project open-kilda by telstra.
the class YFlowRerouteServiceTest method shouldRerouteFlowWithTransitSwitchesWithMainFlowAffectedIsl.
@Test
public void shouldRerouteFlowWithTransitSwitchesWithMainFlowAffectedIsl() throws UnroutableFlowException, RecoverableException, DuplicateKeyException {
// given
YFlowRequest createYFlowRequest = createYFlow();
YFlowRerouteRequest request = new YFlowRerouteRequest(createYFlowRequest.getYFlowId(), "reason");
request.setAffectedIsl(Collections.singleton(new IslEndpoint(SWITCH_TRANSIT, 26)));
preparePathComputationForReroute("test_flow_1", buildFirstSubFlowPathPairWithNewTransit());
preparePathComputationForReroute("test_flow_2", buildSecondSubFlowPathPairWithNewTransit());
prepareYPointComputation(SWITCH_SHARED, SWITCH_FIRST_EP, SWITCH_SECOND_EP, SWITCH_NEW_TRANSIT);
// when
processRerouteRequestAndSpeakerCommands(request);
verifyNorthboundSuccessResponse(yFlowRerouteHubCarrier, YFlowRerouteResponse.class);
verifyYFlowStatus(request.getYFlowId(), FlowStatus.UP);
verifyAffinity(request.getYFlowId());
verify(yFlowRerouteHubCarrier).sendYFlowRerouteResultStatus(eq(createYFlowRequest.getYFlowId()), eq(null), anyString());
}
use of org.openkilda.model.IslEndpoint in project open-kilda by telstra.
the class YFlowRerouteServiceTest method shouldRerouteFlowWithTransitSwitchesWithSecondaryFlowAffectedIsl.
@Test
public void shouldRerouteFlowWithTransitSwitchesWithSecondaryFlowAffectedIsl() throws UnroutableFlowException, RecoverableException, DuplicateKeyException {
// given
YFlowRequest createYFlowRequest = createYFlow();
YFlowRerouteRequest request = new YFlowRerouteRequest(createYFlowRequest.getYFlowId(), "reason");
request.setAffectedIsl(Collections.singleton(new IslEndpoint(SWITCH_TRANSIT, 27)));
preparePathComputationForReroute("test_flow_2", buildSecondSubFlowPathPairWithNewTransit());
prepareYPointComputation(SWITCH_SHARED, SWITCH_FIRST_EP, SWITCH_SECOND_EP, SWITCH_SHARED);
// when
processRerouteRequestAndSpeakerCommands(request, FlowStatus.IN_PROGRESS, FlowStatus.UP, FlowStatus.IN_PROGRESS);
verifyNorthboundSuccessResponse(yFlowRerouteHubCarrier, YFlowRerouteResponse.class);
verifyYFlowStatus(request.getYFlowId(), FlowStatus.UP);
verifyAffinity(request.getYFlowId());
verify(yFlowRerouteHubCarrier).sendYFlowRerouteResultStatus(eq(createYFlowRequest.getYFlowId()), eq(null), anyString());
}
use of org.openkilda.model.IslEndpoint in project open-kilda by telstra.
the class FlowRerouteServiceTest method shouldSkipRerouteOnOutdatedRequest.
@Test
public void shouldSkipRerouteOnOutdatedRequest() {
Flow origin = makeFlow();
FlowRerouteService service = makeService();
IslEndpoint affectedEndpoint = extractIslEndpoint(origin);
FlowRerouteRequest request = new FlowRerouteRequest(origin.getFlowId(), false, true, false, Collections.singleton(affectedEndpoint), null, false);
service.handleRequest(currentRequestKey, request, commandContext);
Flow result = verifyFlowStatus(origin.getFlowId(), FlowStatus.UP);
verifyNoPathReplace(origin, result);
}
use of org.openkilda.model.IslEndpoint in project open-kilda by telstra.
the class FlowRerouteServiceTest method shouldFailRerouteYSubFlow.
@Test
public void shouldFailRerouteYSubFlow() throws UnroutableFlowException, RecoverableException {
Flow origin = makeFlow();
createTestYFlowForSubFlow(origin);
preparePathComputation(origin.getFlowId(), make3SwitchesPathPair());
FlowRerouteService service = makeService();
IslEndpoint affectedEndpoint = extractIslEndpoint(origin);
FlowRerouteRequest request = new FlowRerouteRequest(origin.getFlowId(), false, true, false, Collections.singleton(affectedEndpoint), null, false);
service.handleRequest(currentRequestKey, request, commandContext);
verifyNoSpeakerInteraction(carrier);
verifyNorthboundErrorResponse(carrier, ErrorType.REQUEST_INVALID);
}
Aggregations