- private void checkNepClient10G(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) {
- assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid());
- assertEquals("value of client nep should be '" + portName + "'",
- portName, nep.getName().get(0).getValue());
- assertEquals("value-name of client nep for '" + portName + "' should be '" + nepName + "'",
- nepName, nep.getName().get(0).getValueName());
- assertEquals("Client nep should support 2 kind of cep",
- 2, nep.getSupportedCepLayerProtocolQualifier().size());
- assertThat("client nep should support 2 kind of cep",
- nep.getSupportedCepLayerProtocolQualifier(),
- hasItems(ODUTYPEODU2E.class, DIGITALSIGNALTYPE10GigELAN.class));
- assertEquals("client nep should be of ETH protocol type", LayerProtocolName.ETH, nep.getLayerProtocolName());
- checkCommonPartOfNep(nep);
- }
+ @Test
+ void getTopologyDetailsForFullTapiTopologyWithLinksWhenSuccessful()
+ throws ExecutionException, InterruptedException {
+ Uuid topologyUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER.getBytes(
+ Charset.forName("UTF-8"))).toString());
+ LOG.info("T0FullMultilayerUuid = {}", topologyUuid);
+ GetTopologyDetailsInput input = TapiTopologyDataUtils.buildGetTopologyDetailsInput(topologyUuid);
+ TapiTopologyImpl tapiTopoImpl = new TapiTopologyImpl(getDataBroker(), tapiContext, topologyUtils, tapiLink);
+ ListenableFuture<RpcResult<GetTopologyDetailsOutput>> result = tapiTopoImpl.getTopologyDetails(input);
+ result.addListener(new Runnable() {
+ @Override
+ public void run() {
+ endSignal.countDown();
+ }
+ }, executorService);
+ endSignal.await();
+ RpcResult<GetTopologyDetailsOutput> rpcResult = result.get();
+ @Nullable
+ Topology topology = rpcResult.getResult().getTopology();
+ assertNotNull(topology, "Topology should not be null");
+ // 2 Nodes per Xpdr/Spdr node (DSR-ODU & PHOT) + 3 Node per Roadm
+ assertEquals(10, topology.getNode().size(), "Node list size should be 10");
+ List<Map<NameKey, Name>> nodeNames = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.PHOTONICMEDIA))
+ .map(Node::getName).collect(Collectors.toList());
+ LOG.info("TopologyNodes = {}", nodeNames.toString());
+ Node nodeTsp = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("XPDR-A1-XPDR1+XPONDER"))
+ .findAny().orElseThrow();
+ LOG.debug("XPDRA1 NEPs = {}", nodeTsp.getOwnedNodeEdgePoint().toString());
+ long nb1 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("XPDR-A1-XPDR1+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("100G-tpdr"))))
+ .count();
+ // 2 client ports in configuration -> removed the checkTp so we have 2 NEPs
+ assertEquals(2, nb1, "XPDR-A1-XPDR1+XPONDER should only have two client neps");
+ long inb1 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("XPDR-A1-XPDR1+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("iNodeEdgePoint_N"))))
+ .count();
+ assertEquals(2, inb1, "XPDR-A1-XPDR1+XPONDER should only have two internal network neps");
+ long enb1 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("XPDR-A1-XPDR1+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("eNodeEdgePoint_N"))))
+ .count();
+ assertEquals(2, enb1, "XPDR-A1-XPDR1+XPONDER should only have two external network neps");
+ long nb2 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("SPDR-SA1-XPDR1+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("NodeEdgePoint_C"))))
+ .count();
+ assertEquals(4, nb2, "SPDR-SA1-XPDR1+XPONDER (mux) should have 4 client neps");
+ long inb3 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("SPDR-SA1-XPDR1+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("iNodeEdgePoint_N"))))
+ .count();
+ assertEquals(1, inb3, "SPDR-SA1-XPDR1+XPONDER (mux) should have a single internal network nep");
+ long enb3 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("SPDR-SA1-XPDR1+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("eNodeEdgePoint_N"))))
+ .count();
+ assertEquals(4, enb3, "SPDR-SA1-XPDR1+XPONDER (mux) should have 4 external network nep");
+ long nb4 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("SPDR-SA1-XPDR2+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("NodeEdgePoint_C"))))
+ .count();
+ assertEquals(4, nb4, "SPDR-SA1-XPDR2+XPONDER (switch) should have 4 client neps");
+ long inb5 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("SPDR-SA1-XPDR2+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("iNodeEdgePoint_N"))))
+ .count();
+ assertEquals(4, inb5, "SPDR-SA1-XPDR2+XPONDER (switch) should have 4 internal network neps");
+ long enb5 = topology.getNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .filter(node -> node.getName().get(new NameKey("dsr/odu node name")).getValue()
+ .equals("SPDR-SA1-XPDR1+XPONDER"))
+ .flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
+ .filter(nep -> nep.getName().containsKey(new NameKey("eNodeEdgePoint_N"))))
+ .count();
+ assertEquals(4, enb5, "SPDR-SA1-XPDR2+XPONDER (switch) should have 4 external network neps");