@Test public void testInitTopologyBgpUnnumberedIbgp() { String iface1 = "iface1"; String iface2 = "iface2"; BgpUnnumberedPeerConfig.Builder builder = BgpUnnumberedPeerConfig.builder().setLocalIp(Ip.parse("169.254.0.1")); BgpUnnumberedPeerConfig peer1 = builder .setLocalAs(1L) .setRemoteAs(1L) .setPeerInterface(iface1) .setIpv4UnicastAddressFamily(Ipv4UnicastAddressFamily.builder().build()) .build(); BgpUnnumberedPeerConfig peer2 = builder .setLocalAs(1L) .setRemoteAs(1L) .setPeerInterface(iface2) .setIpv4UnicastAddressFamily(Ipv4UnicastAddressFamily.builder().build()) .build(); _node1BgpProcess.setInterfaceNeighbors(ImmutableSortedMap.of(iface1, peer1)); _node2BgpProcess.setInterfaceNeighbors(ImmutableSortedMap.of(iface2, peer2)); Layer2Edge edge = new Layer2Edge(NODE1, iface1, null, NODE2, iface2, null, null); Layer2Topology connectedLayer2Topology = Layer2Topology.builder().addEdge(edge).build(); ValueGraph<BgpPeerConfigId, BgpSessionProperties> bgpTopology = initBgpTopology(_configs, ImmutableMap.of(), true, false, null, connectedLayer2Topology) .getGraph(); BgpPeerConfigId peer1Id = new BgpPeerConfigId(NODE1, DEFAULT_VRF_NAME, iface1); BgpPeerConfigId peer2To1Id = new BgpPeerConfigId(NODE2, DEFAULT_VRF_NAME, iface2); assertThat(bgpTopology.nodes(), hasSize(2)); assertThat( bgpTopology.edges(), containsInAnyOrder( EndpointPair.ordered(peer1Id, peer2To1Id), EndpointPair.ordered(peer2To1Id, peer1Id))); }
public static @Nonnull BgpTopology initBgpTopology( Map<String, Configuration> configurations, Map<Ip, Map<String, Set<String>>> ipOwners, boolean keepInvalid, @Nullable Layer2Topology layer2Topology) { return initBgpTopology(configurations, ipOwners, keepInvalid, false, null, layer2Topology); }
BgpTopologyUtils { public static @Nonnull BgpTopology initBgpTopology( Map<String, Configuration> configurations, Map<Ip, Map<String, Set<String>>> ipOwners, boolean keepInvalid, @Nullable Layer2Topology layer2Topology) { return initBgpTopology(configurations, ipOwners, keepInvalid, false, null, layer2Topology); } }
BgpTopologyUtils { public static @Nonnull BgpTopology initBgpTopology( Map<String, Configuration> configurations, Map<Ip, Map<String, Set<String>>> ipOwners, boolean keepInvalid, @Nullable Layer2Topology layer2Topology) { return initBgpTopology(configurations, ipOwners, keepInvalid, false, null, layer2Topology); } private  BgpTopologyUtils(); }
BgpTopologyUtils { public static @Nonnull BgpTopology initBgpTopology( Map<String, Configuration> configurations, Map<Ip, Map<String, Set<String>>> ipOwners, boolean keepInvalid, @Nullable Layer2Topology layer2Topology) { return initBgpTopology(configurations, ipOwners, keepInvalid, false, null, layer2Topology); } private  BgpTopologyUtils(); static @Nonnull BgpTopology initBgpTopology(
      Map<String, Configuration> configurations,
      Map<Ip, Map<String, Set<String>>> ipOwners,
      boolean keepInvalid,
      @Nullable Layer2Topology layer2Topology); static @Nonnull BgpTopology initBgpTopology(
      Map<String, Configuration> configurations,
      Map<Ip, Map<String, Set<String>>> ipVrfOwners,
      boolean keepInvalid,
      boolean checkReachability,
      @Nullable TracerouteEngine tracerouteEngine,
      @Nullable Layer2Topology layer2Topology); @VisibleForTesting static boolean isReachableBgpNeighbor(
      @Nonnull BgpPeerConfigId initiatorId,
      @Nonnull BgpPeerConfigId listenerId,
      @Nonnull BgpActivePeerConfig initiator,
      @Nonnull TracerouteEngine tracerouteEngine); }
BgpTopologyUtils { public static @Nonnull BgpTopology initBgpTopology( Map<String, Configuration> configurations, Map<Ip, Map<String, Set<String>>> ipOwners, boolean keepInvalid, @Nullable Layer2Topology layer2Topology) { return initBgpTopology(configurations, ipOwners, keepInvalid, false, null, layer2Topology); } private  BgpTopologyUtils(); static @Nonnull BgpTopology initBgpTopology(
      Map<String, Configuration> configurations,
      Map<Ip, Map<String, Set<String>>> ipOwners,
      boolean keepInvalid,
      @Nullable Layer2Topology layer2Topology); static @Nonnull BgpTopology initBgpTopology(
      Map<String, Configuration> configurations,
      Map<Ip, Map<String, Set<String>>> ipVrfOwners,
      boolean keepInvalid,
      boolean checkReachability,
      @Nullable TracerouteEngine tracerouteEngine,
      @Nullable Layer2Topology layer2Topology); @VisibleForTesting static boolean isReachableBgpNeighbor(
      @Nonnull BgpPeerConfigId initiatorId,
      @Nonnull BgpPeerConfigId listenerId,
      @Nonnull BgpActivePeerConfig initiator,
      @Nonnull TracerouteEngine tracerouteEngine);  }