@Test public void testAddVniEdge() { MutableGraph<VxlanNode> graph = GraphBuilder.undirected().allowsSelfLoops(false).build(); Layer2Vni.Builder vniSettingsBuilder = testBuilder() .setBumTransportIps(ImmutableSortedSet.of(MULTICAST_GROUP)) .setBumTransportMethod(BumTransportMethod.MULTICAST_GROUP) .setUdpPort(UDP_PORT) .setVni(VNI); Layer2Vni vniSettingsTail = vniSettingsBuilder.setSourceAddress(SRC_IP1).setVlan(VLAN1).setVni(VNI).build(); _v1.setLayer2Vnis(ImmutableSet.of(vniSettingsTail)); Layer2Vni vniSettingsHead = vniSettingsBuilder.setSourceAddress(SRC_IP2).setVlan(VLAN2).setVni(VNI).build(); _v2.setLayer2Vnis(ImmutableSet.of(vniSettingsHead)); addVniEdge( graph, new VrfId(_c1.getHostname(), _v1.getName()), vniSettingsTail, new VrfId(_c2.getHostname(), _v2.getName()), vniSettingsHead); Set<EndpointPair<VxlanNode>> edges = graph.edges(); assertThat( edges, equalTo( ImmutableSet.of( EndpointPair.unordered( VxlanNode.builder().setHostname(NODE2).setVni(VNI).build(), VxlanNode.builder().setHostname(NODE1).setVni(VNI).build())))); }
@VisibleForTesting static void addVniEdge( MutableGraph<VxlanNode> graph, VrfId vrfTail, Layer2Vni vniSettingsTail, VrfId vrfHead, Layer2Vni vniSettingsHead) { if (compatibleVniSettings(vniSettingsTail, vniSettingsHead)) { VxlanNode nodeTail = buildVxlanNode(vrfTail, vniSettingsTail); VxlanNode nodeHead = buildVxlanNode(vrfHead, vniSettingsHead); graph.putEdge(nodeTail, nodeHead); } }
VxlanTopologyUtils { @VisibleForTesting static void addVniEdge( MutableGraph<VxlanNode> graph, VrfId vrfTail, Layer2Vni vniSettingsTail, VrfId vrfHead, Layer2Vni vniSettingsHead) { if (compatibleVniSettings(vniSettingsTail, vniSettingsHead)) { VxlanNode nodeTail = buildVxlanNode(vrfTail, vniSettingsTail); VxlanNode nodeHead = buildVxlanNode(vrfHead, vniSettingsHead); graph.putEdge(nodeTail, nodeHead); } } }
VxlanTopologyUtils { @VisibleForTesting static void addVniEdge( MutableGraph<VxlanNode> graph, VrfId vrfTail, Layer2Vni vniSettingsTail, VrfId vrfHead, Layer2Vni vniSettingsHead) { if (compatibleVniSettings(vniSettingsTail, vniSettingsHead)) { VxlanNode nodeTail = buildVxlanNode(vrfTail, vniSettingsTail); VxlanNode nodeHead = buildVxlanNode(vrfHead, vniSettingsHead); graph.putEdge(nodeTail, nodeHead); } } private  VxlanTopologyUtils(); }
VxlanTopologyUtils { @VisibleForTesting static void addVniEdge( MutableGraph<VxlanNode> graph, VrfId vrfTail, Layer2Vni vniSettingsTail, VrfId vrfHead, Layer2Vni vniSettingsHead) { if (compatibleVniSettings(vniSettingsTail, vniSettingsHead)) { VxlanNode nodeTail = buildVxlanNode(vrfTail, vniSettingsTail); VxlanNode nodeHead = buildVxlanNode(vrfHead, vniSettingsHead); graph.putEdge(nodeTail, nodeHead); } } private  VxlanTopologyUtils(); static @Nonnull VxlanTopology computeVxlanTopology(
      Map<String, Configuration> configurations); static @Nonnull VxlanTopology computeVxlanTopology(
      Table<String, String, ? extends Collection<Layer2Vni>> allVniSettings); static @Nonnull VxlanTopology prunedVxlanTopology(
      VxlanTopology initialVxlanTopology,
      Map<String, Configuration> configurations,
      TracerouteEngine tracerouteEngine); }
VxlanTopologyUtils { @VisibleForTesting static void addVniEdge( MutableGraph<VxlanNode> graph, VrfId vrfTail, Layer2Vni vniSettingsTail, VrfId vrfHead, Layer2Vni vniSettingsHead) { if (compatibleVniSettings(vniSettingsTail, vniSettingsHead)) { VxlanNode nodeTail = buildVxlanNode(vrfTail, vniSettingsTail); VxlanNode nodeHead = buildVxlanNode(vrfHead, vniSettingsHead); graph.putEdge(nodeTail, nodeHead); } } private  VxlanTopologyUtils(); static @Nonnull VxlanTopology computeVxlanTopology(
      Map<String, Configuration> configurations); static @Nonnull VxlanTopology computeVxlanTopology(
      Table<String, String, ? extends Collection<Layer2Vni>> allVniSettings); static @Nonnull VxlanTopology prunedVxlanTopology(
      VxlanTopology initialVxlanTopology,
      Map<String, Configuration> configurations,
      TracerouteEngine tracerouteEngine);  }