private Topology computeLayer3Topology(NetworkSnapshot networkSnapshot) { try (ActiveSpan span = GlobalTracer.get().buildSpan("TopologyProviderImpl::computeLayer3Topology").startActive()) { assert span != null; // avoid unused warning Map<String, Configuration> configurations = _batfish.loadConfigurations(networkSnapshot); Topology topology = getRawLayer3Topology(networkSnapshot); topology.prune( _batfish.getEdgeBlacklist(networkSnapshot), _batfish.getNodeBlacklist(networkSnapshot), _batfish.getInterfaceBlacklist(networkSnapshot)); topology.pruneFailedIpsecSessionEdges( IpsecUtil.initIpsecTopology(configurations), configurations); return topology; } }
@Test public void testPruneFailedIpsecSessionEdges() { _topology.pruneFailedIpsecSessionEdges(_ipsecTopology, _configurations); // Edges involving host1:Tunnel3, host2:Tunnel4, host1:Tunnel7 will be pruned assertThat( _topology.getEdges(), equalTo( ImmutableSet.of( new Edge( new NodeInterfacePair("host1", "Tunnel1"), new NodeInterfacePair("host2", "Tunnel2")), new Edge( new NodeInterfacePair("host2", "Tunnel2"), new NodeInterfacePair("host1", "Tunnel1")), new Edge( new NodeInterfacePair("host1", "interface5"), new NodeInterfacePair("host2", "interface6")), new Edge( new NodeInterfacePair("host1", "Tunnel9"), new NodeInterfacePair("host2", "Tunnel10"))))); } }