use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address in project bgpcep by opendaylight.
the class PCCTunnelManagerImplTest method testTakeDelegationUnknownLsp.
@Test
public void testTakeDelegationUnknownLsp() {
final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER, this.timerHandler);
tunnelManager.onSessionUp(this.session1);
tunnelManager.onMessagePcInitiate(createRequestsDelegate(1), this.session1);
Mockito.verify(this.session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
assertEquals(PCEPErrors.UNKNOWN_PLSP_ID, this.errorsSession1.get(0));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address in project bgpcep by opendaylight.
the class PCCTunnelManagerImplTest method testTakeDelegationNotPceInitiatedLsp.
@Test
public void testTakeDelegationNotPceInitiatedLsp() {
final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER, this.timerHandler);
tunnelManager.onSessionUp(this.session1);
tunnelManager.onMessagePcInitiate(createRequestsDelegate(1), this.session1);
Mockito.verify(this.session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
assertEquals(PCEPErrors.LSP_NOT_PCE_INITIATED, this.errorsSession1.get(0));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address in project bgpcep by opendaylight.
the class PCCTunnelManagerImplTest method testRemoveTunnelUnknownLsp.
@Test
public void testRemoveTunnelUnknownLsp() {
final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER, this.timerHandler);
tunnelManager.onSessionUp(this.session1);
tunnelManager.onMessagePcInitiate(createRequestsRemove(1), this.session1);
Mockito.verify(this.session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
assertEquals(PCEPErrors.UNKNOWN_PLSP_ID, this.errorsSession1.get(0));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address in project bgpcep by opendaylight.
the class PCCTunnelManagerImplTest method testReturnDelegationPccLsp.
@Test
public void testReturnDelegationPccLsp() throws InterruptedException {
final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 1, -1, TIMER, this.timerHandler);
tunnelManager.onSessionUp(this.session1);
tunnelManager.onSessionUp(this.session2);
tunnelManager.onMessagePcupd(createUpdate(1), this.session1);
Mockito.verify(this.session1, Mockito.times(3)).sendReport(Mockito.any(Pcrpt.class));
Mockito.verify(this.session2, Mockito.times(2)).sendReport(Mockito.any(Pcrpt.class));
// wait for re-delegation timer expires
Thread.sleep(1200);
Mockito.verify(this.session2, Mockito.times(3)).sendReport(Mockito.any(Pcrpt.class));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address in project bgpcep by opendaylight.
the class PCCTunnelManagerImplTest method testReturnDelegationNoRetake.
@Test
public void testReturnDelegationNoRetake() throws InterruptedException {
final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER, this.timerHandler);
tunnelManager.onSessionUp(this.session1);
tunnelManager.onSessionUp(this.session2);
tunnelManager.onMessagePcInitiate(createRequests(1), this.session1);
tunnelManager.onMessagePcupd(createUpdate(1), this.session1);
// wait for state timeout expires
Thread.sleep(500);
Mockito.verify(this.session1, Mockito.times(3)).sendReport(Mockito.any(Pcrpt.class));
Mockito.verify(this.session2, Mockito.times(2)).sendReport(Mockito.any(Pcrpt.class));
}
Aggregations