Search in sources :

Example 1 with IslDownReason

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

the class NetworkIslServiceTest method noIslCreationOnIslDown.

@Test
public void noIslCreationOnIslDown() {
    setupIslStorageStub();
    IslReference reference = new IslReference(endpointAlpha1, endpointBeta2);
    for (IslDownReason reason : IslDownReason.values()) {
        try {
            service.islDown(reference.getSource(), reference, reason);
            Assert.fail("No expected exception IslControllerNotFoundException");
        } catch (IslControllerNotFoundException e) {
        // expected
        }
    }
}
Also used : IslControllerNotFoundException(org.openkilda.wfm.topology.network.error.IslControllerNotFoundException) IslReference(org.openkilda.wfm.share.model.IslReference) IslDownReason(org.openkilda.model.IslDownReason) Test(org.junit.Test)

Example 2 with IslDownReason

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

the class IslFsm method makeRerouteAffectedReason.

private String makeRerouteAffectedReason(Endpoint endpoint) {
    final IslDownReason downReason = statusAggregator.getDownReason();
    final IslStatus effectiveStatus = statusAggregator.getEffectiveStatus();
    if (downReason == null) {
        return String.format("ISL %s status become %s", reference, effectiveStatus);
    }
    String humanReason;
    switch(downReason) {
        case PORT_DOWN:
            humanReason = String.format("ISL %s become %s due to physical link DOWN event on %s", reference, effectiveStatus, endpoint);
            break;
        case POLL_TIMEOUT:
            humanReason = String.format("ISL %s become %s because of FAIL TIMEOUT (endpoint:%s)", reference, effectiveStatus, endpoint);
            break;
        case BFD_DOWN:
            humanReason = String.format("ISL %s become %s because BFD detect link failure (endpoint:%s)", reference, effectiveStatus, endpoint);
            break;
        default:
            humanReason = String.format("ISL %s become %s (endpoint:%s, reason:%s)", reference, effectiveStatus, endpoint, downReason);
    }
    return humanReason;
}
Also used : IslStatus(org.openkilda.model.IslStatus) IslDownReason(org.openkilda.model.IslDownReason)

Aggregations

IslDownReason (org.openkilda.model.IslDownReason)2 Test (org.junit.Test)1 IslStatus (org.openkilda.model.IslStatus)1 IslReference (org.openkilda.wfm.share.model.IslReference)1 IslControllerNotFoundException (org.openkilda.wfm.topology.network.error.IslControllerNotFoundException)1