@Before public void clearBgpProcesses() { _node1BgpProcess.setNeighbors(ImmutableSortedMap.of()); _node2BgpProcess.setNeighbors(ImmutableSortedMap.of()); _node3BgpProcess.setNeighbors(ImmutableSortedMap.of()); _node1BgpProcess.setPassiveNeighbors(ImmutableSortedMap.of()); _node2BgpProcess.setPassiveNeighbors(ImmutableSortedMap.of()); _node3BgpProcess.setPassiveNeighbors(ImmutableSortedMap.of()); }
_node2BgpProcess.setPassiveNeighbors(ImmutableSortedMap.of(prefixForPeer1, peer2)); _node3BgpProcess.setPassiveNeighbors(ImmutableSortedMap.of(prefixForPeer1, peer3));
.setPeerPrefix(peer2PeerPrefix) .build(); _node2BgpProcess.setPassiveNeighbors(ImmutableSortedMap.of(peer2PeerPrefix, peer2));
newBgpProcess.setPassiveNeighbors(ImmutableSortedMap.copyOf(passiveNeighbors));
private static Configuration createConfigurationWithDynamicSession( Configuration.Builder cb, Ip localIp, Prefix remotePrefix, List<Long> remoteAsList) { Configuration node = cb.setHostname("node4").build(); Interface iface = new Interface("iface", node, InterfaceType.PHYSICAL); iface.setAllAddresses( ImmutableList.of(new InterfaceAddress(localIp, Ip.numSubnetBitsToSubnetMask(32)))); BgpPassivePeerConfig peerConfig = BgpPassivePeerConfig.builder() .setLocalAs(3L) .setRemoteAs(remoteAsList) .setLocalIp(localIp) .setPeerPrefix(remotePrefix) .build(); BgpProcess bgpProcess = new BgpProcess(); bgpProcess.setPassiveNeighbors(ImmutableSortedMap.of(remotePrefix, peerConfig)); Vrf vrf1 = new Vrf("vrf"); vrf1.setBgpProcess(bgpProcess); node.setVrfs(ImmutableMap.of("vrf", vrf1)); node.setInterfaces(ImmutableSortedMap.of("iface", iface)); return node; }
hasPassiveNeighbor.setPassiveNeighbors(ImmutableSortedMap.of(p30a, passivePeerWithRRC)); assertTrue("has passive rr client", isRouteReflector(hasPassiveNeighbor)); hasNeighborMix.setNeighbors( ImmutableSortedMap.of(p32a, activePeerWithoutRRC, p32b, activePeerWithRRC)); hasNeighborMix.setPassiveNeighbors( ImmutableSortedMap.of(p30a, passivePeerWithoutRRC, p30b, passivePeerWithRRC)); assertTrue("has mix of active and inactive rr client", isRouteReflector(hasNeighborMix)); hasAllInactive.setPassiveNeighbors(ImmutableSortedMap.of(p30a, passivePeerWithoutRRC)); assertFalse("has multiple inactive rr clients", isRouteReflector(hasAllInactive));
process.setPassiveNeighbors( ImmutableSortedMap.of(Prefix.create(Ip.parse("1.1.1.0"), 24), passivePeer));