Search in sources :

Example 1 with BgpPeer

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);
}
Also used : BgpPeer(org.opendaylight.protocol.bgp.rib.impl.config.BgpPeer)

Example 2 with 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);
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.BgpTableType) Ipv6AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily) ChannelFuture(io.netty.channel.ChannelFuture) TablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey) BgpPeer(org.opendaylight.protocol.bgp.rib.impl.config.BgpPeer) InetSocketAddress(java.net.InetSocketAddress) AllPathSelection(org.opendaylight.protocol.bgp.mode.impl.add.all.paths.AllPathSelection) ArrayList(java.util.ArrayList) PathSelectionMode(org.opendaylight.protocol.bgp.mode.api.PathSelectionMode) BgpTableTypeImpl(org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl) UnicastSubsequentAddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily) Before(org.junit.Before)

Aggregations

BgpPeer (org.opendaylight.protocol.bgp.rib.impl.config.BgpPeer)2 ChannelFuture (io.netty.channel.ChannelFuture)1 InetSocketAddress (java.net.InetSocketAddress)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 PathSelectionMode (org.opendaylight.protocol.bgp.mode.api.PathSelectionMode)1 AllPathSelection (org.opendaylight.protocol.bgp.mode.impl.add.all.paths.AllPathSelection)1 BgpTableTypeImpl (org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl)1 BgpTableType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.BgpTableType)1 TablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey)1 Ipv6AddressFamily (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily)1 UnicastSubsequentAddressFamily (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily)1