@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()); }
abstractBgp.setNeighbors(abstractBgpNeighbors); abstractVrf.setBgpProcess(abstractBgp);
.setRemoteAs(2L) .build(); _node1BgpProcess.setNeighbors(ImmutableSortedMap.of(peer1PeerPrefix, peer1));
newBgpProcess.setNeighbors(ImmutableSortedMap.copyOf(activeNeighbors));
.setRemoteAs(2L) .build(); _node1BgpProcess.setNeighbors(ImmutableSortedMap.of(peer1PeerPrefix, peer1));
private static Configuration createConfiguration( Configuration.Builder cb, String nodeName, Ip localIp, Ip remoteIp, Long localAs, Long remoteAs) { Configuration node = cb.setHostname(nodeName).build(); Interface iface = new Interface("iface", node, InterfaceType.PHYSICAL); iface.setAllAddresses( ImmutableList.of(new InterfaceAddress(localIp, Ip.numSubnetBitsToSubnetMask(32)))); BgpActivePeerConfig peerConfig = BgpActivePeerConfig.builder() .setLocalAs(localAs) .setRemoteAs(remoteAs) .setLocalIp(localIp) .setPeerAddress(remoteIp) .build(); BgpProcess bgpProcess = new BgpProcess(); bgpProcess.setNeighbors(ImmutableSortedMap.of(Prefix.create(remoteIp, 32), peerConfig)); Vrf vrf1 = new Vrf("vrf"); vrf1.setBgpProcess(bgpProcess); node.setVrfs(ImmutableMap.of("vrf", vrf1)); node.setInterfaces(ImmutableSortedMap.of("iface", iface)); return node; }
hasActiveNeighbor.setNeighbors(ImmutableSortedMap.of(p32a, activePeerWithRRC)); assertTrue("has active rr client", isRouteReflector(hasActiveNeighbor)); hasNeighborMix.setNeighbors( ImmutableSortedMap.of(p32a, activePeerWithoutRRC, p32b, activePeerWithRRC)); hasNeighborMix.setPassiveNeighbors( hasAllInactive.setNeighbors(ImmutableSortedMap.of(p32a, activePeerWithoutRRC)); hasAllInactive.setPassiveNeighbors(ImmutableSortedMap.of(p30a, passivePeerWithoutRRC)); assertFalse("has multiple inactive rr clients", isRouteReflector(hasAllInactive));
process.setNeighbors(ImmutableSortedMap.of(Prefix.create(Ip.parse("1.1.1.0"), 24), activePeer)); process.setPassiveNeighbors( ImmutableSortedMap.of(Prefix.create(Ip.parse("1.1.1.0"), 24), passivePeer));