use of org.opendaylight.protocol.bgp.rib.impl.config.BgpPeer in project bgpcep by opendaylight.
the class AbstractAddPathTest method configurePeer.
static BGPPeer configurePeer(final BGPTableTypeRegistryConsumer tableRegistry, final Ipv4AddressNoZone peerAddress, final RIBImpl ribImpl, final BgpParameters bgpParameters, final PeerRole peerRole, final BGPPeerRegistry bgpPeerRegistry, final Set<TablesKey> afiSafiAdvertised, final Set<TablesKey> gracefulAfiSafiAdvertised) {
final BgpPeer bgpPeer = Mockito.mock(BgpPeer.class);
doReturn(Optional.empty()).when(bgpPeer).getErrorHandling();
return configurePeer(tableRegistry, peerAddress, ribImpl, bgpParameters, peerRole, bgpPeerRegistry, afiSafiAdvertised, gracefulAfiSafiAdvertised, Collections.emptyMap(), bgpPeer);
}
use of org.opendaylight.protocol.bgp.rib.impl.config.BgpPeer in project bgpcep by opendaylight.
the class GracefulRestartTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
final Map<TablesKey, PathSelectionMode> pathTables = ImmutableMap.of(TABLES_KEY, new AllPathSelection());
final ArrayList<BgpTableType> tableTypes = new ArrayList<>(TABLES_TYPE);
tableTypes.add(new BgpTableTypeImpl(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class));
this.ribImpl = new RIBImpl(this.tableRegistry, RIBID, AS_NUMBER, BGP_ID, this.ribExtension, this.serverDispatcher, this.codecsRegistry, getDomBroker(), this.policies, tableTypes, pathTables);
this.ribImpl.instantiateServiceInstance();
final ChannelFuture channelFuture = this.serverDispatcher.createServer(new InetSocketAddress(RIB_ID, PORT.toJava()));
waitFutureSuccess(channelFuture);
this.serverChannel = channelFuture.channel();
gracefulAfiSafiAdvertised.add(TABLES_KEY);
afiSafiAdvertised.add(TABLES_KEY);
afiSafiAdvertised.add(IPV6_TABLES_KEY);
final BgpPeer bgpPeer = Mockito.mock(BgpPeer.class);
Mockito.doReturn(GRACEFUL_RESTART_TIME).when(bgpPeer).getGracefulRestartTimer();
Mockito.doReturn(Optional.empty()).when(bgpPeer).getErrorHandling();
Mockito.doReturn(createParameter(false, true, Collections.singletonMap(TABLES_KEY, false)).getOptionalCapabilities()).when(bgpPeer).getBgpFixedCapabilities();
this.peer = configurePeer(this.tableRegistry, PEER1, this.ribImpl, parameters, PeerRole.Ibgp, this.serverRegistry, afiSafiAdvertised, gracefulAfiSafiAdvertised, Collections.emptyMap(), bgpPeer);
this.session = createPeerSession(PEER1, parameters, this.listener);
}
Aggregations