From 60be2f9eca6d48db9efd1db876d846c60fddc2b6 Mon Sep 17 00:00:00 2001 From: Gilles Thouenon Date: Tue, 20 Oct 2020 18:07:49 +0200 Subject: [PATCH] TAPI topology consolidation Modify TAPI topology implementation to give an abstraction of otn-topology for otn nodes whose network ports are connected to ROADM through xponder-input/output links. Moreover, abstracts also the ROADM infrastructure through a Photonic TAPI node. As for xponder-input/output links, they are represented in by OMS links in the T0 multilayer TAPI topology. - add new method in ConvertORTopoToTapiTopo to create the ROADM infrastructure abstraction - add new method in ConvertORTopoToTapiTopo to create OMS links - create and manage a TapiTopologyException - refacto TapiTopologyImpl to improve datastore readings - refacto and improve UT for TapiTopologyImpl and ConvertORTopoToTapiTopo classes - new samples of xml files to adapt portmapping and topologies to new TAPI topology code and test cases - disable TAPI functional tests in tox JIRA: TRNSPRTPCE-341 Signed-off-by: Gilles Thouenon Co-authored-by: Christophe Betoule Change-Id: I38904051cc3e183eda2586de7a104e46d56e39c8 --- ...ject.java => ConvertORTopoToTapiTopo.java} | 215 +- .../tapi/topology/TapiTopologyException.java | 20 + .../tapi/topology/TapiTopologyImpl.java | 219 +- ...onvertORTopoObjectToTapiTooObjectTest.java | 756 ++++ .../tapi/topology/TapiTopologyImplTest.java | 448 +-- .../tapi/utils/TopologyDataUtils.java | 5 +- ...ology2.xml => get_openroadm-topology2.xml} | 1464 ++++---- tapi/src/test/resources/get_portmapping.xml | 745 ++++ .../src/test/resources/openroadm-topology.xml | 3216 ----------------- .../resources/otn-topology-with-otn-links.xml | 32 +- tapi/src/test/resources/otn-topology.xml | 282 -- .../test/resources/portmapping-example.xml | 260 -- tox.ini | 2 +- 13 files changed, 2725 insertions(+), 4939 deletions(-) rename tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/{ConvertORTopoObjectToTapiTopoObject.java => ConvertORTopoToTapiTopo.java} (73%) create mode 100644 tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyException.java create mode 100644 tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoObjectToTapiTooObjectTest.java rename tapi/src/test/resources/{openroadm-topology2.xml => get_openroadm-topology2.xml} (88%) create mode 100644 tapi/src/test/resources/get_portmapping.xml delete mode 100644 tapi/src/test/resources/openroadm-topology.xml delete mode 100644 tapi/src/test/resources/otn-topology.xml delete mode 100644 tapi/src/test/resources/portmapping-example.xml diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoObjectToTapiTopoObject.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java similarity index 73% rename from tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoObjectToTapiTopoObject.java rename to tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java index 8e8119150..2e8c183bd 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoObjectToTapiTopoObject.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java @@ -10,9 +10,12 @@ package org.opendaylight.transportpce.tapi.topology; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.UUID; import java.util.stream.Collectors; import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.TerminationPoint1; @@ -76,13 +79,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class ConvertORTopoObjectToTapiTopoObject { +public class ConvertORTopoToTapiTopo { private static final String DSR = "DSR"; private static final String OTSI = "OTSi"; private static final String E_OTSI = "eOTSi"; private static final String I_OTSI = "iOTSi"; - private static final Logger LOG = LoggerFactory.getLogger(ConvertORTopoObjectToTapiTopoObject.class); + private static final String RDM_INFRA = "ROADM-infra"; + private static final Logger LOG = LoggerFactory.getLogger(ConvertORTopoToTapiTopo.class); private String ietfNodeId; private List oorClientPortList; private List oorNetworkPortList; @@ -94,14 +98,14 @@ public class ConvertORTopoObjectToTapiTopoObject { private Map uuidMap; - public ConvertORTopoObjectToTapiTopoObject(Uuid tapiTopoUuid) { + public ConvertORTopoToTapiTopo(Uuid tapiTopoUuid) { this.tapiTopoUuid = tapiTopoUuid; this.tapiNodes = new HashMap<>(); this.tapiLinks = new HashMap<>(); this.uuidMap = new HashMap<>(); } - public void convertNode(Node ietfNode) { + public void convertNode(Node ietfNode, List networkPorts) { this.ietfNodeId = ietfNode.getNodeId().getValue(); this.oorClientPortList = ietfNode.augmentation( org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class) @@ -114,7 +118,8 @@ public class ConvertORTopoObjectToTapiTopoObject { org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class) .getTerminationPoint().values().stream() .filter(tp -> tp.augmentation(TerminationPoint1.class).getTpType().getIntValue() - == OpenroadmTpType.XPONDERNETWORK.getIntValue()) + == OpenroadmTpType.XPONDERNETWORK.getIntValue() + && networkPorts.contains(tp.getTpId().getValue())) .sorted((tp1, tp2) -> tp1.getTpId().getValue().compareTo(tp2.getTpId().getValue())) .collect(Collectors.toList()); this.oorOduSwitchingPool = ietfNode.augmentation(Node1.class).getSwitchingPools().getOduSwitchingPools() @@ -164,6 +169,83 @@ public class ConvertORTopoObjectToTapiTopoObject { } } + public void convertRoadmInfrastructure() { + LOG.info("abstraction of the ROADM infrastructure towards a photonic node"); + Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(RDM_INFRA.getBytes(Charset.forName("UTF-8"))).toString()); + Name nodeName = new NameBuilder().setValueName("otsi node name").setValue(RDM_INFRA).build(); + List nodeLayerProtocols = Arrays.asList(LayerProtocolName.PHOTONICMEDIA); + + List tapiPhotonicNodes + = pruneTapiPhotonicNodes(); + Map photonicNepUuisMap = convertListNodeWithListNepToMapForUuidAndName(tapiPhotonicNodes); + // nep creation for rdm infra abstraction node + Map onepMap = createNepForRdmNode(photonicNepUuisMap.size()); + // node rule group creation + Map nodeRuleGroupList + = createNodeRuleGroupForRdmNode(nodeUuid, onepMap.values()); + // build RDM infra node abstraction + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node rdmNode = new NodeBuilder() + .setUuid(nodeUuid) + .setName(Map.of(nodeName.key(), nodeName)) + .setLayerProtocolName(nodeLayerProtocols) + .setAdministrativeState(AdministrativeState.UNLOCKED) + .setOperationalState(OperationalState.ENABLED) + .setLifecycleState(LifecycleState.INSTALLED) + .setOwnedNodeEdgePoint(onepMap) + .setNodeRuleGroup(nodeRuleGroupList) + .build(); + tapiNodes.put(rdmNode.key(), rdmNode); + + // OMS link creation between photonoci nodes and RDM infra abstraction node + Map rdmInfraNepUuisMap = convertListNodeWithListNepToMapForUuidAndName(List.of(rdmNode)); + if (photonicNepUuisMap.size() != rdmInfraNepUuisMap.size()) { + LOG.warn("Unable to build OMS links between photonics nodes and RDM infrasctructure abstraction"); + } else { + createTapiOmsLinks(photonicNepUuisMap, rdmInfraNepUuisMap); + } + } + + private List + pruneTapiPhotonicNodes() { + List + prunedTapiPhotonicNodes = new ArrayList<>(); + List tapiPhotonicNodes + = this.tapiNodes.values().stream() + .filter(n -> LayerProtocolName.PHOTONICMEDIA.equals(n.getLayerProtocolName().get(0))) + .collect(Collectors.toList()); + for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node + : tapiPhotonicNodes) { + Map onepM = new HashMap<>(); + for (Map.Entry entry : node.getOwnedNodeEdgePoint().entrySet()) { + if (entry.getValue().getName().values().stream() + .filter(name -> name.getValueName().startsWith("eNodeEdgePoint")) + .count() > 0) { + onepM.put(entry.getKey(), entry.getValue()); + } + } + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node prunedNode + = new NodeBuilder(node).setOwnedNodeEdgePoint(onepM).build(); + prunedTapiPhotonicNodes.add(prunedNode); + } + return prunedTapiPhotonicNodes; + } + + private Map convertListNodeWithListNepToMapForUuidAndName( + List nodes) { + Map uuidNameMap = new HashMap<>(); + for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node : nodes) { + for (OwnedNodeEdgePoint nep : node.nonnullOwnedNodeEdgePoint().values()) { + String nodeUuid = node.getUuid().getValue(); + String nepUuid = nep.getUuid().getValue(); + String nodeName = node.getName().get(new NameKey("otsi node name")).getValue(); + String nepName = nep.getName().get(new NameKey(nep.getName().keySet().stream().findFirst().get())) + .getValue(); + uuidNameMap.put(String.join("--", nodeUuid, nepUuid), String.join("--", nodeName, nepName)); + } + } + return uuidNameMap; + } + private org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology .Node createTapiNode(Map nodeNames, List layerProtocols) { Uuid nodeUuid = null; @@ -184,9 +266,6 @@ public class ConvertORTopoObjectToTapiTopoObject { LOG.error("Undefined LayerProtocolName for {} node {}", nodeNames.get(nodeNames.keySet().iterator().next()) .getValueName(), nodeNames.get(nodeNames.keySet().iterator().next()).getValue()); } - - // create tapi node - return new NodeBuilder() .setUuid(nodeUuid) .setName(nodeNames) @@ -319,14 +398,16 @@ public class ConvertORTopoObjectToTapiTopoObject { org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint> nepList = new HashMap<>(); for (TpId tp : nbl.getTpList()) { - org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group - .NodeEdgePoint nep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210 - .node.rule.group.NodeEdgePointBuilder() - .setTopologyUuid(tapiTopoUuid) - .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId, DSR))) - .setNodeEdgePointUuid(this.uuidMap.get(String.join("+", this.ietfNodeId, DSR, tp.getValue()))) - .build(); - nepList.put(nep.key(), nep); + if (this.uuidMap.containsKey(String.join("+", this.ietfNodeId, DSR, tp.getValue()))) { + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint + nep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group + .NodeEdgePointBuilder() + .setTopologyUuid(tapiTopoUuid) + .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId, DSR))) + .setNodeEdgePointUuid(this.uuidMap.get(String.join("+", this.ietfNodeId, DSR, tp.getValue()))) + .build(); + nepList.put(nep.key(), nep); + } } NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder() .setUuid(new Uuid( @@ -359,6 +440,63 @@ public class ConvertORTopoObjectToTapiTopoObject { return onepBldr.build(); } + private Map createNepForRdmNode(int nbNep) { + Map onepMap = new HashMap<>(); + for (int i = 1; i <= nbNep; i++) { + Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "roadm node", "nep", String.valueOf(i))) + .getBytes(Charset.forName("UTF-8"))).toString()); + Name nepName = new NameBuilder() + .setValueName("NodeEdgePoint name") + .setValue(new StringBuilder("NodeEdgePoint_").append(i).toString()) + .build(); + OwnedNodeEdgePoint onep = new OwnedNodeEdgePointBuilder() + .setUuid(nepUuid) + .setLayerProtocolName(LayerProtocolName.PHOTONICMEDIA) + .setName(Map.of(nepName.key(), nepName)) + .setSupportedCepLayerProtocolQualifier(List.of(PHOTONICLAYERQUALIFIEROMS.class)) + .setLinkPortDirection(PortDirection.BIDIRECTIONAL).setLinkPortRole(PortRole.SYMMETRIC) + .setAdministrativeState(AdministrativeState.UNLOCKED).setOperationalState(OperationalState.ENABLED) + .setLifecycleState(LifecycleState.INSTALLED).setTerminationDirection(TerminationDirection.BIDIRECTIONAL) + .setTerminationState(TerminationState.TERMINATEDBIDIRECTIONAL) + .build(); + onepMap.put(onep.key(), onep); + } + return onepMap; + } + + private Map createNodeRuleGroupForRdmNode(Uuid nodeUuid, + Collection onepl) { + Map + nepMap = new HashMap<>(); + for (OwnedNodeEdgePoint onep : onepl) { + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint + nep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group + .NodeEdgePointBuilder() + .setTopologyUuid(tapiTopoUuid) + .setNodeUuid(nodeUuid) + .setNodeEdgePointUuid(onep.key().getUuid()) + .build(); + nepMap.put(nep.key(), nep); + } + Map nodeRuleGroupMap = new HashMap<>(); + Map ruleList = new HashMap<>(); + Rule rule = new RuleBuilder() + .setLocalId("forward") + .setForwardingRule(ForwardingRule.MAYFORWARDACROSSGROUP) + .setRuleType(RuleType.FORWARDING) + .build(); + ruleList.put(rule.key(), rule); + NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder() + .setUuid(new Uuid(UUID.nameUUIDFromBytes(("rdm infra node rule group").getBytes(Charset.forName("UTF-8"))) + .toString())) + .setRule(ruleList) + .setNodeEdgePoint(nepMap) + .build(); + nodeRuleGroupMap.put(nodeRuleGroup.key(), nodeRuleGroup); + return nodeRuleGroupMap; + } + private Map createSIP(int nb) { Map msipl = new HashMap<>(); for (int i = 0; i < nb; i++) { @@ -540,6 +678,46 @@ public class ConvertORTopoObjectToTapiTopoObject { } } + private void createTapiOmsLinks(Map photonicNepUuisMap, Map rdmInfraNepUuisMap) { + Iterator> it1 = photonicNepUuisMap.entrySet().iterator(); + Iterator> it2 = rdmInfraNepUuisMap.entrySet().iterator(); + while (it1.hasNext()) { + Map nepMap = new HashMap<>(); + Map.Entry photonicEntry = it1.next(); + Map.Entry rdmEntry = it2.next(); + Uuid sourceUuidTp = new Uuid(photonicEntry.getKey().split("--")[1]); + Uuid sourceUuidNode = new Uuid(photonicEntry.getKey().split("--")[0]); + Uuid destUuidTp = new Uuid(rdmEntry.getKey().split("--")[1]); + Uuid destUuidNode = new Uuid(rdmEntry.getKey().split("--")[0]); + NodeEdgePoint sourceNep = new NodeEdgePointBuilder() + .setTopologyUuid(this.tapiTopoUuid) + .setNodeUuid(sourceUuidNode) + .setNodeEdgePointUuid(sourceUuidTp) + .build(); + nepMap.put(sourceNep.key(), sourceNep); + NodeEdgePoint destNep = new NodeEdgePointBuilder() + .setTopologyUuid(this.tapiTopoUuid) + .setNodeUuid(destUuidNode) + .setNodeEdgePointUuid(destUuidTp) + .build(); + nepMap.put(destNep.key(), destNep); + Name linkName = new NameBuilder().setValueName("OMS link name") + .setValue(String.join(" and ", photonicEntry.getValue(), rdmEntry.getValue())) + .build(); + Link omsLink = new LinkBuilder() + .setUuid(new Uuid( + UUID.nameUUIDFromBytes((String.join(" and ", photonicEntry.getValue(), rdmEntry.getValue())) + .getBytes(Charset.forName("UTF-8"))) + .toString())) + .setName(Map.of(linkName.key(), linkName)) + .setLayerProtocolName(List.of(LayerProtocolName.PHOTONICMEDIA)) + .setNodeEdgePoint(nepMap) + .setDirection(ForwardingDirection.BIDIRECTIONAL) + .build(); + this.tapiLinks.put(omsLink.key(), omsLink); + } + } + public Map getTapiNodes() { return tapiNodes; @@ -548,9 +726,4 @@ public class ConvertORTopoObjectToTapiTopoObject { public Map getTapiLinks() { return tapiLinks; } - - public Map getUuidMap() { - return uuidMap; - } - } \ No newline at end of file diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyException.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyException.java new file mode 100644 index 000000000..c7557f234 --- /dev/null +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyException.java @@ -0,0 +1,20 @@ +/* + * Copyright © 2020 Orange, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.transportpce.tapi.topology; + + +public class TapiTopologyException extends Exception { + + public TapiTopologyException(String message) { + super(message); + } + + public TapiTopologyException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImpl.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImpl.java index 6b23a299c..4a6625632 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImpl.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImpl.java @@ -13,9 +13,10 @@ import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.NoSuchElementException; +import java.util.Map.Entry; import java.util.Optional; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -35,6 +36,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130. import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev181130.OpenroadmLinkType; import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev181130.OpenroadmNodeType; import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev181130.OpenroadmTpType; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Network1; @@ -102,55 +104,31 @@ public class TapiTopologyImpl implements TapiTopologyService { @Override public ListenableFuture> getTopologyDetails(GetTopologyDetailsInput input) { - LOG.info("Building TAPI Topology abstraction from {}", input.getTopologyIdOrName()); - Topology topology = null; - switch (input.getTopologyIdOrName()) { - case NetworkUtils.OVERLAY_NETWORK_ID: - topology = createAbstractedOpenroadmTopology(); - break; - case NetworkUtils.OTN_NETWORK_ID: - topology = createAbstractedOtnTopology(); - break; - default: - LOG.error("{} unknown - can not be abstracted", input.getTopologyIdOrName()); - break; - } - if (topology != null) { + try { + LOG.info("Building TAPI Topology abstraction from {}", input.getTopologyIdOrName()); + Topology topology = null; + switch (input.getTopologyIdOrName()) { + case NetworkUtils.OVERLAY_NETWORK_ID: + topology = createAbstractedOpenroadmTopology(); + break; + case NetworkUtils.OTN_NETWORK_ID: + topology = createAbstractedOtnTopology(); + break; + default: + LOG.error("{} unknown - can not be abstracted", input.getTopologyIdOrName()); + break; + } return RpcResultBuilder.success(new GetTopologyDetailsOutputBuilder().setTopology(topology).build()) .buildFuture(); - } else { + } catch (TapiTopologyException e) { return RpcResultBuilder.success(new GetTopologyDetailsOutputBuilder().build()).buildFuture(); } } - private Topology createAbstractedOpenroadmTopology() { + private Topology createAbstractedOpenroadmTopology() throws TapiTopologyException { // read openroadm-topology - @NonNull - FluentFuture> openroadmTopoOpt = dataBroker.newReadOnlyTransaction() - .read(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.OVERLAY_NETWORK_II); - if (!openroadmTopoOpt.isDone()) { - LOG.warn("Cannot get openroadm topology, returning null"); - return null; - } - Optional optionalOpenroadmTop = null; - try { - optionalOpenroadmTop = openroadmTopoOpt.get(); - } catch (InterruptedException e) { - //sonar : "InterruptedException" should not be ignored (java:S2142) - //https://www.ibm.com/developerworks/java/library/j-jtp05236/index.html?ca=drs-#2.1 - Thread.currentThread().interrupt(); - return null; - } catch (ExecutionException | NoSuchElementException e) { - LOG.error("Impossible to retrieve openroadm-topology from mdsal", e); - return null; - } - - if (!optionalOpenroadmTop.isPresent()) { - LOG.warn("Openroadm topology is not present, returning null"); - return null; - } - Network openroadmTopo = optionalOpenroadmTop.get(); - List nodeList = new ArrayList<>(openroadmTopo.getNode().values()); + Network openroadmTopo = readTopology(InstanceIdentifiers.OVERLAY_NETWORK_II); + List xpdrNodeList = pruneOpenroadmNodes(openroadmTopo); List linkList = null; if (openroadmTopo.augmentation(Network1.class) != null) { linkList = new ArrayList<>(openroadmTopo.augmentation(Network1.class).getLink().values()); @@ -163,13 +141,6 @@ public class TapiTopologyImpl implements TapiTopologyService { List xponderInLinkList = linkList.stream() .filter(lk -> lk.augmentation(Link1.class).getLinkType().equals(OpenroadmLinkType.XPONDERINPUT)) .collect(Collectors.toList()); - - List xpdrNodeList = nodeList - .stream() - .filter(nt -> nt - .augmentation(org.opendaylight.yang.gen.v1 - .http.org.openroadm.common.network.rev181130.Node1.class) - .getNodeType().equals(OpenroadmNodeType.XPONDER)).collect(Collectors.toList()); Map> clientPortMap = new HashMap<>(); for (Node node : xpdrNodeList) { String nodeId = node.getSupportingNode().values().stream() @@ -199,7 +170,30 @@ public class TapiTopologyImpl implements TapiTopologyService { = createTapiNode(goodTpList); tapiNodeList.put(node.key(), node); return new TopologyBuilder().setName(names).setUuid(uuid).setNode(tapiNodeList).build(); + } + private Network readTopology(InstanceIdentifier networkIID) + throws TapiTopologyException { + Network topology = null; + FluentFuture> topologyFuture = dataBroker.newReadOnlyTransaction() + .read(LogicalDatastoreType.CONFIGURATION, networkIID); + try { + topology = topologyFuture.get().get(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new TapiTopologyException("Unable to get from mdsal topology: " + networkIID + .firstKeyOf(Network.class).getNetworkId().getValue(), e); + } catch (ExecutionException e) { + throw new TapiTopologyException("Unable to get from mdsal topology: " + networkIID + .firstKeyOf(Network.class).getNetworkId().getValue(), e); + } + return topology; + } + + private List pruneOpenroadmNodes(Network openroadmTopo) { + return openroadmTopo.getNode().values().stream().filter(nt -> nt + .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Node1.class) + .getNodeType().equals(OpenroadmNodeType.XPONDER)).collect(Collectors.toList()); } private List extractGoodTpList(Map> clientPortMap) { @@ -214,53 +208,84 @@ public class TapiTopologyImpl implements TapiTopologyService { return goodTpList; } - private Topology createAbstractedOtnTopology() { + private Topology createAbstractedOtnTopology() throws TapiTopologyException { + // read openroadm-topology + Network openroadmTopo = readTopology(InstanceIdentifiers.OVERLAY_NETWORK_II); + List linkList = new ArrayList<>(); + if (openroadmTopo.augmentation(Network1.class) != null) { + linkList.addAll(openroadmTopo.augmentation(Network1.class).getLink().values()); + } + List xponderOutLinkList = linkList.stream() + .filter(lk -> lk.augmentation(Link1.class).getLinkType().equals(OpenroadmLinkType.XPONDEROUTPUT)) + .collect(Collectors.toList()); + List xponderInLinkList = linkList.stream() + .filter(lk -> lk.augmentation(Link1.class).getLinkType().equals(OpenroadmLinkType.XPONDERINPUT)) + .collect(Collectors.toList()); // read otn-topology - @NonNull - FluentFuture> otnTopoOpt = dataBroker.newReadOnlyTransaction().read( - LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.OTN_NETWORK_II); - if (otnTopoOpt.isDone()) { - Network otnTopo = null; - try { - otnTopo = otnTopoOpt.get().get(); - } catch (InterruptedException | ExecutionException | NoSuchElementException e) { - LOG.error("Impossible to retreive otn-topology from mdsal",e); - return null; - } - List nodeList = new ArrayList<>(otnTopo.getNode().values()); - List otnNodeList = nodeList.stream().filter(nt -> nt.augmentation( + Network otnTopo = readTopology(InstanceIdentifiers.OTN_NETWORK_II); + Map otnNodeMap = otnTopo.nonnullNode().values().stream().filter(nt -> nt.augmentation( + org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Node1.class) + .getNodeType().equals(OpenroadmNodeType.SWITCH) || nt.augmentation( org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Node1.class) - .getNodeType().equals(OpenroadmNodeType.SWITCH) || nt.augmentation( - org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Node1.class) - .getNodeType().equals(OpenroadmNodeType.MUXPDR)).collect(Collectors.toList()); - Map - tapiNodeList = new HashMap<>(); - Map - tapiLinkList = new HashMap<>(); - Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(T0_MULTI_LAYER_TOPO.getBytes(Charset.forName("UTF-8"))) - .toString()); - ConvertORTopoObjectToTapiTopoObject tapiFactory = new ConvertORTopoObjectToTapiTopoObject(topoUuid); - for (Node node : otnNodeList) { - tapiFactory.convertNode(node); - tapiNodeList.putAll(tapiFactory.getTapiNodes()); - tapiLinkList.putAll(tapiFactory.getTapiLinks()); + .getNodeType().equals(OpenroadmNodeType.MUXPDR)) + .collect(Collectors.toMap(Node::getNodeId, node -> node)); + + Map> networkPortMap = new HashMap<>(); + Iterator> itOtnNodeMap = otnNodeMap.entrySet().iterator(); + while (itOtnNodeMap.hasNext()) { + Entry entry = itOtnNodeMap.next(); + String portMappingNodeId = entry.getValue().getSupportingNode().values().stream() + .filter(sn -> sn.getNetworkRef().getValue().equals(NetworkUtils.UNDERLAY_NETWORK_ID)) + .findFirst() + .get().getNodeRef().getValue(); + List networkPortList = new ArrayList<>(); + for (TerminationPoint tp : entry.getValue().augmentation(Node1.class).getTerminationPoint().values()) { + if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK) + && + checkTp(entry.getKey().getValue(), portMappingNodeId, tp, xponderOutLinkList, xponderInLinkList)) { + networkPortList.add(tp.getTpId().getValue()); + } } - if (otnTopo.augmentation(Network1.class) != null) { - List otnLinkList = new ArrayList<>(otnTopo.augmentation(Network1.class).getLink().values()); - Collections.sort(otnLinkList, (l1, l2) -> l1.getLinkId().getValue() - .compareTo(l2.getLinkId().getValue())); - tapiFactory.convertLinks(otnLinkList); - tapiLinkList.putAll(tapiFactory.getTapiLinks()); + if (!networkPortList.isEmpty()) { + networkPortMap.put(entry.getKey().getValue(), networkPortList); } - Name name = new NameBuilder().setValue(T0_MULTI_LAYER_TOPO).setValueName("TAPI Topology Name").build(); - return new TopologyBuilder() - .setName(Map.of(name.key(), name)) - .setUuid(topoUuid) - .setNode(tapiNodeList) - .setLink(tapiLinkList).build(); + } + Map + tapiNodeList = new HashMap<>(); + Map + tapiLinkList = new HashMap<>(); + Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(T0_MULTI_LAYER_TOPO.getBytes(Charset.forName("UTF-8"))) + .toString()); + ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topoUuid); + Iterator>> it = networkPortMap.entrySet().iterator(); + while (it.hasNext()) { + String nodeId = it.next().getKey(); + tapiFactory.convertNode(otnNodeMap.get(new NodeId(nodeId)), networkPortMap.get(nodeId)); + tapiNodeList.putAll(tapiFactory.getTapiNodes()); + tapiLinkList.putAll(tapiFactory.getTapiLinks()); + } + if (openroadmTopo.nonnullNode().values().stream().filter(nt -> + nt.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Node1.class) + .getNodeType().equals(OpenroadmNodeType.SRG)).count() > 0) { + tapiFactory.convertRoadmInfrastructure(); + tapiNodeList.putAll(tapiFactory.getTapiNodes()); + tapiLinkList.putAll(tapiFactory.getTapiLinks()); } else { - return null; + LOG.warn("Unable to abstract an ROADM infrasctructure from openroadm-topology"); + } + if (otnTopo.augmentation(Network1.class) != null) { + List otnLinkList = new ArrayList<>(otnTopo.augmentation(Network1.class).getLink().values()); + Collections.sort(otnLinkList, (l1, l2) -> l1.getLinkId().getValue() + .compareTo(l2.getLinkId().getValue())); + tapiFactory.convertLinks(otnLinkList); + tapiLinkList.putAll(tapiFactory.getTapiLinks()); } + Name name = new NameBuilder().setValue(T0_MULTI_LAYER_TOPO).setValueName("TAPI Topology Name").build(); + return new TopologyBuilder() + .setName(Map.of(name.key(), name)) + .setUuid(topoUuid) + .setNode(tapiNodeList) + .setLink(tapiLinkList).build(); } @Override @@ -326,10 +351,14 @@ public class TapiTopologyImpl implements TapiTopologyService { private boolean checkTp(String nodeIdTopo, String nodeIdPortMap, TerminationPoint tp, List xpdOut, List< Link> xpdIn) { - @Nullable - String networkLcp = tp.augmentation( - org.opendaylight.yang.gen.v1.http.transportpce.topology.rev200129.TerminationPoint1.class) - .getAssociatedConnectionMapPort(); + String networkLcp; + if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERCLIENT)) { + networkLcp = tp.augmentation( + org.opendaylight.yang.gen.v1.http.transportpce.topology.rev200129.TerminationPoint1.class) + .getAssociatedConnectionMapPort(); + } else { + networkLcp = tp.getTpId().getValue(); + } @NonNull KeyedInstanceIdentifier pmIID = InstanceIdentifier.create( org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.Network.class) diff --git a/tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoObjectToTapiTooObjectTest.java b/tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoObjectToTapiTooObjectTest.java new file mode 100644 index 000000000..61e0a073f --- /dev/null +++ b/tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoObjectToTapiTooObjectTest.java @@ -0,0 +1,756 @@ +/* + * Copyright © 2020 Orange, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.transportpce.tapi.topology; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.either; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.hasItems; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; + +import com.google.common.util.concurrent.FluentFuture; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; +import org.eclipse.jdt.annotation.Nullable; +import org.junit.BeforeClass; +import org.junit.Test; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.transportpce.common.InstanceIdentifiers; +import org.opendaylight.transportpce.tapi.utils.TopologyDataUtils; +import org.opendaylight.transportpce.test.AbstractTest; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.TerminationPoint1; +import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev181130.OpenroadmTpType; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.NetworkKey; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.NodeKey; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Network1; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPoint; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.AdministrativeState; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.CapacityUnit; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.ForwardingDirection; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LayerProtocolName; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LifecycleState; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.OperationalState; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.PortDirection; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.PortRole; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.TerminationDirection; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.TerminationState; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Uuid; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameKey; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.dsr.rev181210.DIGITALSIGNALTYPE100GigE; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.dsr.rev181210.DIGITALSIGNALTYPE10GigELAN; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU2E; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU4; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev181210.PHOTONICLAYERQUALIFIEROMS; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev181210.PHOTONICLAYERQUALIFIEROTSi; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.ForwardingRule; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.RuleType; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.NodeRuleGroup; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.OwnedNodeEdgePoint; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.Rule; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Link; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ConvertORTopoObjectToTapiTooObjectTest extends AbstractTest { + private static final Logger LOG = LoggerFactory.getLogger(ConvertORTopoObjectToTapiTooObjectTest.class); + + private static Node otnMuxA; + private static Node otnMuxC; + private static Node otnSwitch; + private static List otnLinks; + private static Uuid topologyUuid; + private static DataBroker dataBroker = getDataBroker(); + + @BeforeClass + public static void setUp() throws InterruptedException, ExecutionException { + TopologyDataUtils.writeTopologyFromFileToDatastore(getDataStoreContextUtil(), + TopologyDataUtils.OPENROADM_TOPOLOGY_FILE, InstanceIdentifiers.OVERLAY_NETWORK_II); + TopologyDataUtils.writeTopologyFromFileToDatastore(getDataStoreContextUtil(), + TopologyDataUtils.OTN_TOPOLOGY_WITH_OTN_LINKS_FILE, InstanceIdentifiers.OTN_NETWORK_II); + TopologyDataUtils.writePortmappingFromFileToDatastore(getDataStoreContextUtil()); + + KeyedInstanceIdentifier muxAIID = InstanceIdentifier.create(Networks.class) + .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network + .class, new NetworkKey(new NetworkId("otn-topology"))) + .child(Node.class, new NodeKey(new NodeId("SPDR-SA1-XPDR1"))); + FluentFuture> muxAFuture = dataBroker.newReadOnlyTransaction() + .read(LogicalDatastoreType.CONFIGURATION, muxAIID); + KeyedInstanceIdentifier muxCIID = InstanceIdentifier.create(Networks.class) + .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network + .class, new NetworkKey(new NetworkId("otn-topology"))) + .child(Node.class, new NodeKey(new NodeId("SPDR-SC1-XPDR1"))); + FluentFuture> muxCFuture = dataBroker.newReadOnlyTransaction() + .read(LogicalDatastoreType.CONFIGURATION, muxCIID); + KeyedInstanceIdentifier switchIID = InstanceIdentifier.create(Networks.class) + .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network + .class, new NetworkKey(new NetworkId("otn-topology"))) + .child(Node.class, new NodeKey(new NodeId("SPDR-SA1-XPDR2"))); + FluentFuture> switchFuture = dataBroker.newReadOnlyTransaction() + .read(LogicalDatastoreType.CONFIGURATION, switchIID); + otnMuxA = muxAFuture.get().get(); + otnMuxC = muxCFuture.get().get(); + otnSwitch = switchFuture.get().get(); + + InstanceIdentifier linksIID = InstanceIdentifier.create(Networks.class) + .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network + .class, new NetworkKey(new NetworkId("otn-topology"))) + .augmentation(Network1.class); + FluentFuture> linksFuture = dataBroker.newReadOnlyTransaction() + .read(LogicalDatastoreType.CONFIGURATION, linksIID); + otnLinks = linksFuture.get().get().getLink().values().stream().collect(Collectors.toList()); + Collections.sort(otnLinks, (l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue())); + topologyUuid = new Uuid(UUID.nameUUIDFromBytes("T0 - Multi-layer topology".getBytes(Charset.forName("UTF-8"))) + .toString()); + LOG.info("TEST SETUP READY"); + } + + @Test + public void convertNodeForOtnMuxponder() { + ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid); + List networkPortList = new ArrayList<>(); + for (TerminationPoint tp : otnMuxA.augmentation(Node1.class).getTerminationPoint().values()) { + if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) { + networkPortList.add(tp.getTpId().getValue()); + } + } + tapiFactory.convertNode(otnMuxA, networkPortList); + List tapiNodes + = tapiFactory.getTapiNodes().values().stream() + .sorted((n1, n2) -> n1.getUuid().getValue().compareTo(n2.getUuid().getValue())) + .collect(Collectors.toList()); + + assertEquals("Node list size should be 2", 2, tapiFactory.getTapiNodes().size()); + assertEquals("Link list size should be 1", 1, tapiFactory.getTapiLinks().size()); + + Uuid dsrNodeUuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+DSR".getBytes(Charset.forName("UTF-8"))) + .toString()); + checkDsrNode(tapiNodes.get(0), dsrNodeUuid, false, "SPDR-SA1-XPDR1"); + Uuid otsiNodeUuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+OTSi".getBytes(Charset.forName("UTF-8"))) + .toString()); + checkOtsiNode(tapiNodes.get(1), otsiNodeUuid, "mux", "SPDR-SA1-XPDR1"); + + List tapiLinks = tapiFactory.getTapiLinks().values().stream() + .sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue())) + .collect(Collectors.toList()); + checkTransitionalLink(tapiLinks.get(0), dsrNodeUuid, otsiNodeUuid, + "SPDR-SA1-XPDR1+DSR+XPDR1-NETWORK1", "SPDR-SA1-XPDR1+iOTSi+XPDR1-NETWORK1", "SPDR-SA1-XPDR1"); + } + + @Test + public void convertNodeForOtnSwitch() { + ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid); + List networkPortList = new ArrayList<>(); + for (TerminationPoint tp : otnSwitch.augmentation(Node1.class).getTerminationPoint().values()) { + if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) { + networkPortList.add(tp.getTpId().getValue()); + } + } + tapiFactory.convertNode(otnSwitch, networkPortList); + List tapiNodes + = tapiFactory.getTapiNodes().values().stream() + .sorted((n1, n2) -> n1.getUuid().getValue().compareTo(n2.getUuid().getValue())) + .collect(Collectors.toList()); + + assertEquals("Node list size should be 2", 2, tapiFactory.getTapiNodes().size()); + assertEquals("Link list size should be 4", 4, tapiFactory.getTapiLinks().size()); + + Uuid dsrNodeUuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR2+DSR".getBytes(Charset.forName("UTF-8"))) + .toString()); + checkDsrNode(tapiNodes.get(0), dsrNodeUuid, true, "SPDR-SA1-XPDR2"); + Uuid otsiNodeUuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR2+OTSi".getBytes(Charset.forName("UTF-8"))) + .toString()); + checkOtsiNode(tapiNodes.get(1), otsiNodeUuid, "switch", "SPDR-SA1-XPDR2"); + + List tapiLinks = tapiFactory.getTapiLinks().values().stream() + .sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue())) + .collect(Collectors.toList()); + checkTransitionalLink(tapiLinks.get(0), dsrNodeUuid, otsiNodeUuid, + "SPDR-SA1-XPDR2+DSR+XPDR2-NETWORK4", "SPDR-SA1-XPDR2+iOTSi+XPDR2-NETWORK4", "SPDR-SA1-XPDR2"); + } + + @Test + public void convertOtnLink() { + ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid); + List networkPortListA = new ArrayList<>(); + for (TerminationPoint tp : otnMuxA.augmentation(Node1.class).getTerminationPoint().values()) { + if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) { + networkPortListA.add(tp.getTpId().getValue()); + } + } + tapiFactory.convertNode(otnMuxA, networkPortListA); + List networkPortListC = new ArrayList<>(); + for (TerminationPoint tp : otnMuxC.augmentation(Node1.class).getTerminationPoint().values()) { + if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) { + networkPortListC.add(tp.getTpId().getValue()); + } + } + tapiFactory.convertNode(otnMuxC, networkPortListC); + tapiFactory.convertLinks(otnLinks); + assertEquals("Link list size should be 4", 4, tapiFactory.getTapiLinks().size()); + + Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+DSR".getBytes(Charset.forName("UTF-8"))) + .toString()); + Uuid node2Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SC1-XPDR1+DSR".getBytes(Charset.forName("UTF-8"))) + .toString()); + Uuid node3Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+OTSi".getBytes(Charset.forName("UTF-8"))) + .toString()); + Uuid node4Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SC1-XPDR1+OTSi".getBytes(Charset.forName("UTF-8"))) + .toString()); + Uuid tp1Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+DSR+XPDR1-NETWORK1" + .getBytes(Charset.forName("UTF-8"))).toString()); + Uuid tp2Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SC1-XPDR1+DSR+XPDR1-NETWORK1" + .getBytes(Charset.forName("UTF-8"))).toString()); + Uuid tp3Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+iOTSi+XPDR1-NETWORK1" + .getBytes(Charset.forName("UTF-8"))).toString()); + Uuid tp4Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SC1-XPDR1+iOTSi+XPDR1-NETWORK1" + .getBytes(Charset.forName("UTF-8"))).toString()); + Uuid link1Uuid = + new Uuid(UUID.nameUUIDFromBytes("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1" + .getBytes(Charset.forName("UTF-8"))).toString()); + Uuid link2Uuid = + new Uuid(UUID.nameUUIDFromBytes("OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1" + .getBytes(Charset.forName("UTF-8"))).toString()); + + List links = tapiFactory.getTapiLinks().values().stream() + .sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue())) + .collect(Collectors.toList()); + checkOtnLink(links.get(0), node1Uuid, node2Uuid, tp1Uuid, tp2Uuid, link1Uuid, + "ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"); + checkOtnLink(links.get(2), node3Uuid, node4Uuid, tp3Uuid, tp4Uuid, link2Uuid, + "OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"); + } + + @Test + public void convertRoadmInfrastructureWhenNoXponderAttached() { + ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid); + tapiFactory.convertRoadmInfrastructure(); + + assertEquals("Node list size should be 1", 1, tapiFactory.getTapiNodes().size()); + assertEquals("Link list size should be empty", 0, tapiFactory.getTapiLinks().size()); + List tapiNodes + = tapiFactory.getTapiNodes().values().stream().collect(Collectors.toList()); + Uuid otsiNodeUuid = new Uuid(UUID.nameUUIDFromBytes("ROADM-infra".getBytes(Charset.forName("UTF-8"))) + .toString()); + checkOtsiNode(tapiNodes.get(0), otsiNodeUuid, "infra", "ROADM-infra"); + } + + @Test + public void convertRoadmInfrastructureWhenOtnMuxAttached() { + ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid); + List networkPortListA = new ArrayList<>(); + for (TerminationPoint tp : otnMuxA.augmentation(Node1.class).getTerminationPoint().values()) { + if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) { + networkPortListA.add(tp.getTpId().getValue()); + } + } + tapiFactory.convertNode(otnMuxA, networkPortListA); + tapiFactory.convertRoadmInfrastructure(); + + assertEquals("Node list size should be 3", 3, tapiFactory.getTapiNodes().size()); + assertEquals("Link list size should be 2", 2, tapiFactory.getTapiLinks().size()); + List tapiNodes + = tapiFactory.getTapiNodes().values().stream() + .sorted((n1, n2) -> n1.getUuid().getValue().compareTo(n2.getUuid().getValue())) + .collect(Collectors.toList()); + Uuid otsiNodeUuid = new Uuid(UUID.nameUUIDFromBytes("ROADM-infra".getBytes(Charset.forName("UTF-8"))) + .toString()); + checkOtsiNode(tapiNodes.get(2), otsiNodeUuid, "infra", "ROADM-infra"); + + List links = tapiFactory.getTapiLinks().values().stream() + .sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue())) + .collect(Collectors.toList()); + Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+OTSi".getBytes(Charset.forName("UTF-8"))) + .toString()); + Uuid node2Uuid = new Uuid(UUID.nameUUIDFromBytes("ROADM-infra".getBytes(Charset.forName("UTF-8"))) + .toString()); + Uuid tp1Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+eOTSi+XPDR1-NETWORK1" + .getBytes(Charset.forName("UTF-8"))).toString()); + Uuid tp2Uuid = new Uuid(UUID.nameUUIDFromBytes(("roadm node+nep+1") + .getBytes(Charset.forName("UTF-8"))).toString()); + Uuid linkUuid = + new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1--XPDR1-NETWORK1 and ROADM-infra--NodeEdgePoint_1" + .getBytes(Charset.forName("UTF-8"))).toString()); + checkOmsLink(links.get(0), node1Uuid, node2Uuid, tp1Uuid, tp2Uuid, linkUuid, + "SPDR-SA1-XPDR1--XPDR1-NETWORK1 and ROADM-infra--NodeEdgePoint_1"); + } + + private void checkDsrNode(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node, + Uuid nodeUuid, boolean isSwitch, String nodeId) { + assertEquals("incorrect node uuid", nodeUuid, node.getUuid()); + assertEquals("incorrect node name", nodeId, node.getName().get(new NameKey("dsr/odu node name")).getValue()); + assertEquals("administrative state should be UNLOCKED", + AdministrativeState.UNLOCKED, node.getAdministrativeState()); + assertEquals("life-cycle state should be INSTALLED", LifecycleState.INSTALLED, node.getLifecycleState()); + assertEquals("operational state should be ENABLED", OperationalState.ENABLED, node.getOperationalState()); + assertEquals("value-name should be 'dsr/odu node name'", + "dsr/odu node name", node.nonnullName().values().stream().findFirst().get().getValueName()); + assertEquals("dsr node should manage 2 protocol layers : dsr and odu", + 2, node.getLayerProtocolName().size()); + assertThat("dsr node should manage 2 protocol layers : dsr and odu", + node.getLayerProtocolName(), hasItems(LayerProtocolName.DSR, LayerProtocolName.ODU)); + List neps = node.nonnullOwnedNodeEdgePoint().values().stream() + .sorted((nep1, nep2) -> nep1.getUuid().getValue().compareTo(nep2.getUuid().getValue())) + .collect(Collectors.toList()); + if (isSwitch) { + assertEquals("Switch-DSR node should have 8 NEPs", 8, neps.size()); + OwnedNodeEdgePoint nep1 = neps.get(3); + Uuid client4NepUuid = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR2-CLIENT4").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepClient100G(nep1, client4NepUuid, "XPDR2-CLIENT4", "NodeEdgePoint_C4"); + OwnedNodeEdgePoint nep2 = neps.get(4); + Uuid networkNepUuid = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR2-NETWORK1").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepNetworkODU4(nep2, networkNepUuid, "XPDR2-NETWORK1", "NodeEdgePoint_N1"); + List nrgList = node.nonnullNodeRuleGroup().values().stream() + .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) + .collect(Collectors.toList()); + checkNodeRuleGroupForSwitchDSR(nrgList, client4NepUuid, networkNepUuid, nodeUuid); + } else { + assertEquals("Mux-DSR node should have 5 NEPs", 5, neps.size()); + OwnedNodeEdgePoint nep1 = neps.get(0); + Uuid client4NepUuid = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR1-CLIENT4").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepClient10G(nep1, client4NepUuid, "XPDR1-CLIENT4", "NodeEdgePoint_C4"); + + OwnedNodeEdgePoint nep2 = neps.get(1); + Uuid networkNepUuid = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepNetworkODU4(nep2, networkNepUuid, "XPDR1-NETWORK1", "NodeEdgePoint_N1"); + List nrgList = node.nonnullNodeRuleGroup().values().stream() + .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) + .collect(Collectors.toList()); + checkNodeRuleGroupForMuxDSR(nrgList, client4NepUuid, networkNepUuid, nodeUuid); + } + } + + private void checkOtsiNode( + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node, + Uuid nodeUuid, String otsiNodeType, String nodeId) { + assertEquals("incorrect node uuid", nodeUuid, node.getUuid()); + assertEquals("incorrect node name", nodeId, node.getName().get(new NameKey("otsi node name")).getValue()); + assertEquals("administrative state should be UNLOCKED", + AdministrativeState.UNLOCKED, node.getAdministrativeState()); + assertEquals("life-cycle state should be INSTALLED", LifecycleState.INSTALLED, node.getLifecycleState()); + assertEquals("operational state should be ENABLED", OperationalState.ENABLED, node.getOperationalState()); + assertEquals("value-name should be 'dsr/odu node name'", + "otsi node name", node.nonnullName().values().stream().findFirst().get().getValueName()); + assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA", + 1, node.getLayerProtocolName().size()); + assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA", + LayerProtocolName.PHOTONICMEDIA, node.getLayerProtocolName().get(0)); + List neps = node.nonnullOwnedNodeEdgePoint().values().stream() + .sorted((nep1, nep2) -> nep1.getUuid().getValue().compareTo(nep2.getUuid().getValue())) + .collect(Collectors.toList()); + switch (otsiNodeType) { + case "switch": + assertEquals("Switch-OTSi node should have 8 NEPs", 8, neps.size()); + OwnedNodeEdgePoint nep1 = neps.get(2); + Uuid inepUuid = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+iOTSi+XPDR2-NETWORK2").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepOtsiNode(nep1, inepUuid, "XPDR2-NETWORK2", "iNodeEdgePoint_2"); + OwnedNodeEdgePoint nep2 = neps.get(0); + Uuid enepUuid = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+eOTSi+XPDR2-NETWORK2").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepOtsiNode(nep2, enepUuid, "XPDR2-NETWORK2", "eNodeEdgePoint_2"); + List nrgList = node.nonnullNodeRuleGroup().values().stream() + .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) + .collect(Collectors.toList()); + checkNodeRuleGroupForSwitchOTSi(nrgList, enepUuid, inepUuid, nodeUuid); + break; + case "mux": + assertEquals("Mux-OTSi node should have 2 NEPs", 2, neps.size()); + OwnedNodeEdgePoint nep3 = neps.get(0); + Uuid enepUuid2 = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+eOTSi+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepOtsiNode(nep3, enepUuid2, "XPDR1-NETWORK1", "eNodeEdgePoint_1"); + OwnedNodeEdgePoint nep4 = neps.get(1); + Uuid inepUuid2 = new Uuid( + UUID.nameUUIDFromBytes((nodeId + "+iOTSi+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8"))) + .toString()); + checkNepOtsiNode(nep4, inepUuid2, "XPDR1-NETWORK1", "iNodeEdgePoint_1"); + List nrgList2 = node.nonnullNodeRuleGroup().values().stream() + .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) + .collect(Collectors.toList()); + checkNodeRuleGroupForMuxOTSi(nrgList2, enepUuid2, inepUuid2, nodeUuid); + break; + default: + Iterator nepIterator = node.nonnullOwnedNodeEdgePoint().values().iterator(); + int count = 1; + while (nepIterator.hasNext()) { + OwnedNodeEdgePoint nep = nepIterator.next(); + Uuid nepUuid = new Uuid( + UUID.nameUUIDFromBytes((String.join("+", "roadm node", "nep", String.valueOf(count))) + .getBytes(Charset.forName("UTF-8"))).toString()); + checkNepOtsiRdmNode(nep, nepUuid, new StringBuilder("NodeEdgePoint_").append(count).toString(), + "NodeEdgePoint name"); + count++; + } + break; + } + } + + private void checkNepClient10G(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { + assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); + List nameList = new ArrayList<>(nep.nonnullName().values()); + Name name = nameList.get(0); + assertEquals("value of client nep should be '" + portName + "'", + portName, name.getValue()); + assertEquals("value-name of client nep for '" + portName + "' should be '" + nepName + "'", + nepName, name.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, false); + } + + private void checkNepNetworkODU4(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { + assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); + List nameList = new ArrayList<>(nep.nonnullName().values()); + Name name = nameList.get(0); + assertEquals("value of network nep should be '" + portName + "'", + portName, name.getValue()); + assertEquals("value-name of client nep for '" + portName + "' should be '" + nepName + "'", + nepName, name.getValueName()); + assertEquals("Network nep should support 1 kind of cep", + 1, nep.getSupportedCepLayerProtocolQualifier().size()); + assertThat("network nep should support 1 kind of cep", + nep.getSupportedCepLayerProtocolQualifier(), + hasItem(ODUTYPEODU4.class)); + assertEquals("network nep should be of ODU protocol type", LayerProtocolName.ODU, nep.getLayerProtocolName()); + checkCommonPartOfNep(nep, false); + } + + private void checkNodeRuleGroupForMuxDSR(List nrgList, Uuid clientNepUuid, Uuid networkNepUuid, + Uuid nodeUuid) { + assertEquals("muxponder DSR should contain 4 node rule group", 4, nrgList.size()); + for (NodeRuleGroup nodeRuleGroup : nrgList) { + assertEquals("each node-rule-group should contain 2 NEP for muxponder DSR", + 2, nodeRuleGroup.getNodeEdgePoint().size()); + } + List nodeEdgePointList = new ArrayList<>(nrgList.get(0).nonnullNodeEdgePoint().values()); + assertThat("node-rule-group nb 2 should be between nep-client4 and nep-network1", + nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), + either(containsString(networkNepUuid.getValue())).or(containsString(clientNepUuid.getValue()))); + assertThat("node-rule-group nb 2 should be between nep-client4 and nep-network1", + nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), + either(containsString(networkNepUuid.getValue())).or(containsString(clientNepUuid.getValue()))); + assertEquals("node-rule-group nb 2 should be between nep-client4 and nep-network1 of the same node", + nodeEdgePointList.get(0).getNodeUuid(), nodeUuid); + assertEquals("node-rule-group nb 2 should be between nep-client4 and nep-network1 of the same node", + nodeEdgePointList.get(1).getNodeUuid(), nodeUuid); + List rule = new ArrayList<>(nrgList.get(1).nonnullRule().values()); + assertEquals("node-rule-group nb 2 should contain a single rule", 1, rule.size()); + assertEquals("local-id of the rule should be 'forward'", + "forward", rule.get(0).getLocalId()); + assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", + ForwardingRule.MAYFORWARDACROSSGROUP, rule.get(0).getForwardingRule()); + assertEquals("the rule type should be 'FORWARDING'", + RuleType.FORWARDING, rule.get(0).getRuleType()); + } + + private void checkNodeRuleGroupForSwitchDSR(List nrgList, Uuid clientNepUuid, Uuid networkNepUuid, + Uuid nodeUuid) { + assertEquals("Switch-DSR should contain a single node rule group", 1, nrgList.size()); + assertEquals("Switch-DSR node-rule-group should contain 8 NEP", 8, nrgList.get(0).getNodeEdgePoint().size()); + List nrg = nrgList.get(0).nonnullNodeEdgePoint().values().stream() + .sorted((nrg1, nrg2) -> nrg1.getNodeEdgePointUuid().getValue() + .compareTo(nrg2.getNodeEdgePointUuid().getValue())) + .collect(Collectors.toList()); + assertEquals("in the sorted node-rule-group, nep number 2 should be XPDR2-NETWORK1", + networkNepUuid, nrg.get(4).getNodeEdgePointUuid()); + assertEquals("in the sorted node-rule-group, nep number 6 should be XPDR2-CLIENT4", + clientNepUuid, nrg.get(3).getNodeEdgePointUuid()); + assertEquals("any item of the node-rule-group should have the same nodeUuid", + nodeUuid, nrg.get(4).getNodeUuid()); + assertEquals("any item of the node-rule-group should have the same nodeUuid", + nodeUuid, nrg.get(3).getNodeUuid()); + @Nullable + List ruleList = new ArrayList<>(nrgList.get(0).nonnullRule().values()); + assertEquals("node-rule-group should contain a single rule", 1, ruleList.size()); + assertEquals("local-id of the rule should be 'forward'", + "forward", ruleList.get(0).getLocalId()); + assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", + ForwardingRule.MAYFORWARDACROSSGROUP, ruleList.get(0).getForwardingRule()); + assertEquals("the rule type should be 'FORWARDING'", + RuleType.FORWARDING, ruleList.get(0).getRuleType()); + } + + private void checkNodeRuleGroupForMuxOTSi(List nrgList, Uuid enepUuid, Uuid inepUuid, + Uuid nodeUuid) { + assertEquals("Mux-OTSi should contain a single node rule group", 1, nrgList.size()); + List nodeEdgePointList = new ArrayList<>(nrgList.get(0).getNodeEdgePoint().values()); + assertEquals("Mux-OTSi node-rule-group should contain 2 NEP", 2, nodeEdgePointList.size()); + assertThat("Mux-OTSi node-rule-group should be between eNEP and iNEP of XPDR1-NETWORK1", + nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), + either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); + assertThat("Mux-OTSi node-rule-group should be between eNEP and iNEP of XPDR1-NETWORK1", + nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), + either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); + assertEquals("any item of the node-rule-group should have the same nodeUuid", + nodeUuid, nodeEdgePointList.get(0).getNodeUuid()); + assertEquals("any item of the node-rule-group should have the same nodeUuid", + nodeUuid, nodeEdgePointList.get(1).getNodeUuid()); + List ruleList = new ArrayList<>(nrgList.get(0).nonnullRule().values()); + assertEquals("node-rule-group should contain a single rule", 1, ruleList.size()); + assertEquals("local-id of the rule should be 'forward'", + "forward", ruleList.get(0).getLocalId()); + assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", + ForwardingRule.MAYFORWARDACROSSGROUP, ruleList.get(0).getForwardingRule()); + assertEquals("the rule type should be 'FORWARDING'", + RuleType.FORWARDING, ruleList.get(0).getRuleType()); + } + + private void checkNodeRuleGroupForSwitchOTSi(List nrgList, Uuid enepUuid, Uuid inepUuid, + Uuid nodeUuid) { + assertEquals("Switch-OTSi should contain 4 node rule group", 4, nrgList.size()); + for (NodeRuleGroup nodeRuleGroup : nrgList) { + assertEquals("each node-rule-group should contain 2 NEP for Switch-OTSi", + 2, nodeRuleGroup.getNodeEdgePoint().size()); + } + List nodeEdgePointList1 = new ArrayList<>(nrgList.get(3).nonnullNodeEdgePoint().values()); + assertThat("Switch-OTSi node-rule-group nb 4 should be between eNEP and iNEP of XPDR2-NETWORK2", + nodeEdgePointList1.get(0).getNodeEdgePointUuid().getValue(), + either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); + assertThat("Switch-OTSi node-rule-group nb 4 should be between eNEP and iNEP of XPDR2-NETWORK2", + nodeEdgePointList1.get(1).getNodeEdgePointUuid().getValue(), + either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); + List nodeEdgePointList0 = new ArrayList<>(nrgList.get(0).getNodeEdgePoint().values()); + assertEquals("any item of the node-rule-group should have the same nodeUuid", + nodeUuid, nodeEdgePointList0.get(0).getNodeUuid()); + assertEquals("any item of the node-rule-group should have the same nodeUuid", + nodeUuid, nodeEdgePointList0.get(1).getNodeUuid()); + List ruleList0 = new ArrayList<>(nrgList.get(0).nonnullRule().values()); + assertEquals("node-rule-group should contain a single rule", 1, ruleList0.size()); + assertEquals("local-id of the rule should be 'forward'", + "forward", ruleList0.get(0).getLocalId()); + assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", + ForwardingRule.MAYFORWARDACROSSGROUP, ruleList0.get(0).getForwardingRule()); + assertEquals("the rule type should be 'FORWARDING'", + RuleType.FORWARDING, ruleList0.get(0).getRuleType()); + } + + private void checkNepClient100G(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { + assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); + List nameList = new ArrayList<>(nep.nonnullName().values()); + assertEquals("value of client nep should be '" + portName + "'", + portName, nameList.get(0).getValue()); + assertEquals("value-name of client nep for '" + portName + "' should be '" + nepName + "'", + nepName, nameList.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(ODUTYPEODU4.class, DIGITALSIGNALTYPE100GigE.class)); + assertEquals("client nep should be of ETH protocol type", LayerProtocolName.ETH, nep.getLayerProtocolName()); + checkCommonPartOfNep(nep, false); + } + + private void checkNepOtsiNode(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { + assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); + List nameList = new ArrayList<>(nep.nonnullName().values()); + assertEquals("value of OTSi nep should be '" + portName + "'", + portName, nameList.get(0).getValue()); + assertEquals("value-name of OTSi nep should be '" + nepName + "'", + nepName, nameList.get(0).getValueName()); + assertEquals("OTSi nep should support 2 kind of cep", + 2, nep.getSupportedCepLayerProtocolQualifier().size()); + assertThat("OTSi nep should support 2 kind of cep", + nep.getSupportedCepLayerProtocolQualifier(), + hasItems(PHOTONICLAYERQUALIFIEROMS.class, PHOTONICLAYERQUALIFIEROTSi.class)); + assertEquals("OTSi nep should be of PHOTONIC_MEDIA protocol type", + LayerProtocolName.PHOTONICMEDIA, nep.getLayerProtocolName()); + assertEquals("OTSi nep should support one SIP", 1, nep.getMappedServiceInterfacePoint().size()); + checkCommonPartOfNep(nep, false); + } + + private void checkNepOtsiRdmNode(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { + assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); + List nameList = new ArrayList<>(nep.nonnullName().values()); + assertEquals("value of OTSi nep should be '" + portName + "'", + portName, nameList.get(0).getValue()); + assertEquals("value-name of OTSi nep should be '" + nepName + "'", + nepName, nameList.get(0).getValueName()); + assertEquals("OTSi nep of RDM infra node should support only 1 kind of cep", + 1, nep.getSupportedCepLayerProtocolQualifier().size()); + assertThat("OTSi nep should support 2 kind of cep", + nep.getSupportedCepLayerProtocolQualifier(), + hasItems(PHOTONICLAYERQUALIFIEROMS.class)); + assertEquals("OTSi nep should be of PHOTONIC_MEDIA protocol type", + LayerProtocolName.PHOTONICMEDIA, nep.getLayerProtocolName()); + assertEquals("OTSi nep of RDM infra should support no SIP", 0, nep.nonnullMappedServiceInterfacePoint().size()); + checkCommonPartOfNep(nep, true); + } + + private void checkCommonPartOfNep(OwnedNodeEdgePoint nep, boolean isRdm) { + assertEquals("link port direction should be DIRECTIONAL", + PortDirection.BIDIRECTIONAL, nep.getLinkPortDirection()); + assertEquals("administrative state should be UNLOCKED", + AdministrativeState.UNLOCKED, nep.getAdministrativeState()); + assertEquals("termination state should be TERMINATED BIDIRECTIONAL", + TerminationState.TERMINATEDBIDIRECTIONAL, nep.getTerminationState()); + assertEquals("life-cycle state should be INSTALLED", LifecycleState.INSTALLED, nep.getLifecycleState()); + if (!isRdm) { + assertEquals("client nep should support 1 SIP", 1, nep.getMappedServiceInterfacePoint().size()); + } + assertEquals("termination direction should be BIDIRECTIONAL", + TerminationDirection.BIDIRECTIONAL, nep.getTerminationDirection()); + assertEquals("operational state of client nep should be ENABLED", + OperationalState.ENABLED, nep.getOperationalState()); + assertEquals("link-port-role of client nep should be SYMMETRIC", + PortRole.SYMMETRIC, nep.getLinkPortRole()); + } + + private void checkTransitionalLink(Link link, Uuid node1Uuid, Uuid node2Uuid, String tp1, String tp2, + String ietfNodeId) { + Uuid linkUuid = new Uuid(UUID.nameUUIDFromBytes((ietfNodeId + "--" + tp1 + "--" + tp2) + .getBytes(Charset.forName("UTF-8"))).toString()); + assertEquals("bad uuid for link between DSR node " + tp1 + " and iOTSI port " + tp2, linkUuid, link.getUuid()); + assertEquals("Available capacity unit should be GBPS", + CapacityUnit.GBPS, link.getAvailableCapacity().getTotalSize().getUnit()); + assertEquals("Available capacity -total size value should be 100", + Uint64.valueOf(100), link.getAvailableCapacity().getTotalSize().getValue()); + assertEquals("transitional link should be between 2 nodes of protocol layers ODU and PHOTONIC_MEDIA", + 2, link.getTransitionedLayerProtocolName().size()); + assertThat("transitional link should be between 2 nodes of protocol layers ODU and PHOTONIC_MEDIA", + link.getTransitionedLayerProtocolName(), + hasItems(LayerProtocolName.ODU.getName(), LayerProtocolName.PHOTONICMEDIA.getName())); + assertEquals("transitional link should be BIDIRECTIONAL", + ForwardingDirection.BIDIRECTIONAL, link.getDirection()); + List nodeEdgePointList = new ArrayList<>(link.nonnullNodeEdgePoint().values()); + assertEquals("topology uuid should be the same for the two termination point of the link", + topologyUuid, nodeEdgePointList.get(0).getTopologyUuid()); + assertEquals("topology uuid should be the same for the two termination point of the link", + topologyUuid, nodeEdgePointList.get(1).getTopologyUuid()); + assertThat("transitional links should terminate on DSR node and Photonic node", + nodeEdgePointList.get(0).getNodeUuid().getValue(), + either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); + assertThat("transitional links should terminate on DSR node and Photonic node", + nodeEdgePointList.get(1).getNodeUuid().getValue(), + either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); + Uuid nep1Uuid = new Uuid(UUID.nameUUIDFromBytes(tp1.getBytes(Charset.forName("UTF-8"))).toString()); + Uuid nep2Uuid = new Uuid(UUID.nameUUIDFromBytes(tp2.getBytes(Charset.forName("UTF-8"))).toString()); + assertThat("transitional links should terminate on " + tp1 + " and " + tp2 + " neps", + nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), + either(containsString(nep1Uuid.getValue())).or(containsString(nep2Uuid.getValue()))); + assertThat("transitional links should terminate on DSR node and Photonic node", + nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), + either(containsString(nep1Uuid.getValue())).or(containsString(nep2Uuid.getValue()))); + } + + private void checkOtnLink(Link link, Uuid node1Uuid, Uuid node2Uuid, Uuid tp1Uuid, Uuid tp2Uuid, Uuid linkUuid, + String linkName) { + assertEquals("bad name for the link", linkName, link.getName().get(new NameKey("otn link name")).getValue()); + assertEquals("bad uuid for link", linkUuid, link.getUuid()); + assertEquals("Available capacity unit should be MBPS", + CapacityUnit.MBPS, link.getAvailableCapacity().getTotalSize().getUnit()); + String prefix = linkName.split("-")[0]; + if ("OTU4".equals(prefix)) { + assertEquals("Available capacity -total size value should be 0", + Uint64.valueOf(0), link.getAvailableCapacity().getTotalSize().getValue()); + } else if ("ODU4".equals(prefix)) { + assertEquals("Available capacity -total size value should be 100 000", + Uint64.valueOf(100000), link.getAvailableCapacity().getTotalSize().getValue()); + } + assertEquals("Total capacity unit should be GBPS", + CapacityUnit.GBPS, link.getTotalPotentialCapacity().getTotalSize().getUnit()); + assertEquals("Total capacity -total size value should be 100", + Uint64.valueOf(100), link.getTotalPotentialCapacity().getTotalSize().getValue()); + if ("OTU4".equals(prefix)) { + assertEquals("otn link should be between 2 nodes of protocol layers PHOTONIC_MEDIA", + LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName()); + } else if ("ODU4".equals(prefix)) { + assertEquals("otn link should be between 2 nodes of protocol layers ODU", + LayerProtocolName.ODU.getName(), link.getLayerProtocolName().get(0).getName()); + } + assertEquals("otn tapi link should be BIDIRECTIONAL", + ForwardingDirection.BIDIRECTIONAL, link.getDirection()); + List nodeEdgePointList = new ArrayList<>(link.nonnullNodeEdgePoint().values()); + assertEquals("topology uuid should be the same for the two termination point of the link", + topologyUuid, nodeEdgePointList.get(0).getTopologyUuid()); + assertEquals("topology uuid should be the same for the two termination point of the link", + topologyUuid, nodeEdgePointList.get(1).getTopologyUuid()); + assertThat("otn links should terminate on two distinct nodes", + nodeEdgePointList.get(0).getNodeUuid().getValue(), + either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); + assertThat("otn links should terminate on two distinct nodes", + nodeEdgePointList.get(1).getNodeUuid().getValue(), + either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); + assertThat("otn links should terminate on two distinct tps", + nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), + either(containsString(tp1Uuid.getValue())).or(containsString(tp2Uuid.getValue()))); + assertThat("otn links should terminate on two distinct tps", + nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), + either(containsString(tp1Uuid.getValue())).or(containsString(tp2Uuid.getValue()))); + assertEquals("operational state should be ENABLED", + OperationalState.ENABLED, link.getOperationalState()); + assertEquals("administrative state should be UNLOCKED", + AdministrativeState.UNLOCKED, link.getAdministrativeState()); + } + + private void checkOmsLink(Link link, Uuid node1Uuid, Uuid node2Uuid, Uuid tp1Uuid, Uuid tp2Uuid, Uuid linkUuid, + String linkName) { + assertEquals("bad name for the link", linkName, link.getName().get(new NameKey("OMS link name")).getValue()); + assertEquals("bad uuid for link", linkUuid, link.getUuid()); + assertEquals("oms link should be between 2 nodes of protocol layers PHOTONIC_MEDIA", + LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName()); + assertEquals("otn tapi link should be BIDIRECTIONAL", + ForwardingDirection.BIDIRECTIONAL, link.getDirection()); + List nodeEdgePointList = new ArrayList<>(link.nonnullNodeEdgePoint().values()); + assertEquals("oms link should be between 2 neps",2 , nodeEdgePointList.size()); + assertEquals("topology uuid should be the same for the two termination point of the link", + topologyUuid, nodeEdgePointList.get(0).getTopologyUuid()); + assertEquals("topology uuid should be the same for the two termination point of the link", + topologyUuid, nodeEdgePointList.get(1).getTopologyUuid()); + assertThat("oms links should terminate on two distinct nodes", + nodeEdgePointList.get(0).getNodeUuid().getValue(), + either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); + assertThat("oms links should terminate on two distinct nodes", + nodeEdgePointList.get(1).getNodeUuid().getValue(), + either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); + assertThat("oms links should terminate on two distinct tps", + nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), + either(containsString(tp1Uuid.getValue())).or(containsString(tp2Uuid.getValue()))); + assertThat("oms links should terminate on two distinct tps", + nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), + either(containsString(tp1Uuid.getValue())).or(containsString(tp2Uuid.getValue()))); + } + +} diff --git a/tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImplTest.java b/tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImplTest.java index 026c5744b..aeab921fe 100644 --- a/tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImplTest.java +++ b/tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImplTest.java @@ -9,11 +9,10 @@ package org.opendaylight.transportpce.tapi.topology; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.either; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; @@ -27,7 +26,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.opendaylight.transportpce.common.InstanceIdentifiers; import org.opendaylight.transportpce.common.NetworkUtils; @@ -37,30 +36,13 @@ import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Admi import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.CapacityUnit; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.ForwardingDirection; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LayerProtocolName; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LifecycleState; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.OperationalState; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.PortDirection; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.PortRole; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.TerminationDirection; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.TerminationState; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Uuid; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameKey; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.dsr.rev181210.DIGITALSIGNALTYPE100GigE; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.dsr.rev181210.DIGITALSIGNALTYPE10GigELAN; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU2E; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU4; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev181210.PHOTONICLAYERQUALIFIEROMS; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev181210.PHOTONICLAYERQUALIFIEROTSi; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.ForwardingRule; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.GetTopologyDetailsInput; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.GetTopologyDetailsOutput; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.RuleType; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.get.topology.details.output.Topology; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.NodeRuleGroup; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.OwnedNodeEdgePoint; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint; -import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.Rule; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Link; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -75,14 +57,14 @@ public class TapiTopologyImplTest extends AbstractTest { private static CountDownLatch endSignal; private static final int NUM_THREADS = 3; - @Before - public void setUp() throws InterruptedException, ExecutionException { + @BeforeClass + public static void setUp() throws InterruptedException, ExecutionException { executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUM_THREADS)); endSignal = new CountDownLatch(1); TopologyDataUtils.writeTopologyFromFileToDatastore(getDataStoreContextUtil(), TopologyDataUtils.OPENROADM_TOPOLOGY_FILE, InstanceIdentifiers.OVERLAY_NETWORK_II); TopologyDataUtils.writeTopologyFromFileToDatastore(getDataStoreContextUtil(), - TopologyDataUtils.OTN_TOPOLOGY_FILE, InstanceIdentifiers.OTN_NETWORK_II); + TopologyDataUtils.OTN_TOPOLOGY_WITH_OTN_LINKS_FILE, InstanceIdentifiers.OTN_NETWORK_II); TopologyDataUtils.writePortmappingFromFileToDatastore(getDataStoreContextUtil()); LOG.info("setup done"); } @@ -113,18 +95,13 @@ public class TapiTopologyImplTest extends AbstractTest { Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes("TAPI Ethernet Node".getBytes()).toString()); assertEquals("incorrect topology uuid", topoUuid, topology.getUuid()); assertEquals("incorrect node uuid", nodeUuid, topologyNodeList.get(0).getUuid()); - Uuid onep1Uuid = new Uuid(UUID.nameUUIDFromBytes("OwnedNodeEdgePoint 0".getBytes()).toString()); - Uuid onep2Uuid = new Uuid(UUID.nameUUIDFromBytes("OwnedNodeEdgePoint 1".getBytes()).toString()); - List edgePointList = new ArrayList<>(topologyNodeList.get(0) - .nonnullOwnedNodeEdgePoint().values()); - assertEquals("incorrect uuid for nep1", - onep1Uuid, edgePointList.get(1).getUuid()); - assertEquals("incorrect uuid for nep1", - onep2Uuid, edgePointList.get(0).getUuid()); + assertNull("TAPI Ethernet Node should have no nep", topologyNodeList.get(0).getOwnedNodeEdgePoint()); } + @Test - public void getTopologyDetailsForOtnTopologyWhenSuccessful() throws ExecutionException, InterruptedException { + public void getTopologyDetailsForOtnTopologyWithOtnLinksWhenSuccessful() + throws ExecutionException, InterruptedException { GetTopologyDetailsInput input = TopologyDataUtils.buildGetTopologyDetailsInput(NetworkUtils.OTN_NETWORK_ID); TapiTopologyImpl tapiTopoImpl = new TapiTopologyImpl(getDataBroker()); ListenableFuture> result = tapiTopoImpl.getTopologyDetails(input); @@ -139,65 +116,30 @@ public class TapiTopologyImplTest extends AbstractTest { @Nullable Topology topology = rpcResult.getResult().getTopology(); assertNotNull("Topology should not be null", topology); - assertEquals("Node list size should be 4", 4, topology.getNode().size()); - assertEquals("Link list size should be 5", 5, topology.getLink().size()); + assertEquals("Node list size should be 9", 9, topology.getNode().size()); + assertEquals("Link list size should be 14", 14, topology.getLink().size()); Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes("T0 - Multi-layer topology".getBytes()).toString()); assertEquals("incorrect topology uuid", topoUuid, topology.getUuid()); assertEquals("topology name should be T0 - Multi-layer topology", "T0 - Multi-layer topology", topology.nonnullName().values().stream().findFirst().get().getValue()); - List nodes = topology.nonnullNode().values().stream() - .sorted((n1,n2) -> n1.getUuid().getValue().compareTo(n2.getUuid().getValue())) - .collect(Collectors.toList()); - Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+DSR".getBytes(Charset.forName("UTF-8"))) - .toString()); - checkDsrNode(nodes.get(0), node1Uuid, false, "SPDR-SA1-XPDR1"); - Uuid node2Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR2+DSR".getBytes(Charset.forName("UTF-8"))) - .toString()); - checkDsrNode(nodes.get(1), node2Uuid, true, "SPDR-SA1-XPDR2"); - Uuid node3Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+OTSi".getBytes(Charset.forName("UTF-8"))) - .toString()); - checkOtsiNode(nodes.get(2), node3Uuid, false, "SPDR-SA1-XPDR1"); - Uuid node4Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR2+OTSi".getBytes(Charset.forName("UTF-8"))) - .toString()); - checkOtsiNode(nodes.get(3), node4Uuid, true, "SPDR-SA1-XPDR2"); - - List links = topology.nonnullLink().values().stream() - .sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue())) - .collect(Collectors.toList()); - checkTransitionalLink(links.get(4), topoUuid, node1Uuid, node3Uuid, "SPDR-SA1-XPDR1+DSR+XPDR1-NETWORK1", - "SPDR-SA1-XPDR1+iOTSi+XPDR1-NETWORK1", "SPDR-SA1-XPDR1"); - checkTransitionalLink(links.get(2), topoUuid, node2Uuid, node4Uuid, "SPDR-SA1-XPDR2+DSR+XPDR2-NETWORK1", - "SPDR-SA1-XPDR2+iOTSi+XPDR2-NETWORK1", "SPDR-SA1-XPDR2"); - } - - @Test - public void getTopologyDetailsForOtnTopologyWithOtnLinksWhenSuccessful() - throws ExecutionException, InterruptedException { - executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUM_THREADS)); - endSignal = new CountDownLatch(1); - TopologyDataUtils.writeTopologyFromFileToDatastore(getDataStoreContextUtil(), - TopologyDataUtils.OTN_TOPOLOGY_WITH_OTN_LINKS_FILE, InstanceIdentifiers.OTN_NETWORK_II); - - GetTopologyDetailsInput input = TopologyDataUtils.buildGetTopologyDetailsInput(NetworkUtils.OTN_NETWORK_ID); - TapiTopologyImpl tapiTopoImpl = new TapiTopologyImpl(getDataBroker()); - ListenableFuture> result = tapiTopoImpl.getTopologyDetails(input); - result.addListener(new Runnable() { - @Override - public void run() { - endSignal.countDown(); - } - }, executorService); - endSignal.await(); - RpcResult rpcResult = result.get(); - @Nullable - Topology topology = rpcResult.getResult().getTopology(); - assertNotNull("Topology should not be null", topology); - assertEquals("Node list size should be 8", 8, topology.getNode().size()); - assertEquals("Link list size should be 12", 12, topology.getLink().size()); + long nbDsrOduNodes = topology.nonnullNode().values().stream() + .filter(n -> n.getName().containsKey(new NameKey("dsr/odu node name"))).count(); + long nbPhotonicNodes = topology.nonnullNode().values().stream() + .filter(n -> n.getName().containsKey(new NameKey("otsi node name"))).count(); + assertEquals("Node list should contain 4 DSR-ODU nodes", 4, nbDsrOduNodes); + assertEquals("Node list should contain 5 Photonics nodes", 5, nbPhotonicNodes); + long nbTransititionalLinks = topology.getLink().values().stream() + .filter(l -> l.getName().containsKey(new NameKey("transitional link name"))).count(); + long nbOmsLinks = topology.getLink().values().stream() + .filter(l -> l.getName().containsKey(new NameKey("OMS link name"))).count(); + long nbOtnLinks = topology.getLink().values().stream() + .filter(l -> l.getName().containsKey(new NameKey("otn link name"))).count(); + assertEquals("Link list should contain 6 transitional links", 6, nbTransititionalLinks); + assertEquals("Link list should contain 6 transitional links", 6, nbOmsLinks); + assertEquals("Link list should contain 2 OTN links", 2, nbOtnLinks); - Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes("T0 - Multi-layer topology".getBytes()).toString()); Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SA1-XPDR1+DSR".getBytes(Charset.forName("UTF-8"))) .toString()); Uuid node2Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SC1-XPDR1+DSR".getBytes(Charset.forName("UTF-8"))) @@ -224,345 +166,12 @@ public class TapiTopologyImplTest extends AbstractTest { List links = topology.nonnullLink().values().stream() .sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue())) .collect(Collectors.toList()); - checkOtnLink(links.get(3), topoUuid, node1Uuid, node2Uuid, tp1Uuid, tp2Uuid, link1Uuid, + checkOtnLink(links.get(4), topoUuid, node1Uuid, node2Uuid, tp1Uuid, tp2Uuid, link1Uuid, "ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"); - checkOtnLink(links.get(9), topoUuid, node3Uuid, node4Uuid, tp3Uuid, tp4Uuid, link2Uuid, + checkOtnLink(links.get(11), topoUuid, node3Uuid, node4Uuid, tp3Uuid, tp4Uuid, link2Uuid, "OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"); } - private void checkDsrNode(Node node, Uuid nodeUuid, boolean isSwitch, String nodeId) { - assertEquals("incorrect node uuid", nodeUuid, node.getUuid()); - assertEquals("administrative state should be UNLOCKED", - AdministrativeState.UNLOCKED, node.getAdministrativeState()); - assertEquals("life-cycle state should be INSTALLED", LifecycleState.INSTALLED, node.getLifecycleState()); - assertEquals("operational state should be ENABLED", OperationalState.ENABLED, node.getOperationalState()); - assertEquals("value-name should be 'dsr/odu node name'", - "dsr/odu node name", node.nonnullName().values().stream().findFirst().get().getValueName()); - assertEquals("dsr node should manage 2 protocol layers : dsr and odu", - 2, node.getLayerProtocolName().size()); - assertThat("dsr node should manage 2 protocol layers : dsr and odu", - node.getLayerProtocolName(), hasItems(LayerProtocolName.DSR, LayerProtocolName.ODU)); - List neps = node.nonnullOwnedNodeEdgePoint().values().stream() - .sorted((nep1, nep2) -> nep1.getUuid().getValue().compareTo(nep2.getUuid().getValue())) - .collect(Collectors.toList()); - if (isSwitch) { - assertEquals("Switch-DSR node should have 8 NEPs", 8, neps.size()); - OwnedNodeEdgePoint nep1 = neps.get(3); - Uuid client4NepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR2-CLIENT4").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepClient100G(nep1, client4NepUuid, "XPDR2-CLIENT4", "NodeEdgePoint_C4"); - OwnedNodeEdgePoint nep2 = neps.get(4); - Uuid networkNepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR2-NETWORK1").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepNetworkODU4(nep2, networkNepUuid, "XPDR2-NETWORK1", "NodeEdgePoint_N1"); - List nrgList = node.nonnullNodeRuleGroup().values().stream() - .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) - .collect(Collectors.toList()); - checkNodeRuleGroupForSwitchDSR(nrgList, client4NepUuid, networkNepUuid, nodeUuid); - } else { - assertEquals("Mux-DSR node should have 5 NEPs", 5, neps.size()); - OwnedNodeEdgePoint nep1 = neps.get(0); - Uuid client4NepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR1-CLIENT4").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepClient10G(nep1, client4NepUuid, "XPDR1-CLIENT4", "NodeEdgePoint_C4"); - - OwnedNodeEdgePoint nep2 = neps.get(1); - Uuid networkNepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepNetworkODU4(nep2, networkNepUuid, "XPDR1-NETWORK1", "NodeEdgePoint_N1"); - List nrgList = node.nonnullNodeRuleGroup().values().stream() - .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) - .collect(Collectors.toList()); - checkNodeRuleGroupForMuxDSR(nrgList, client4NepUuid, networkNepUuid, nodeUuid); - } - } - - private void checkOtsiNode(Node node, Uuid nodeUuid, boolean isSwitch, String nodeId) { - assertEquals("incorrect node uuid", nodeUuid, node.getUuid()); - assertEquals("administrative state should be UNLOCKED", - AdministrativeState.UNLOCKED, node.getAdministrativeState()); - assertEquals("life-cycle state should be INSTALLED", LifecycleState.INSTALLED, node.getLifecycleState()); - assertEquals("operational state should be ENABLED", OperationalState.ENABLED, node.getOperationalState()); - assertEquals("value-name should be 'dsr/odu node name'", - "otsi node name", node.nonnullName().values().stream().findFirst().get().getValueName()); - assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA", - 1, node.getLayerProtocolName().size()); - assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA", - LayerProtocolName.PHOTONICMEDIA, node.getLayerProtocolName().get(0)); - List neps = node.nonnullOwnedNodeEdgePoint().values().stream() - .sorted((nep1, nep2) -> nep1.getUuid().getValue().compareTo(nep2.getUuid().getValue())) - .collect(Collectors.toList()); - if (isSwitch) { - assertEquals("Switch-OTSi node should have 8 NEPs", 8, neps.size()); - OwnedNodeEdgePoint nep1 = neps.get(2); - Uuid inepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+iOTSi+XPDR2-NETWORK2").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepOtsiNode(nep1, inepUuid, "XPDR2-NETWORK2", "iNodeEdgePoint_2"); - OwnedNodeEdgePoint nep2 = neps.get(0); - Uuid enepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+eOTSi+XPDR2-NETWORK2").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepOtsiNode(nep2, enepUuid, "XPDR2-NETWORK2", "eNodeEdgePoint_2"); - List nrgList = node.nonnullNodeRuleGroup().values().stream() - .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) - .collect(Collectors.toList()); - checkNodeRuleGroupForSwitchOTSi(nrgList, enepUuid, inepUuid, nodeUuid); - } else { - assertEquals("Mux-OTSi node should have 2 NEPs", 2, neps.size()); - OwnedNodeEdgePoint nep1 = neps.get(0); - Uuid enepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+eOTSi+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepOtsiNode(nep1, enepUuid, "XPDR1-NETWORK1", "eNodeEdgePoint_1"); - OwnedNodeEdgePoint nep2 = neps.get(1); - Uuid inepUuid = new Uuid( - UUID.nameUUIDFromBytes((nodeId + "+iOTSi+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8"))) - .toString()); - checkNepOtsiNode(nep2, inepUuid, "XPDR1-NETWORK1", "iNodeEdgePoint_1"); - List nrgList = node.nonnullNodeRuleGroup().values().stream() - .sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue())) - .collect(Collectors.toList()); - checkNodeRuleGroupForMuxOTSi(nrgList, enepUuid, inepUuid, nodeUuid); - } - } - - private void checkNepClient10G(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { - assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); - List nameList = new ArrayList<>(nep.nonnullName().values()); - Name name = nameList.get(0); - assertEquals("value of client nep should be '" + portName + "'", - portName, name.getValue()); - assertEquals("value-name of client nep for '" + portName + "' should be '" + nepName + "'", - nepName, name.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); - } - - private void checkNepNetworkODU4(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { - assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); - List nameList = new ArrayList<>(nep.nonnullName().values()); - Name name = nameList.get(0); - assertEquals("value of network nep should be '" + portName + "'", - portName, name.getValue()); - assertEquals("value-name of client nep for '" + portName + "' should be '" + nepName + "'", - nepName, name.getValueName()); - assertEquals("Network nep should support 1 kind of cep", - 1, nep.getSupportedCepLayerProtocolQualifier().size()); - assertThat("network nep should support 1 kind of cep", - nep.getSupportedCepLayerProtocolQualifier(), - hasItem(ODUTYPEODU4.class)); - assertEquals("network nep should be of ODU protocol type", LayerProtocolName.ODU, nep.getLayerProtocolName()); - checkCommonPartOfNep(nep); - } - - private void checkNodeRuleGroupForMuxDSR(List nrgList, Uuid clientNepUuid, Uuid networkNepUuid, - Uuid nodeUuid) { - assertEquals("muxponder DSR should contain 4 node rule group", 4, nrgList.size()); - for (NodeRuleGroup nodeRuleGroup : nrgList) { - assertEquals("each node-rule-group should contain 2 NEP for muxponder DSR", - 2, nodeRuleGroup.getNodeEdgePoint().size()); - } - List nodeEdgePointList = new ArrayList<>(nrgList.get(0).nonnullNodeEdgePoint().values()); - assertThat("node-rule-group nb 2 should be between nep-client4 and nep-network1", - nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), - either(containsString(networkNepUuid.getValue())).or(containsString(clientNepUuid.getValue()))); - assertThat("node-rule-group nb 2 should be between nep-client4 and nep-network1", - nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), - either(containsString(networkNepUuid.getValue())).or(containsString(clientNepUuid.getValue()))); - assertEquals("node-rule-group nb 2 should be between nep-client4 and nep-network1 of the same node", - nodeEdgePointList.get(0).getNodeUuid(), nodeUuid); - assertEquals("node-rule-group nb 2 should be between nep-client4 and nep-network1 of the same node", - nodeEdgePointList.get(1).getNodeUuid(), nodeUuid); - List rule = new ArrayList<>(nrgList.get(1).nonnullRule().values()); - assertEquals("node-rule-group nb 2 should contain a single rule", 1, rule.size()); - assertEquals("local-id of the rule should be 'forward'", - "forward", rule.get(0).getLocalId()); - assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", - ForwardingRule.MAYFORWARDACROSSGROUP, rule.get(0).getForwardingRule()); - assertEquals("the rule type should be 'FORWARDING'", - RuleType.FORWARDING, rule.get(0).getRuleType()); - } - - private void checkNodeRuleGroupForSwitchDSR(List nrgList, Uuid clientNepUuid, Uuid networkNepUuid, - Uuid nodeUuid) { - assertEquals("Switch-DSR should contain a single node rule group", 1, nrgList.size()); - assertEquals("Switch-DSR node-rule-group should contain 8 NEP", 8, nrgList.get(0).getNodeEdgePoint().size()); - List nrg = nrgList.get(0).nonnullNodeEdgePoint().values().stream() - .sorted((nrg1, nrg2) -> nrg1.getNodeEdgePointUuid().getValue() - .compareTo(nrg2.getNodeEdgePointUuid().getValue())) - .collect(Collectors.toList()); - assertEquals("in the sorted node-rule-group, nep number 2 should be XPDR2-NETWORK1", - networkNepUuid, nrg.get(4).getNodeEdgePointUuid()); - assertEquals("in the sorted node-rule-group, nep number 6 should be XPDR2-CLIENT4", - clientNepUuid, nrg.get(3).getNodeEdgePointUuid()); - assertEquals("any item of the node-rule-group should have the same nodeUuid", - nodeUuid, nrg.get(4).getNodeUuid()); - assertEquals("any item of the node-rule-group should have the same nodeUuid", - nodeUuid, nrg.get(3).getNodeUuid()); - @Nullable - List ruleList = new ArrayList<>(nrgList.get(0).nonnullRule().values()); - assertEquals("node-rule-group should contain a single rule", 1, ruleList.size()); - assertEquals("local-id of the rule should be 'forward'", - "forward", ruleList.get(0).getLocalId()); - assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", - ForwardingRule.MAYFORWARDACROSSGROUP, ruleList.get(0).getForwardingRule()); - assertEquals("the rule type should be 'FORWARDING'", - RuleType.FORWARDING, ruleList.get(0).getRuleType()); - } - - private void checkNodeRuleGroupForMuxOTSi(List nrgList, Uuid enepUuid, Uuid inepUuid, - Uuid nodeUuid) { - assertEquals("Mux-OTSi should contain a single node rule group", 1, nrgList.size()); - List nodeEdgePointList = new ArrayList<>(nrgList.get(0).getNodeEdgePoint().values()); - assertEquals("Mux-OTSi node-rule-group should contain 2 NEP", 2, nodeEdgePointList.size()); - assertThat("Mux-OTSi node-rule-group should be between eNEP and iNEP of XPDR1-NETWORK1", - nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), - either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); - assertThat("Mux-OTSi node-rule-group should be between eNEP and iNEP of XPDR1-NETWORK1", - nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), - either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); - assertEquals("any item of the node-rule-group should have the same nodeUuid", - nodeUuid, nodeEdgePointList.get(0).getNodeUuid()); - assertEquals("any item of the node-rule-group should have the same nodeUuid", - nodeUuid, nodeEdgePointList.get(1).getNodeUuid()); - List ruleList = new ArrayList<>(nrgList.get(0).nonnullRule().values()); - assertEquals("node-rule-group should contain a single rule", 1, ruleList.size()); - assertEquals("local-id of the rule should be 'forward'", - "forward", ruleList.get(0).getLocalId()); - assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", - ForwardingRule.MAYFORWARDACROSSGROUP, ruleList.get(0).getForwardingRule()); - assertEquals("the rule type should be 'FORWARDING'", - RuleType.FORWARDING, ruleList.get(0).getRuleType()); - } - - private void checkNodeRuleGroupForSwitchOTSi(List nrgList, Uuid enepUuid, Uuid inepUuid, - Uuid nodeUuid) { - assertEquals("Switch-OTSi should contain 4 node rule group", 4, nrgList.size()); - for (NodeRuleGroup nodeRuleGroup : nrgList) { - assertEquals("each node-rule-group should contain 2 NEP for Switch-OTSi", - 2, nodeRuleGroup.getNodeEdgePoint().size()); - } - List nodeEdgePointList1 = new ArrayList<>(nrgList.get(3).nonnullNodeEdgePoint().values()); - assertThat("Switch-OTSi node-rule-group nb 4 should be between eNEP and iNEP of XPDR2-NETWORK2", - nodeEdgePointList1.get(0).getNodeEdgePointUuid().getValue(), - either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); - assertThat("Switch-OTSi node-rule-group nb 4 should be between eNEP and iNEP of XPDR2-NETWORK2", - nodeEdgePointList1.get(1).getNodeEdgePointUuid().getValue(), - either(containsString(enepUuid.getValue())).or(containsString(inepUuid.getValue()))); - List nodeEdgePointList0 = new ArrayList<>(nrgList.get(0).getNodeEdgePoint().values()); - assertEquals("any item of the node-rule-group should have the same nodeUuid", - nodeUuid, nodeEdgePointList0.get(0).getNodeUuid()); - assertEquals("any item of the node-rule-group should have the same nodeUuid", - nodeUuid, nodeEdgePointList0.get(1).getNodeUuid()); - List ruleList0 = new ArrayList<>(nrgList.get(0).nonnullRule().values()); - assertEquals("node-rule-group should contain a single rule", 1, ruleList0.size()); - assertEquals("local-id of the rule should be 'forward'", - "forward", ruleList0.get(0).getLocalId()); - assertEquals("the forwarding rule should be 'MAYFORWARDACROSSGROUP'", - ForwardingRule.MAYFORWARDACROSSGROUP, ruleList0.get(0).getForwardingRule()); - assertEquals("the rule type should be 'FORWARDING'", - RuleType.FORWARDING, ruleList0.get(0).getRuleType()); - } - - private void checkNepClient100G(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { - assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); - List nameList = new ArrayList<>(nep.nonnullName().values()); - assertEquals("value of client nep should be '" + portName + "'", - portName, nameList.get(0).getValue()); - assertEquals("value-name of client nep for '" + portName + "' should be '" + nepName + "'", - nepName, nameList.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(ODUTYPEODU4.class, DIGITALSIGNALTYPE100GigE.class)); - assertEquals("client nep should be of ETH protocol type", LayerProtocolName.ETH, nep.getLayerProtocolName()); - checkCommonPartOfNep(nep); - } - - private void checkNepOtsiNode(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName) { - assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid()); - List nameList = new ArrayList<>(nep.nonnullName().values()); - assertEquals("value of OTSi nep should be '" + portName + "'", - portName, nameList.get(0).getValue()); - assertEquals("value-name of OTSi nep should be '" + nepName + "'", - nepName, nameList.get(0).getValueName()); - assertEquals("OTSi nep should support 2 kind of cep", - 2, nep.getSupportedCepLayerProtocolQualifier().size()); - assertThat("OTSi nep should support 2 kind of cep", - nep.getSupportedCepLayerProtocolQualifier(), - hasItems(PHOTONICLAYERQUALIFIEROMS.class, PHOTONICLAYERQUALIFIEROTSi.class)); - assertEquals("OTSi nep should be of PHOTONIC_MEDIA protocol type", - LayerProtocolName.PHOTONICMEDIA, nep.getLayerProtocolName()); - assertEquals("OTSi nep should support one SIP", 1, nep.getMappedServiceInterfacePoint().size()); - checkCommonPartOfNep(nep); - } - - private void checkCommonPartOfNep(OwnedNodeEdgePoint nep) { - assertEquals("link port direction should be DIRECTIONAL", - PortDirection.BIDIRECTIONAL, nep.getLinkPortDirection()); - assertEquals("administrative state should be UNLOCKED", - AdministrativeState.UNLOCKED, nep.getAdministrativeState()); - assertEquals("termination state should be TERMINATED BIDIRECTIONAL", - TerminationState.TERMINATEDBIDIRECTIONAL, nep.getTerminationState()); - assertEquals("life-cycle state should be INSTALLED", LifecycleState.INSTALLED, nep.getLifecycleState()); - assertEquals("client nep should support 1 SIP", 1, nep.getMappedServiceInterfacePoint().size()); - assertEquals("termination direction should be BIDIRECTIONAL", - TerminationDirection.BIDIRECTIONAL, nep.getTerminationDirection()); - assertEquals("operational state of client nep should be ENABLED", - OperationalState.ENABLED, nep.getOperationalState()); - assertEquals("link-port-role of client nep should be SYMMETRIC", - PortRole.SYMMETRIC, nep.getLinkPortRole()); - } - - private void checkTransitionalLink(Link link, Uuid topoUuid, Uuid node1Uuid, Uuid node2Uuid, String tp1, - String tp2, String ietfNodeId) { - Uuid linkUuid = new Uuid(UUID.nameUUIDFromBytes((ietfNodeId + "--" + tp1 + "--" + tp2) - .getBytes(Charset.forName("UTF-8"))).toString()); - assertEquals("bad uuid for link between DSR node " + tp1 + " and iOTSI port " + tp2, linkUuid, link.getUuid()); - assertEquals("Available capacity unit should be GBPS", - CapacityUnit.GBPS, link.getAvailableCapacity().getTotalSize().getUnit()); - assertEquals("Available capacity -total size value should be 100", - Uint64.valueOf(100), link.getAvailableCapacity().getTotalSize().getValue()); - assertEquals("transitional link should be between 2 nodes of protocol layers ODU and PHOTONIC_MEDIA", - 2, link.getTransitionedLayerProtocolName().size()); - assertThat("transitional link should be between 2 nodes of protocol layers ODU and PHOTONIC_MEDIA", - link.getTransitionedLayerProtocolName(), - hasItems(LayerProtocolName.ODU.getName(), LayerProtocolName.PHOTONICMEDIA.getName())); - assertEquals("transitional link should be BIDIRECTIONAL", - ForwardingDirection.BIDIRECTIONAL, link.getDirection()); - List nodeEdgePointList = new ArrayList<>(link.nonnullNodeEdgePoint().values()); - assertEquals("topology uuid should be the same for the two termination point of the link", - topoUuid, nodeEdgePointList.get(0).getTopologyUuid()); - assertEquals("topology uuid should be the same for the two termination point of the link", - topoUuid, nodeEdgePointList.get(1).getTopologyUuid()); - assertThat("transitional links should terminate on DSR node and Photonic node", - nodeEdgePointList.get(0).getNodeUuid().getValue(), - either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); - assertThat("transitional links should terminate on DSR node and Photonic node", - nodeEdgePointList.get(1).getNodeUuid().getValue(), - either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue()))); - Uuid nep1Uuid = new Uuid(UUID.nameUUIDFromBytes(tp1.getBytes(Charset.forName("UTF-8"))).toString()); - Uuid nep2Uuid = new Uuid(UUID.nameUUIDFromBytes(tp2.getBytes(Charset.forName("UTF-8"))).toString()); - assertThat("transitional links should terminate on " + tp1 + " and " + tp2 + " neps", - nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(), - either(containsString(nep1Uuid.getValue())).or(containsString(nep2Uuid.getValue()))); - assertThat("transitional links should terminate on DSR node and Photonic node", - nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(), - either(containsString(nep1Uuid.getValue())).or(containsString(nep2Uuid.getValue()))); - } - private void checkOtnLink(Link link, Uuid topoUuid, Uuid node1Uuid, Uuid node2Uuid, Uuid tp1Uuid, Uuid tp2Uuid, Uuid linkUuid, String linkName) { assertEquals("bad name for the link", linkName, link.getName().get(new NameKey("otn link name")).getValue()); @@ -613,5 +222,4 @@ public class TapiTopologyImplTest extends AbstractTest { assertEquals("administrative state should be UNLOCKED", AdministrativeState.UNLOCKED, link.getAdministrativeState()); } - } diff --git a/tapi/src/test/java/org/opendaylight/transportpce/tapi/utils/TopologyDataUtils.java b/tapi/src/test/java/org/opendaylight/transportpce/tapi/utils/TopologyDataUtils.java index 2d669c1c3..80b393ddb 100644 --- a/tapi/src/test/java/org/opendaylight/transportpce/tapi/utils/TopologyDataUtils.java +++ b/tapi/src/test/java/org/opendaylight/transportpce/tapi/utils/TopologyDataUtils.java @@ -33,10 +33,9 @@ import org.slf4j.LoggerFactory; public final class TopologyDataUtils { private static final Logger LOG = LoggerFactory.getLogger(TopologyDataUtils.class); - public static final String OPENROADM_TOPOLOGY_FILE = "src/test/resources/openroadm-topology2.xml"; - public static final String OTN_TOPOLOGY_FILE = "src/test/resources/otn-topology.xml"; + public static final String OPENROADM_TOPOLOGY_FILE = "src/test/resources/get_openroadm-topology2.xml"; public static final String OTN_TOPOLOGY_WITH_OTN_LINKS_FILE = "src/test/resources/otn-topology-with-otn-links.xml"; - public static final String PORTMAPPING_FILE = "src/test/resources/portmapping-example.xml"; + public static final String PORTMAPPING_FILE = "src/test/resources/get_portmapping.xml"; public static GetTopologyDetailsInput buildGetTopologyDetailsInput(String topoName) { GetTopologyDetailsInputBuilder builtInput = new GetTopologyDetailsInputBuilder(); diff --git a/tapi/src/test/resources/openroadm-topology2.xml b/tapi/src/test/resources/get_openroadm-topology2.xml similarity index 88% rename from tapi/src/test/resources/openroadm-topology2.xml rename to tapi/src/test/resources/get_openroadm-topology2.xml index 6227643cd..2a9c9b24a 100644 --- a/tapi/src/test/resources/openroadm-topology2.xml +++ b/tapi/src/test/resources/get_openroadm-topology2.xml @@ -3,2579 +3,2793 @@ openroadm-topology - + ROADM-A1-SRG3 - 94 + 95 - 93 + 94 96 - 95 + 43 42 - 41 + 45 44 - 43 + 39 38 - 37 + 41 40 - 39 + 35 34 - 33 + 37 36 - 35 + 31 30 - 29 + 33 32 - 31 + 59 58 - 57 + 61 60 - 59 + 55 54 - 53 + 57 56 - 55 + 51 50 - 49 + 53 52 - 51 + 47 46 - 45 + 49 48 - 47 + 75 74 - 73 + 77 76 - 75 + 71 70 - 69 + 73 72 - 71 + 67 66 - 65 + 69 68 - 67 + 63 62 - 61 + 65 64 - 63 + 91 90 - 89 + 93 92 - 91 + 87 86 - 85 + 89 88 - 87 + 83 82 - 81 + 85 84 - 83 + 79 78 - 77 + 81 80 - 79 + 11 10 - 9 + 13 12 - 11 + 7 6 - 5 + 9 8 - 7 + 3 2 - 1 + 5 4 - 3 + 1 + + + 27 26 - 25 + 29 28 - 27 + 23 22 - 21 + 25 24 - 23 + 19 18 - 17 + 21 20 - 19 + 15 14 - 13 + 17 16 - - 15 - - SRG3-CP-TXRX - SRG-TXRX-CP + SRG3-PP3-TXRX + SRG-TXRX-PP SRG3-PP2-TXRX SRG-TXRX-PP - SRG3-PP4-TXRX - SRG-TXRX-PP + SRG3-CP-TXRX + SRG-TXRX-CP SRG3-PP1-TXRX SRG-TXRX-PP - SRG3-PP3-TXRX + SRG3-PP4-TXRX SRG-TXRX-PP - SRG - - openroadm-network - ROADM-A1 - clli-network NodeA + + openroadm-network + ROADM-A1 + + SRG - ROADM-C1-DEG2 - - 2 + ROADM-C1-SRG1 + - 94 + 95 - 93 + 94 96 - 95 + 43 42 - 41 + 45 44 - 43 + 39 38 - 37 + 41 40 - 39 + 35 34 - 33 + 37 36 - 35 + 31 30 - 29 + 33 32 - 31 + 59 58 - 57 + 61 60 - 59 + 55 54 - 53 + 57 56 - 55 + 51 50 - 49 + 53 52 - 51 + 47 46 - 45 + 49 48 - 47 + 75 74 - 73 + 77 76 - 75 + 71 70 - 69 + 73 72 - 71 + 67 66 - 65 + 69 68 - 67 + 63 62 - 61 + 65 64 - 63 + 91 90 - 89 + 93 92 - 91 + 87 86 - 85 + 89 88 - 87 + 83 82 - 81 + 85 84 - 83 + 79 78 - 77 + 81 80 - 79 + 11 10 - 9 + 13 12 - 11 + 7 6 - 5 + 9 8 - 7 + 3 2 - 1 + 5 4 - 3 + 1 + + + 27 26 - 25 + 29 28 - 27 + 23 22 - 21 + 25 24 - 23 + 19 18 - 17 + 21 20 - 19 + 15 14 - 13 + 17 16 - - 15 - - + - DEG2-CTP-TXRX - DEGREE-TXRX-CTP + SRG1-PP4-TXRX + SRG-TXRX-PP - DEG2-TTP-TXRX - DEGREE-TXRX-TTP + SRG1-PP1-TXRX + SRG-TXRX-PP + + + SRG1-PP2-TXRX + SRG-TXRX-PP + + + SRG1-PP3-TXRX + SRG-TXRX-PP + + + SRG1-CP-TXRX + SRG-TXRX-CP - DEGREE - - openroadm-network - ROADM-C1 - clli-network NodeC + + openroadm-network + ROADM-C1 + + SRG - ROADM-C1-SRG1 + ROADM-A1-SRG1 - 94 + 95 - 93 + 94 96 - 95 + 43 42 - 41 + 45 44 - 43 + 39 38 - 37 + 41 40 - 39 + 35 34 - 33 + 37 36 - 35 + 31 30 - 29 + 33 32 - 31 + 59 58 - 57 + 61 60 - 59 + 55 54 - 53 + 57 56 - 55 + 51 50 - 49 + 53 52 - 51 + 47 46 - 45 + 49 48 - 47 + 75 74 - 73 + 77 76 - 75 + 71 70 - 69 + 73 72 - 71 + 67 66 - 65 + 69 68 - 67 + 63 62 - 61 + 65 64 - 63 + 91 90 - 89 + 93 92 - 91 + 87 86 - 85 + 89 88 - 87 + 83 82 - 81 + 85 84 - 83 + 79 78 - 77 + 81 80 - 79 + 11 10 - 9 + 13 12 - 11 + 7 6 - 5 + 9 8 - 7 + 3 2 - 1 + 5 4 - 3 + 1 + + + 27 26 - 25 + 29 28 - 27 + 23 22 - 21 + 25 24 - 23 + 19 18 - 17 + 21 20 - 19 + 15 14 - 13 + 17 16 - - 15 - SRG1-PP4-TXRX SRG-TXRX-PP - SRG1-CP-TXRX - SRG-TXRX-CP + SRG1-PP1-TXRX + SRG-TXRX-PP SRG1-PP2-TXRX SRG-TXRX-PP - SRG1-PP1-TXRX + SRG1-PP3-TXRX SRG-TXRX-PP - SRG1-PP3-TXRX - SRG-TXRX-PP + SRG1-CP-TXRX + SRG-TXRX-CP + + clli-network + NodeA + + + openroadm-network + ROADM-A1 + SRG + + + SPDR-SA1-XPDR1 + + XPDR1-NETWORK1 + XPONDER-NETWORK + + ROADM-A1-SRG1--SRG1-PP2-TXRX + + + openroadm-network - ROADM-C1 + SPDR-SA1 clli-network - NodeC + NodeSA + XPONDER - ROADM-A1-SRG1 - + ROADM-A1-DEG1 + + 1 - 94 + 95 - 93 + 94 96 - 95 + 43 42 - 41 + 45 44 - 43 + 39 38 - 37 + 41 40 - 39 + 35 34 - 33 + 37 36 - 35 + 31 30 - 29 + 33 32 - 31 + 59 58 - 57 + 61 60 - 59 + 55 54 - 53 + 57 56 - 55 + 51 50 - 49 + 53 52 - 51 + 47 46 - 45 + 49 48 - 47 + 75 74 - 73 + 77 76 - 75 + 71 70 - 69 + 73 72 - 71 + 67 66 - 65 + 69 68 - 67 + 63 62 - 61 + 65 64 - 63 + 91 90 - 89 + 93 92 - 91 + 87 86 - 85 + 89 88 - 87 + 83 82 - 81 + 85 84 - 83 + 79 78 - 77 + 81 80 - 79 + 11 10 - 9 + 13 12 - 11 + 7 6 - 5 + 9 8 - 7 + 3 2 - 1 + 5 4 - 3 + 1 + + + 27 26 - 25 + 29 28 - 27 + 23 22 - 21 + 25 24 - 23 + 19 18 - 17 + 21 20 - 19 + 15 14 - 13 + 17 16 - - 15 - - + - SRG1-PP4-TXRX - SRG-TXRX-PP + DEG1-CTP-TXRX + DEGREE-TXRX-CTP - SRG1-CP-TXRX - SRG-TXRX-CP + DEG1-TTP-TXRX + DEGREE-TXRX-TTP - - SRG1-PP2-TXRX - SRG-TXRX-PP - - - SRG1-PP1-TXRX - SRG-TXRX-PP - - - SRG1-PP3-TXRX - SRG-TXRX-PP - - SRG - - openroadm-network - ROADM-A1 - clli-network NodeA - - - XPDR-A1-XPDR1 - - XPDR1-CLIENT2 - XPDR1-NETWORK2 - XPONDER-CLIENT - - - XPDR1-NETWORK2 - XPDR1-CLIENT2 - XPONDER-NETWORK - - - XPDR1-CLIENT1 - XPDR1-NETWORK1 - XPONDER-CLIENT - - - XPDR1-NETWORK1 - - ROADM-A1-SRG1--SRG1-PP1-TXRX - - XPDR1-CLIENT1 - XPONDER-NETWORK - - XPONDER openroadm-network - XPDR-A1 - - - clli-network - NodeA + ROADM-A1 + DEGREE ROADM-A1-DEG2 2 - 94 + 95 - 93 + 94 96 - 95 + 43 42 - 41 + 45 44 - 43 + 39 38 - 37 + 41 40 - 39 + 35 34 - 33 + 37 36 - 35 + 31 30 - 29 + 33 32 - 31 + 59 58 - 57 + 61 60 - 59 + 55 54 - 53 + 57 56 - 55 + 51 50 - 49 + 53 52 - 51 + 47 46 - 45 + 49 48 - 47 + 75 74 - 73 + 77 76 - 75 + 71 70 - 69 + 73 72 - 71 + 67 66 - 65 + 69 68 - 67 + 63 62 - 61 + 65 64 - 63 + 91 90 - 89 + 93 92 - 91 + 87 86 - 85 + 89 88 - 87 + 83 82 - 81 + 85 84 - 83 + 79 78 - 77 + 81 80 - 79 + 11 10 - 9 + 13 12 - 11 + 7 6 - 5 + 9 8 - 7 + 3 2 - 1 + 5 4 - 3 + 1 + + + 27 26 - 25 + 29 28 - 27 + 23 22 - 21 + 25 24 - 23 + 19 18 - 17 + 21 20 - 19 + 15 14 - 13 + 17 16 - - 15 - + + DEG2-TTP-TXRX + DEGREE-TXRX-TTP + DEG2-CTP-TXRX DEGREE-TXRX-CTP + + clli-network + NodeA + + + openroadm-network + ROADM-A1 + + DEGREE + + + SPDR-SC1-XPDR1 - DEG2-TTP-TXRX - DEGREE-TXRX-TTP + XPDR1-NETWORK1 + XPONDER-NETWORK + + ROADM-C1-SRG1--SRG1-PP2-TXRX + + - DEGREE openroadm-network - ROADM-A1 + SPDR-SC1 clli-network - NodeA + NodeSC + XPONDER - ROADM-A1-DEG1 + ROADM-C1-DEG1 1 - 94 + 95 - 93 + 94 96 - 95 + 43 42 - 41 + 45 44 - 43 + 39 38 - 37 + 41 40 - 39 + 35 34 - 33 + 37 36 - 35 + 31 30 - 29 + 33 32 - 31 + 59 58 - 57 + 61 60 - 59 + 55 54 - 53 + 57 56 - 55 + 51 50 - 49 + 53 52 - 51 + 47 46 - 45 + 49 48 - 47 + 75 74 - 73 + 77 76 - 75 + 71 70 - 69 + 73 72 - 71 + 67 66 - 65 + 69 68 - 67 + 63 62 - 61 + 65 64 - 63 + 91 90 - 89 + 93 92 - 91 + 87 86 - 85 + 89 88 - 87 + 83 82 - 81 + 85 84 - 83 + 79 78 - 77 + 81 80 - 79 + 11 10 - 9 + 13 12 - 11 + 7 6 - 5 + 9 8 - 7 + 3 2 - 1 + 5 4 - 3 + 1 + + + 27 26 - 25 + 29 28 - 27 + 23 22 - 21 + 25 24 - 23 + 19 18 - 17 + 21 20 - 19 + 15 14 - 13 + 17 16 - - 15 - - - DEG1-TTP-TXRX - DEGREE-TXRX-TTP - DEG1-CTP-TXRX DEGREE-TXRX-CTP - DEGREE - - openroadm-network - ROADM-A1 - - - clli-network - NodeA - - - - XPDR-C1-XPDR1 - - XPDR1-CLIENT2 - XPDR1-NETWORK2 - XPONDER-CLIENT - - - XPDR1-NETWORK2 - XPDR1-CLIENT2 - XPONDER-NETWORK - - XPDR1-CLIENT1 - XPDR1-NETWORK1 - XPONDER-CLIENT - - - XPDR1-NETWORK1 - - ROADM-C1-SRG1--SRG1-PP1-TXRX - - XPDR1-CLIENT1 - XPONDER-NETWORK + DEG1-TTP-TXRX + DEGREE-TXRX-TTP - XPONDER - - openroadm-network - XPDR-C1 - clli-network NodeC + + openroadm-network + ROADM-C1 + + DEGREE - ROADM-C1-DEG1 + ROADM-C1-DEG2 - 1 + 2 - 94 + 95 - 93 + 94 96 - 95 + 43 42 - 41 + 45 44 - 43 + 39 38 - 37 + 41 40 - 39 + 35 34 - 33 + 37 36 - 35 + 31 30 - 29 + 33 32 - 31 + 59 58 - 57 + 61 60 - 59 + 55 54 - 53 + 57 56 - 55 + 51 50 - 49 + 53 52 - 51 + 47 46 - 45 + 49 48 - 47 + 75 74 - 73 + 77 76 - 75 + 71 70 - 69 + 73 72 - 71 + 67 66 - 65 + 69 68 - 67 + 63 62 - 61 + 65 64 - 63 + 91 90 - 89 + 93 92 - 91 + 87 86 - 85 + 89 88 - 87 + 83 82 - 81 + 85 84 - 83 + 79 78 - 77 + 81 80 - 79 + 11 10 - 9 + 13 12 - 11 + 7 6 - 5 + 9 8 - 7 + 3 2 - 1 + 5 4 - 3 + 1 + + + 27 26 - 25 + 29 28 - 27 + 23 22 - 21 + 25 24 - 23 + 19 18 - 17 + 21 20 - 19 + 15 14 - 13 + 17 16 - - 15 - - DEG1-TTP-TXRX + DEG2-TTP-TXRX DEGREE-TXRX-TTP - DEG1-CTP-TXRX + DEG2-CTP-TXRX DEGREE-TXRX-CTP - DEGREE + + clli-network + NodeC + openroadm-network ROADM-C1 + DEGREE + + + SPDR-SA1-XPDR2 + + XPDR2-NETWORK1 + XPONDER-NETWORK + + + XPDR2-NETWORK3 + XPONDER-NETWORK + + ROADM-A1-SRG1--SRG1-PP4-TXRX + + + + + XPDR2-NETWORK2 + XPONDER-NETWORK + + ROADM-A1-SRG1--SRG1-PP3-TXRX + + + + + XPDR2-NETWORK4 + XPONDER-NETWORK + + + openroadm-network + SPDR-SA1 + clli-network - NodeC + NodeSA + XPONDER + + + SPDR-SC1-XPDR2 + + XPDR2-NETWORK1 + XPONDER-NETWORK + + + XPDR2-NETWORK3 + XPONDER-NETWORK + + ROADM-C1-SRG1--SRG1-PP4-TXRX + + + + + XPDR2-NETWORK2 + XPONDER-NETWORK + + ROADM-C1-SRG1--SRG1-PP3-TXRX + + + + + XPDR2-NETWORK4 + XPONDER-NETWORK + + + openroadm-network + SPDR-SC1 + + + clli-network + NodeSC + + XPONDER - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX + ROADM-C1-SRG1-SRG1-PP2-TXRXtoSPDR-SC1-XPDR1-XPDR1-NETWORK1 + - ROADM-A1-DEG1 - DEG1-CTP-TXRX + ROADM-C1-SRG1 + SRG1-PP2-TXRX - ROADM-A1-SRG3 - SRG3-CP-TXRX + XPDR1-NETWORK1 + SPDR-SC1-XPDR1 - DROP-LINK - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + SPDR-SC1-XPDR1-XPDR1-NETWORK1toROADM-C1-SRG1-SRG1-PP2-TXRX + + XPONDER-INPUT - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX + - ROADM-A1-SRG3 - SRG3-CP-TXRX + ROADM-A1-DEG2 + DEG2-TTP-TXRX + + ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX + + - ROADM-A1-DEG2 - DEG2-CTP-TXRX + DEG1-TTP-TXRX + ROADM-C1-DEG1 - ADD-LINK - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX + ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX + + ROADM-TO-ROADM - ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX + ROADM-C1-SRG1-SRG1-PP3-TXRXtoSPDR-SC1-XPDR2-XPDR2-NETWORK2 + - ROADM-C1-DEG1 - DEG1-TTP-TXRX + ROADM-C1-SRG1 + SRG1-PP3-TXRX - - ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX - - ROADM-A1-DEG2 - DEG2-TTP-TXRX + XPDR2-NETWORK2 + SPDR-SC1-XPDR2 - ROADM-TO-ROADM - ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX + SPDR-SC1-XPDR2-XPDR2-NETWORK2toROADM-C1-SRG1-SRG1-PP3-TXRX + + XPONDER-INPUT - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX + ROADM-A1-SRG1-SRG1-PP4-TXRXtoSPDR-SA1-XPDR2-XPDR2-NETWORK3 + - ROADM-C1-DEG2 - DEG2-CTP-TXRX + ROADM-A1-SRG1 + SRG1-PP4-TXRX + + + XPDR2-NETWORK3 + SPDR-SA1-XPDR2 + + SPDR-SA1-XPDR2-XPDR2-NETWORK3toROADM-A1-SRG1-SRG1-PP4-TXRX + + XPONDER-INPUT + + + ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX + + + ROADM-C1-DEG1 + DEG1-CTP-TXRX - ROADM-C1-SRG1 SRG1-CP-TXRX + ROADM-C1-SRG1 + ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX + DROP-LINK - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX - ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX + SPDR-SA1-XPDR2-XPDR2-NETWORK3toROADM-A1-SRG1-SRG1-PP4-TXRX + - ROADM-A1-DEG2 - DEG2-TTP-TXRX + SPDR-SA1-XPDR2 + XPDR2-NETWORK3 - - ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX - - ROADM-C1-DEG1 - DEG1-TTP-TXRX + SRG1-PP4-TXRX + ROADM-A1-SRG1 - ROADM-TO-ROADM - ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX + ROADM-A1-SRG1-SRG1-PP4-TXRXtoSPDR-SA1-XPDR2-XPDR2-NETWORK3 + + XPONDER-OUTPUT - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX + SPDR-SC1-XPDR1-XPDR1-NETWORK1toROADM-C1-SRG1-SRG1-PP2-TXRX + - ROADM-C1-DEG2 - DEG2-CTP-TXRX + SPDR-SC1-XPDR1 + XPDR1-NETWORK1 + + + SRG1-PP2-TXRX + ROADM-C1-SRG1 + + ROADM-C1-SRG1-SRG1-PP2-TXRXtoSPDR-SC1-XPDR1-XPDR1-NETWORK1 + + XPONDER-OUTPUT + + + ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + + + ROADM-A1-SRG3 + SRG3-CP-TXRX - ROADM-C1-DEG1 DEG1-CTP-TXRX + ROADM-A1-DEG1 - EXPRESS-LINK - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX + ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX + + ADD-LINK - XPDR-A1-XPDR1-XPDR1-NETWORK1toROADM-A1-SRG1-SRG1-PP1-TXRX + SPDR-SC1-XPDR2-XPDR2-NETWORK2toROADM-C1-SRG1-SRG1-PP3-TXRX + - XPDR-A1-XPDR1 - XPDR1-NETWORK1 + SPDR-SC1-XPDR2 + XPDR2-NETWORK2 - ROADM-A1-SRG1 - SRG1-PP1-TXRX + SRG1-PP3-TXRX + ROADM-C1-SRG1 + ROADM-C1-SRG1-SRG1-PP3-TXRXtoSPDR-SC1-XPDR2-XPDR2-NETWORK2 + XPONDER-OUTPUT - ROADM-A1-SRG1-SRG1-PP1-TXRXtoXPDR-A1-XPDR1-XPDR1-NETWORK1 - XPDR-C1-XPDR1-XPDR1-NETWORK1toROADM-C1-SRG1-SRG1-PP1-TXRX + ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + + + ROADM-A1-SRG3 + SRG3-CP-TXRX + + + DEG2-CTP-TXRX + ROADM-A1-DEG2 + + ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX + + ADD-LINK + + + ROADM-C1-SRG1-SRG1-PP4-TXRXtoSPDR-SC1-XPDR2-XPDR2-NETWORK3 + + + ROADM-C1-SRG1 + SRG1-PP4-TXRX + + + XPDR2-NETWORK3 + SPDR-SC1-XPDR2 + + SPDR-SC1-XPDR2-XPDR2-NETWORK3toROADM-C1-SRG1-SRG1-PP4-TXRX + + XPONDER-INPUT + + + ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX + + + ROADM-A1-DEG1 + DEG1-CTP-TXRX + + + SRG3-CP-TXRX + ROADM-A1-SRG3 + + ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + + DROP-LINK + + + SPDR-SA1-XPDR1-XPDR1-NETWORK1toROADM-A1-SRG1-SRG1-PP2-TXRX + - XPDR-C1-XPDR1 + SPDR-SA1-XPDR1 XPDR1-NETWORK1 - ROADM-C1-SRG1 - SRG1-PP1-TXRX + SRG1-PP2-TXRX + ROADM-A1-SRG1 + ROADM-A1-SRG1-SRG1-PP2-TXRXtoSPDR-SA1-XPDR1-XPDR1-NETWORK1 + XPONDER-OUTPUT - ROADM-C1-SRG1-SRG1-PP1-TXRXtoXPDR-C1-XPDR1-XPDR1-NETWORK1 - ROADM-C1-SRG1-SRG1-PP1-TXRXtoXPDR-C1-XPDR1-XPDR1-NETWORK1 + ROADM-A1-SRG1-SRG1-PP2-TXRXtoSPDR-SA1-XPDR1-XPDR1-NETWORK1 + - ROADM-C1-SRG1 - SRG1-PP1-TXRX + ROADM-A1-SRG1 + SRG1-PP2-TXRX - XPDR-C1-XPDR1 XPDR1-NETWORK1 + SPDR-SA1-XPDR1 + SPDR-SA1-XPDR1-XPDR1-NETWORK1toROADM-A1-SRG1-SRG1-PP2-TXRX + XPONDER-INPUT - XPDR-C1-XPDR1-XPDR1-NETWORK1toROADM-C1-SRG1-SRG1-PP1-TXRX - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX + ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX + + + ROADM-C1-DEG1 + DEG1-TTP-TXRX + + + ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX + + + + DEG2-TTP-TXRX + ROADM-A1-DEG2 + + ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX + + ROADM-TO-ROADM + + + ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX + + + ROADM-C1-DEG2 + DEG2-CTP-TXRX + + + DEG1-CTP-TXRX + ROADM-C1-DEG1 + + ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX + + EXPRESS-LINK + + + ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX + + + ROADM-C1-DEG2 + DEG2-CTP-TXRX + + + SRG1-CP-TXRX + ROADM-C1-SRG1 + + ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX + + DROP-LINK + + + ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX + ROADM-A1-DEG2 DEG2-CTP-TXRX - ROADM-A1-SRG1 SRG1-CP-TXRX + ROADM-A1-SRG1 + ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + DROP-LINK - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX + ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX + ROADM-C1-DEG1 DEG1-CTP-TXRX - ROADM-C1-DEG2 DEG2-CTP-TXRX + ROADM-C1-DEG2 + ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX + EXPRESS-LINK - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX + SPDR-SC1-XPDR2-XPDR2-NETWORK3toROADM-C1-SRG1-SRG1-PP4-TXRX + - ROADM-A1-DEG2 - DEG2-CTP-TXRX + SPDR-SC1-XPDR2 + XPDR2-NETWORK3 - ROADM-A1-SRG3 - SRG3-CP-TXRX + SRG1-PP4-TXRX + ROADM-C1-SRG1 - DROP-LINK - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + ROADM-C1-SRG1-SRG1-PP4-TXRXtoSPDR-SC1-XPDR2-XPDR2-NETWORK3 + + XPONDER-OUTPUT - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + ROADM-A1-DEG2 DEG2-CTP-TXRX - ROADM-A1-DEG1 DEG1-CTP-TXRX + ROADM-A1-DEG1 + ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + EXPRESS-LINK - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + ROADM-A1-SRG1 SRG1-CP-TXRX - ROADM-A1-DEG1 DEG1-CTP-TXRX + ROADM-A1-DEG1 + ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX + ADD-LINK - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX + ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX + - ROADM-C1-DEG1 - DEG1-CTP-TXRX + ROADM-A1-DEG2 + DEG2-CTP-TXRX - ROADM-C1-SRG1 - SRG1-CP-TXRX + SRG3-CP-TXRX + ROADM-A1-SRG3 + ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + DROP-LINK - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX + ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + - ROADM-C1-SRG1 + ROADM-A1-SRG1 SRG1-CP-TXRX - ROADM-C1-DEG2 DEG2-CTP-TXRX + ROADM-A1-DEG2 + ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX + ADD-LINK - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + SPDR-SA1-XPDR2-XPDR2-NETWORK2toROADM-A1-SRG1-SRG1-PP3-TXRX + - ROADM-A1-SRG1 - SRG1-CP-TXRX + SPDR-SA1-XPDR2 + XPDR2-NETWORK2 - ROADM-A1-DEG2 - DEG2-CTP-TXRX + SRG1-PP3-TXRX + ROADM-A1-SRG1 - ADD-LINK - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX + ROADM-A1-SRG1-SRG1-PP3-TXRXtoSPDR-SA1-XPDR2-XPDR2-NETWORK2 + + XPONDER-OUTPUT - ROADM-A1-SRG1-SRG1-PP1-TXRXtoXPDR-A1-XPDR1-XPDR1-NETWORK1 + ROADM-A1-SRG1-SRG1-PP3-TXRXtoSPDR-SA1-XPDR2-XPDR2-NETWORK2 + ROADM-A1-SRG1 - SRG1-PP1-TXRX + SRG1-PP3-TXRX - XPDR-A1-XPDR1 - XPDR1-NETWORK1 + XPDR2-NETWORK2 + SPDR-SA1-XPDR2 + SPDR-SA1-XPDR2-XPDR2-NETWORK2toROADM-A1-SRG1-SRG1-PP3-TXRX + XPONDER-INPUT - XPDR-A1-XPDR1-XPDR1-NETWORK1toROADM-A1-SRG1-SRG1-PP1-TXRX - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX + - ROADM-A1-DEG1 - DEG1-CTP-TXRX + ROADM-C1-SRG1 + SRG1-CP-TXRX - ROADM-A1-DEG2 DEG2-CTP-TXRX + ROADM-C1-DEG2 - EXPRESS-LINK - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - ROADM-A1-SRG3 - SRG3-CP-TXRX - - - ROADM-A1-DEG1 - DEG1-CTP-TXRX - + ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX + ADD-LINK - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX + ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX + ROADM-A1-DEG1 DEG1-CTP-TXRX - ROADM-A1-SRG1 SRG1-CP-TXRX + ROADM-A1-SRG1 + ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + DROP-LINK - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX + ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX + ROADM-C1-SRG1 SRG1-CP-TXRX - ROADM-C1-DEG1 DEG1-CTP-TXRX + ROADM-C1-DEG1 + ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX + ADD-LINK - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX + + + ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX + + + ROADM-A1-DEG1 + DEG1-CTP-TXRX + + + DEG2-CTP-TXRX + ROADM-A1-DEG2 + + ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX + + EXPRESS-LINK diff --git a/tapi/src/test/resources/get_portmapping.xml b/tapi/src/test/resources/get_portmapping.xml new file mode 100644 index 000000000..b5dea0ae4 --- /dev/null +++ b/tapi/src/test/resources/get_portmapping.xml @@ -0,0 +1,745 @@ + + + + XPDR-C1 + + XPDR1-CLIENT2 + xpdr-client + C1 + bidirectional + x:if-100GE + XPDR1-NETWORK2 + fHpE8JbDyn4= + 1/0/2-PLUG-CLIENT + + + + XPDR1-NETWORK2 + + xpdr-network + 1 + bidirectional + x:if-OCH + XPDR1-CLIENT2 + AJUlmCIYKpQh + 1/0/2-PLUG-NET + + + + XPDR1-CLIENT1 + xpdr-client + C1 + bidirectional + x:if-100GE + XPDR1-NETWORK1 + fHpE8JbDyn0= + 1/0/1-PLUG-CLIENT + + + + XPDR1-NETWORK1 + + xpdr-network + 1 + bidirectional + x:if-OCH + XPDR1-CLIENT1 + AJUlmCIYKpQi + 1/0/1-PLUG-NET + + + + NodeC + vendorA + model2 + 1.2.3.5 + xpdr + 2.2.1 + + + + SPDR-SC1 + + NodeSC + vendorC + universal-switchponder + 1.2.3.6 + xpdr + 2.2.1 + + + 1 + non-blocking + + 11 + XPDR1-NETWORK1 + XPDR1-CLIENT1 + 0 + 1000000000 + + + + 12 + XPDR1-NETWORK1 + XPDR1-CLIENT2 + 0 + 1000000000 + + + + 13 + XPDR1-NETWORK1 + XPDR1-CLIENT3 + 0 + 1000000000 + + + + 14 + XPDR1-CLIENT4 + XPDR1-NETWORK1 + 0 + 1000000000 + + + + + 2 + non-blocking + + 2 + XPDR2-NETWORK1 + XPDR2-CLIENT4 + XPDR2-CLIENT3 + XPDR2-CLIENT2 + XPDR2-CLIENT1 + XPDR2-NETWORK3 + XPDR2-NETWORK2 + XPDR2-NETWORK4 + 0 + 1000000000 + + + + + XPDR2-CLIENT3 + switch-client + CP2-QSFP3-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + BVSiXSSYUCI= + CP2-QSFP3 + + + + XPDR2-CLIENT4 + switch-client + CP2-QSFP4-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + BVSiXSSYUCU= + CP2-QSFP4 + + + + XPDR2-CLIENT1 + switch-client + CP2-QSFP1-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + BVSiXSSYUCA= + CP2-QSFP1 + + + + XPDR2-CLIENT2 + switch-client + CP2-QSFP2-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + BVSiXSSYUCM= + CP2-QSFP2 + + + + XPDR1-CLIENT3 + xpdr-client + CP1-SFP3-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + x:if-10GE + L0PHYLgz3+E= + CP1-SFP3 + + + + XPDR1-CLIENT2 + xpdr-client + CP1-SFP2-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + L0PHYLgz3+A= + CP1-SFP2 + + + + XPDR1-CLIENT4 + xpdr-client + CP1-SFP4-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + x:if-10GE + L0PHYLgz3+Y= + CP1-SFP4 + + + + XPDR1-CLIENT1 + xpdr-client + CP1-SFP1-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + L0PHYLgz3+M= + CP1-SFP1 + + + + XPDR2-NETWORK3 + + switch-network + CP8-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + ALx70DYYfGTz + switch + CP8-CFP + + + + XPDR2-NETWORK2 + + switch-network + CP7-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + ALx70DYYfGTy + switch + CP7-CFP + + + + XPDR2-NETWORK4 + + switch-network + CP5-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + ALx70DYYfGT0 + switch + CP5-CFP + + + + XPDR2-NETWORK1 + + switch-network + CP6-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + ALx70DYYfGTx + switch + CP6-CFP + + + + XPDR1-NETWORK1 + + xpdr-network + CP1-CFP0-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + fuYZwEO660g= + mpdr + CP1-CFP0 + + + + + SPDR-SA1 + + NodeSA + vendorA + universal-switchponder + 1.2.3.4 + xpdr + 2.2.1 + + + 1 + non-blocking + + 11 + XPDR1-NETWORK1 + XPDR1-CLIENT1 + 0 + 1000000000 + + + + 12 + XPDR1-NETWORK1 + XPDR1-CLIENT2 + 0 + 1000000000 + + + + 13 + XPDR1-NETWORK1 + XPDR1-CLIENT3 + 0 + 1000000000 + + + + 14 + XPDR1-CLIENT4 + XPDR1-NETWORK1 + 0 + 1000000000 + + + + + 2 + non-blocking + + 2 + XPDR2-NETWORK1 + XPDR2-CLIENT4 + XPDR2-CLIENT3 + XPDR2-CLIENT2 + XPDR2-CLIENT1 + XPDR2-NETWORK3 + XPDR2-NETWORK2 + XPDR2-NETWORK4 + 0 + 1000000000 + + + + + XPDR2-CLIENT3 + switch-client + CP2-QSFP3-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + AN/WSSRXne3s + CP2-QSFP3 + + + + XPDR2-CLIENT4 + switch-client + CP2-QSFP4-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + AN/WSSRXne3r + CP2-QSFP4 + + + + XPDR2-CLIENT1 + switch-client + CP2-QSFP1-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + AN/WSSRXne3u + CP2-QSFP1 + + + + XPDR2-CLIENT2 + switch-client + CP2-QSFP2-P1 + bidirectional + x:if-100GE-ODU4 + x:if-100GE + AN/WSSRXne3t + CP2-QSFP2 + + + + XPDR1-CLIENT3 + xpdr-client + CP1-SFP3-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + x:if-10GE + FqlcrxV7p38= + CP1-SFP3 + + + + XPDR1-CLIENT2 + xpdr-client + CP1-SFP2-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + FqlcrxV7p34= + CP1-SFP2 + + + + XPDR1-CLIENT4 + xpdr-client + CP1-SFP4-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + x:if-10GE + FqlcrxV7p3g= + CP1-SFP4 + + + + XPDR1-CLIENT1 + xpdr-client + CP1-SFP1-P1 + bidirectional + x:if-10GE-ODU2 + x:if-10GE-ODU2e + FqlcrxV7p30= + CP1-SFP1 + + + + XPDR2-NETWORK3 + + switch-network + CP8-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + exT821pFtOU= + switch + CP8-CFP + + + + XPDR2-NETWORK2 + + switch-network + CP7-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + exT821pFtOQ= + switch + CP7-CFP + + + + XPDR2-NETWORK4 + + switch-network + CP5-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + exT821pFtOI= + switch + CP5-CFP + + + + XPDR2-NETWORK1 + + switch-network + CP6-CFP-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + exT821pFtOc= + switch + CP6-CFP + + + + XPDR1-NETWORK1 + + xpdr-network + CP1-CFP0-P1 + bidirectional + x:if-OCH-OTU4-ODU4 + Swfw02qXGyI= + mpdr + CP1-CFP0 + + + + + XPDR-A1 + + XPDR1-CLIENT2 + xpdr-client + C1 + bidirectional + x:if-100GE + XPDR1-NETWORK2 + AJUUr6I5fALg + 1/0/2-PLUG-CLIENT + + + + XPDR1-NETWORK2 + + xpdr-network + 1 + bidirectional + x:if-OCH + XPDR1-CLIENT2 + AMkDwQ7xTmRL + 1/0/2-PLUG-NET + + + + XPDR1-CLIENT1 + xpdr-client + C1 + bidirectional + x:if-100GE + XPDR1-NETWORK1 + AJUUr6I5fALj + 1/0/1-PLUG-CLIENT + + + + XPDR1-NETWORK1 + + xpdr-network + 1 + bidirectional + x:if-OCH + XPDR1-CLIENT1 + AMkDwQ7xTmRI + 1/0/1-PLUG-NET + + + + NodeA + vendorA + model2 + 1.2.3.4 + xpdr + 2.2.1 + + + + ROADM-C1 + + NodeC + vendorA + model2 + 127.0.0.13 + rdm + 2.2.1 + + + 1/0/ETH-PLUG + 1 + 1GE-interface-1 + + + 2/0 + 2 + 1GE-interface-2 + + + 2/0/ETH-PLUG + 2 + 1GE-interface-2 + + + 1/0 + 1 + 1GE-interface-1 + + + DEG2-TTP-TXRX + 2/0 + L1 + bidirectional + + + SRG1-PP3-TXRX + 3/0 + C3 + bidirectional + + + DEG1-TTP-TXRX + OTS-DEG1-TTP-TXRX + OMS-DEG1-TTP-TXRX + 1/0 + L1 + bidirectional + + + SRG1-PP1-TXRX + 3/0 + C1 + bidirectional + + + SRG1-PP2-TXRX + 3/0 + C2 + bidirectional + + + SRG1-PP4-TXRX + 3/0 + C4 + bidirectional + + + SRG1-PP + 50 + 50 + + + DEG2-TTP + 50 + 50 + + + DEG1-TTP + 50 + 50 + + + + ROADM-A1 + + NodeA + vendorA + model2 + 127.0.0.11 + rdm + 2.2.1 + + + 1/0/ETH-PLUG + 1 + 1GE-interface-1 + + + 2/0 + 2 + 1GE-interface-2 + + + 2/0/ETH-PLUG + 2 + 1GE-interface-2 + + + 1/0 + 1 + 1GE-interface-1 + + + SRG3-PP3-TXRX + 5/0 + C3 + bidirectional + + + DEG2-TTP-TXRX + OTS-DEG2-TTP-TXRX + OMS-DEG2-TTP-TXRX + 2/0 + L1 + bidirectional + + + SRG1-PP3-TXRX + 3/0 + C3 + bidirectional + + + DEG1-TTP-TXRX + 1/0 + L1 + bidirectional + + + SRG1-PP1-TXRX + 3/0 + C1 + bidirectional + + + SRG3-PP2-TXRX + 5/0 + C2 + bidirectional + + + SRG1-PP2-TXRX + 3/0 + C2 + bidirectional + + + SRG3-PP1-TXRX + 5/0 + C1 + bidirectional + + + SRG1-PP4-TXRX + 3/0 + C4 + bidirectional + + + SRG3-PP4-TXRX + 5/0 + C4 + bidirectional + + + SRG1-PP + 50 + 50 + + + DEG2-TTP + 50 + 50 + + + DEG1-TTP + 50 + 50 + + + SRG3-PP + 50 + 50 + + + + \ No newline at end of file diff --git a/tapi/src/test/resources/openroadm-topology.xml b/tapi/src/test/resources/openroadm-topology.xml deleted file mode 100644 index ce0ea0347..000000000 --- a/tapi/src/test/resources/openroadm-topology.xml +++ /dev/null @@ -1,3216 +0,0 @@ - - - - openroadm-topology - - ROADM-A1-SRG3 - - SRG3-CP-TXRX - SRG-TXRX-CP - - - SRG3-PP2-TXRX - SRG-TXRX-PP - - - SRG3-PP4-TXRX - SRG-TXRX-PP - - - SRG3-PP1-TXRX - SRG-TXRX-PP - - - SRG3-PP3-TXRX - SRG-TXRX-PP - - - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - SRG - - openroadm-network - ROADM-A1 - - - - ROADM-C1-DEG2 - - DEG2-CTP-TXRX - DEGREE-TXRX-CTP - - - DEG2-TTP-TXRX - DEGREE-TXRX-TTP - - - 2 - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - DEGREE - - openroadm-network - ROADM-C1 - - - - ROADM-B1-DEG1 - - DEG1-TTP-TXRX - DEGREE-TXRX-TTP - - - DEG1-CTP-TXRX - DEGREE-TXRX-CTP - - - 1 - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - DEGREE - - openroadm-network - ROADM-B1 - - - - ROADM-B1-DEG2 - - DEG2-CTP-TXRX - DEGREE-TXRX-CTP - - - DEG2-TTP-TXRX - DEGREE-TXRX-TTP - - - 2 - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - DEGREE - - openroadm-network - ROADM-B1 - - - - ROADM-C1-SRG1 - - SRG1-PP4-TXRX - SRG-TXRX-PP - - - SRG1-CP-TXRX - SRG-TXRX-CP - - - SRG1-PP2-TXRX - SRG-TXRX-PP - - - SRG1-PP1-TXRX - SRG-TXRX-PP - - - SRG1-PP3-TXRX - SRG-TXRX-PP - - - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - SRG - - openroadm-network - ROADM-C1 - - - - ROADM-A1-SRG1 - - SRG1-PP4-TXRX - SRG-TXRX-PP - - - SRG1-CP-TXRX - SRG-TXRX-CP - - - SRG1-PP2-TXRX - SRG-TXRX-PP - - - SRG1-PP1-TXRX - SRG-TXRX-PP - - - SRG1-PP3-TXRX - SRG-TXRX-PP - - - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - SRG - - openroadm-network - ROADM-A1 - - - - ROADM-A1-DEG2 - - DEG2-CTP-TXRX - DEGREE-TXRX-CTP - - - DEG2-TTP-TXRX - DEGREE-TXRX-TTP - - - 2 - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - DEGREE - - openroadm-network - ROADM-A1 - - - - XPDR-A1-XPDR1 - - XPDR1-CLIENT2 - XPDR1-NETWORK2 - - XPDR1-NETWORK2 - - XPONDER-CLIENT - - - XPDR1-NETWORK2 - XPDR1-CLIENT2 - XPONDER-NETWORK - - XPDR1-CLIENT2 - - - - XPDR1-CLIENT1 - XPDR1-NETWORK1 - - XPDR1-NETWORK1 - - XPONDER-CLIENT - - - XPDR1-NETWORK1 - XPDR1-CLIENT1 - XPONDER-NETWORK - - XPDR1-CLIENT1 - - - XPONDER - - openroadm-network - XPDR-A1 - - - - ROADM-A1-DEG1 - - DEG1-TTP-TXRX - DEGREE-TXRX-TTP - - - DEG1-CTP-TXRX - DEGREE-TXRX-CTP - - - 1 - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - DEGREE - - openroadm-network - ROADM-A1 - - - - XPDR-C1-XPDR1 - - XPDR1-CLIENT2 - XPDR1-NETWORK2 - - XPDR1-NETWORK2 - - XPONDER-CLIENT - - - XPDR1-NETWORK2 - XPDR1-CLIENT2 - XPONDER-NETWORK - - XPDR1-CLIENT2 - - - - XPDR1-CLIENT1 - XPDR1-NETWORK1 - - XPDR1-NETWORK1 - - XPONDER-CLIENT - - - XPDR1-NETWORK1 - XPDR1-CLIENT1 - XPONDER-NETWORK - - XPDR1-CLIENT1 - - - XPONDER - - openroadm-network - XPDR-C1 - - - - ROADM-C1-DEG1 - - DEG1-TTP-TXRX - DEGREE-TXRX-TTP - - - DEG1-CTP-TXRX - DEGREE-TXRX-CTP - - - 1 - - 94 - - - 93 - - - 96 - - - 95 - - - 42 - - - 41 - - - 44 - - - 43 - - - 38 - - - 37 - - - 40 - - - 39 - - - 34 - - - 33 - - - 36 - - - 35 - - - 30 - - - 29 - - - 32 - - - 31 - - - 58 - - - 57 - - - 60 - - - 59 - - - 54 - - - 53 - - - 56 - - - 55 - - - 50 - - - 49 - - - 52 - - - 51 - - - 46 - - - 45 - - - 48 - - - 47 - - - 74 - - - 73 - - - 76 - - - 75 - - - 70 - - - 69 - - - 72 - - - 71 - - - 66 - - - 65 - - - 68 - - - 67 - - - 62 - - - 61 - - - 64 - - - 63 - - - 90 - - - 89 - - - 92 - - - 91 - - - 86 - - - 85 - - - 88 - - - 87 - - - 82 - - - 81 - - - 84 - - - 83 - - - 78 - - - 77 - - - 80 - - - 79 - - - 10 - - - 9 - - - 12 - - - 11 - - - 6 - - - 5 - - - 8 - - - 7 - - - 2 - - - 1 - - - 4 - - - 3 - - - 26 - - - 25 - - - 28 - - - 27 - - - 22 - - - 21 - - - 24 - - - 23 - - - 18 - - - 17 - - - 20 - - - 19 - - - 14 - - - 13 - - - 16 - - - 15 - - - DEGREE - - openroadm-network - ROADM-C1 - - - - - - - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX - - ROADM-A1-DEG1 - DEG1-CTP-TXRX - - DROP-LINK - - ROADM-A1-SRG3 - SRG3-CP-TXRX - - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - - ROADM-A1-SRG3 - SRG3-CP-TXRX - - ADD-LINK - - ROADM-A1-DEG2 - DEG2-CTP-TXRX - - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX - - - ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX - - ROADM-C1-DEG1 - DEG1-TTP-TXRX - - - ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX - - ROADM-TO-ROADM - - ROADM-A1-DEG2 - DEG2-TTP-TXRX - - ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX - - - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX - - ROADM-C1-DEG2 - DEG2-CTP-TXRX - - DROP-LINK - - ROADM-C1-SRG1 - SRG1-CP-TXRX - - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX - - - ROADM-A1-DEG1-DEG1-TTP-TXRXtoROADM-B1-DEG1-DEG1-TTP-TXRX - - ROADM-A1-DEG1 - DEG1-TTP-TXRX - - - ROADM-B1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG1-DEG1-TTP-TXRX - - ROADM-TO-ROADM - - ROADM-B1-DEG1 - DEG1-TTP-TXRX - - ROADM-B1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG1-DEG1-TTP-TXRX - - - ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX - - ROADM-A1-DEG2 - DEG2-TTP-TXRX - - - ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX - - ROADM-TO-ROADM - - ROADM-C1-DEG1 - DEG1-TTP-TXRX - - ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX - - - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX - - ROADM-C1-DEG2 - DEG2-CTP-TXRX - - EXPRESS-LINK - - ROADM-C1-DEG1 - DEG1-CTP-TXRX - - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX - - - ROADM-C1-DEG2-DEG2-TTP-TXRXtoROADM-B1-DEG2-DEG2-TTP-TXRX - - ROADM-C1-DEG2 - DEG2-TTP-TXRX - - - ROADM-B1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG2-DEG2-TTP-TXRX - - ROADM-TO-ROADM - - ROADM-B1-DEG2 - DEG2-TTP-TXRX - - ROADM-B1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG2-DEG2-TTP-TXRX - - - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX - - ROADM-C1-DEG1 - DEG1-CTP-TXRX - - EXPRESS-LINK - - ROADM-C1-DEG2 - DEG2-CTP-TXRX - - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX - - - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX - - ROADM-A1-DEG2 - DEG2-CTP-TXRX - - DROP-LINK - - ROADM-A1-SRG1 - SRG1-CP-TXRX - - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - - - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX - - ROADM-A1-DEG2 - DEG2-CTP-TXRX - - DROP-LINK - - ROADM-A1-SRG3 - SRG3-CP-TXRX - - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - - - ROADM-B1-DEG2-DEG2-CTP-TXRXtoROADM-B1-DEG1-DEG1-CTP-TXRX - - ROADM-B1-DEG2 - DEG2-CTP-TXRX - - EXPRESS-LINK - - ROADM-B1-DEG1 - DEG1-CTP-TXRX - - ROADM-B1-DEG1-DEG1-CTP-TXRXtoROADM-B1-DEG2-DEG2-CTP-TXRX - - - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX - - ROADM-C1-DEG1 - DEG1-CTP-TXRX - - DROP-LINK - - ROADM-C1-SRG1 - SRG1-CP-TXRX - - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX - - - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - ROADM-A1-DEG2 - DEG2-CTP-TXRX - - EXPRESS-LINK - - ROADM-A1-DEG1 - DEG1-CTP-TXRX - - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - - - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - ROADM-A1-SRG1 - SRG1-CP-TXRX - - ADD-LINK - - ROADM-A1-DEG1 - DEG1-CTP-TXRX - - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX - - - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG2-DEG2-CTP-TXRX - - ROADM-C1-SRG1 - SRG1-CP-TXRX - - ADD-LINK - - ROADM-C1-DEG2 - DEG2-CTP-TXRX - - ROADM-C1-DEG2-DEG2-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX - - - ROADM-B1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG1-DEG1-TTP-TXRX - - ROADM-B1-DEG1 - DEG1-TTP-TXRX - - - ROADM-A1-DEG1-DEG1-TTP-TXRXtoROADM-B1-DEG1-DEG1-TTP-TXRX - - ROADM-TO-ROADM - - ROADM-A1-DEG1 - DEG1-TTP-TXRX - - ROADM-A1-DEG1-DEG1-TTP-TXRXtoROADM-B1-DEG1-DEG1-TTP-TXRX - - - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - - ROADM-A1-SRG1 - SRG1-CP-TXRX - - ADD-LINK - - ROADM-A1-DEG2 - DEG2-CTP-TXRX - - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX - - - ROADM-B1-DEG1-DEG1-CTP-TXRXtoROADM-B1-DEG2-DEG2-CTP-TXRX - - ROADM-B1-DEG1 - DEG1-CTP-TXRX - - EXPRESS-LINK - - ROADM-B1-DEG2 - DEG2-CTP-TXRX - - ROADM-B1-DEG2-DEG2-CTP-TXRXtoROADM-B1-DEG1-DEG1-CTP-TXRX - - - ROADM-B1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG2-DEG2-TTP-TXRX - - ROADM-B1-DEG2 - DEG2-TTP-TXRX - - - ROADM-C1-DEG2-DEG2-TTP-TXRXtoROADM-B1-DEG2-DEG2-TTP-TXRX - - ROADM-TO-ROADM - - ROADM-C1-DEG2 - DEG2-TTP-TXRX - - ROADM-C1-DEG2-DEG2-TTP-TXRXtoROADM-B1-DEG2-DEG2-TTP-TXRX - - - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-DEG2-DEG2-CTP-TXRX - - ROADM-A1-DEG1 - DEG1-CTP-TXRX - - EXPRESS-LINK - - ROADM-A1-DEG2 - DEG2-CTP-TXRX - - ROADM-A1-DEG2-DEG2-CTP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - - ROADM-A1-SRG3-SRG3-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - ROADM-A1-SRG3 - SRG3-CP-TXRX - - ADD-LINK - - ROADM-A1-DEG1 - DEG1-CTP-TXRX - - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG3-SRG3-CP-TXRX - - - ROADM-C1-SRG1-SRG1-CP-TXRXtoROADM-C1-DEG1-DEG1-CTP-TXRX - - ROADM-C1-SRG1 - SRG1-CP-TXRX - - ADD-LINK - - ROADM-C1-DEG1 - DEG1-CTP-TXRX - - ROADM-C1-DEG1-DEG1-CTP-TXRXtoROADM-C1-SRG1-SRG1-CP-TXRX - - - ROADM-A1-DEG1-DEG1-CTP-TXRXtoROADM-A1-SRG1-SRG1-CP-TXRX - - ROADM-A1-DEG1 - DEG1-CTP-TXRX - - DROP-LINK - - ROADM-A1-SRG1 - SRG1-CP-TXRX - - ROADM-A1-SRG1-SRG1-CP-TXRXtoROADM-A1-DEG1-DEG1-CTP-TXRX - - - - \ No newline at end of file diff --git a/tapi/src/test/resources/otn-topology-with-otn-links.xml b/tapi/src/test/resources/otn-topology-with-otn-links.xml index 237abf401..9005a8705 100644 --- a/tapi/src/test/resources/otn-topology-with-otn-links.xml +++ b/tapi/src/test/resources/otn-topology-with-otn-links.xml @@ -892,74 +892,74 @@ - OTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 + OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 - SPDR-SC1-XPDR1 + SPDR-SA1-XPDR1 XPDR1-NETWORK1 OTU4 XPDR1-NETWORK1 - SPDR-SA1-XPDR1 + SPDR-SC1-XPDR1 0 100000 - OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 + OTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 OTN-LINK - OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 + OTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 - SPDR-SA1-XPDR1 + SPDR-SC1-XPDR1 XPDR1-NETWORK1 OTU4 XPDR1-NETWORK1 - SPDR-SC1-XPDR1 + SPDR-SA1-XPDR1 0 100000 - OTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 + OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 OTN-LINK - ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 + ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 - SPDR-SC1-XPDR1 + SPDR-SA1-XPDR1 XPDR1-NETWORK1 ODTU4 XPDR1-NETWORK1 - SPDR-SA1-XPDR1 + SPDR-SC1-XPDR1 100000 0 - ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 + ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 OTN-LINK - ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 + ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 - SPDR-SA1-XPDR1 + SPDR-SC1-XPDR1 XPDR1-NETWORK1 ODTU4 XPDR1-NETWORK1 - SPDR-SC1-XPDR1 + SPDR-SA1-XPDR1 100000 0 - ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1 + ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1 OTN-LINK diff --git a/tapi/src/test/resources/otn-topology.xml b/tapi/src/test/resources/otn-topology.xml deleted file mode 100644 index 2db86fd75..000000000 --- a/tapi/src/test/resources/otn-topology.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - otn-topology - - - - - SPDR-SA1-XPDR2 - - XPDR2-NETWORK2 - - openroadm-topology - SPDR-SA1-XPDR2 - XPDR2-NETWORK2 - - - - x:if-OCH-OTU4-ODU4 - - - - x:ODU4 - - XPONDER-NETWORK - - - XPDR2-NETWORK1 - - openroadm-topology - SPDR-SA1-XPDR2 - XPDR2-NETWORK1 - - - - x:if-OCH-OTU4-ODU4 - - - - x:ODU4 - - XPONDER-NETWORK - - - XPDR2-NETWORK4 - - openroadm-topology - SPDR-SA1-XPDR2 - XPDR2-NETWORK4 - - - - x:if-OCH-OTU4-ODU4 - - - - x:ODU4 - - XPONDER-NETWORK - - - XPDR2-NETWORK3 - - openroadm-topology - SPDR-SA1-XPDR2 - XPDR2-NETWORK3 - - - - x:if-OCH-OTU4-ODU4 - - - - x:ODU4 - - XPONDER-NETWORK - - - XPDR2-CLIENT4 - - - x:if-100GE-ODU4 - - - - x:ODU4 - - XPONDER-CLIENT - - - XPDR2-CLIENT2 - - - x:if-100GE-ODU4 - - - - x:ODU4 - - XPONDER-CLIENT - - - XPDR2-CLIENT3 - - - x:if-100GE-ODU4 - - - - x:ODU4 - - XPONDER-CLIENT - - - XPDR2-CLIENT1 - - - x:if-100GE-ODU4 - - - - x:ODU4 - - XPONDER-CLIENT - - SWITCH - - - 2 - - - - 1 - non-blocking - - 1 - XPDR2-NETWORK4 - XPDR2-CLIENT1 - XPDR2-NETWORK3 - XPDR2-CLIENT4 - XPDR2-CLIENT2 - XPDR2-NETWORK2 - XPDR2-CLIENT3 - XPDR2-NETWORK1 - - - - - clli-network - NodeSA - - - openroadm-topology - SPDR-SA1-XPDR2 - - - openroadm-network - SPDR-SA1 - - - - SPDR-SA1-XPDR1 - - XPDR1-CLIENT2 - - - x:if-10GE-ODU2e - - - - x:ODU2e - - XPONDER-CLIENT - - - XPDR1-CLIENT1 - - - x:if-10GE-ODU2e - - - - x:ODU2e - - XPONDER-CLIENT - - - XPDR1-CLIENT4 - - - x:if-10GE-ODU2e - - - - x:ODU2e - - XPONDER-CLIENT - - - XPDR1-NETWORK1 - - openroadm-topology - SPDR-SA1-XPDR1 - XPDR1-NETWORK1 - - - - x:if-OCH-OTU4-ODU4 - - - - x:ODU4 - - XPONDER-NETWORK - - - XPDR1-CLIENT3 - - - x:if-10GE-ODU2e - - - - x:ODU2e - - XPONDER-CLIENT - - MUXPDR - - - 1 - - - - 1 - non-blocking - - 3 - 10 - 1000000000 - XPDR1-NETWORK1 - XPDR1-CLIENT3 - - - 4 - 10 - 1000000000 - XPDR1-CLIENT4 - XPDR1-NETWORK1 - - - 1 - 10 - 1000000000 - XPDR1-NETWORK1 - XPDR1-CLIENT1 - - - 2 - 10 - 1000000000 - XPDR1-NETWORK1 - XPDR1-CLIENT2 - - - - - clli-network - NodeSA - - - openroadm-topology - SPDR-SA1-XPDR1 - - - openroadm-network - SPDR-SA1 - - - - - \ No newline at end of file diff --git a/tapi/src/test/resources/portmapping-example.xml b/tapi/src/test/resources/portmapping-example.xml deleted file mode 100644 index f4f601176..000000000 --- a/tapi/src/test/resources/portmapping-example.xml +++ /dev/null @@ -1,260 +0,0 @@ - - - - XPDR-A1 - - 2.2.1 - model2 - NodeA - xpdr - vendorA - 1.2.3.4 - - - XPDR1-NETWORK2 - xpdr-network - XPDR1-CLIENT2 - 1/0/2-PLUG-NET - 1 - x:if-OCH - bidirectional - - - XPDR1-NETWORK1 - xpdr-network - XPDR1-CLIENT1 - 1/0/1-PLUG-NET - 1 - x:if-OCH - bidirectional - - - XPDR1-CLIENT1 - xpdr-client - XPDR1-NETWORK1 - 1/0/1-PLUG-CLIENT - C1 - x:if-100GE - bidirectional - - - XPDR1-CLIENT2 - xpdr-client - XPDR1-NETWORK2 - 1/0/2-PLUG-CLIENT - C1 - x:if-100GE - bidirectional - - - - ROADM-A1 - - 2.2.1 - model2 - NodeA - rdm - vendorA - 127.0.0.11 - - - 2/0 - 2 - 1GE-interface-2 - - - 1/0/ETH-PLUG - 1 - 1GE-interface-1 - - - 1/0 - 1 - 1GE-interface-1 - - - 2/0/ETH-PLUG - 2 - 1GE-interface-2 - - - SRG3-PP1-TXRX - 5/0 - C1 - bidirectional - - - SRG1-PP2-TXRX - 3/0 - C2 - bidirectional - - - SRG3-PP4-TXRX - 5/0 - C4 - bidirectional - - - SRG1-PP4-TXRX - 3/0 - C4 - bidirectional - - - SRG3-PP3-TXRX - 5/0 - C3 - bidirectional - - - DEG2-TTP-TXRX - OTS-DEG2-TTP-TXRX - 2/0 - OMS-DEG2-TTP-TXRX - L1 - bidirectional - - - SRG1-PP3-TXRX - 3/0 - C3 - bidirectional - - - SRG3-PP2-TXRX - 5/0 - C2 - bidirectional - - - DEG1-TTP-TXRX - 1/0 - L1 - bidirectional - - - SRG1-PP1-TXRX - 3/0 - C1 - bidirectional - - - - XPDR-C1 - - 2.2.1 - model2 - NodeC - xpdr - vendorA - 1.2.3.4 - - - XPDR1-NETWORK2 - xpdr-network - XPDR1-CLIENT2 - 1/0/2-PLUG-NET - 1 - x:if-OCH - bidirectional - - - XPDR1-NETWORK1 - xpdr-network - XPDR1-CLIENT1 - 1/0/1-PLUG-NET - 1 - x:if-OCH - bidirectional - - - XPDR1-CLIENT1 - xpdr-client - XPDR1-NETWORK1 - 1/0/1-PLUG-CLIENT - C1 - x:if-100GE - bidirectional - - - XPDR1-CLIENT2 - xpdr-client - XPDR1-NETWORK2 - 1/0/2-PLUG-CLIENT - C1 - x:if-100GE - bidirectional - - - - ROADM-C1 - - 2.2.1 - model2 - NodeC - rdm - vendorA - 127.0.0.11 - - - 2/0 - 2 - 1GE-interface-2 - - - 1/0/ETH-PLUG - 1 - 1GE-interface-1 - - - 1/0 - 1 - 1GE-interface-1 - - - 2/0/ETH-PLUG - 2 - 1GE-interface-2 - - - SRG1-PP2-TXRX - 3/0 - C2 - bidirectional - - - SRG1-PP4-TXRX - 3/0 - C4 - bidirectional - - - DEG2-TTP-TXRX - 2/0 - L1 - bidirectional - - - SRG1-PP3-TXRX - 3/0 - C3 - bidirectional - - - DEG1-TTP-TXRX - OTS-DEG1-TTP-TXRX - 1/0 - OMS-DEG1-TTP-TXRX - L1 - bidirectional - - - SRG1-PP1-TXRX - 3/0 - C1 - bidirectional - - - - \ No newline at end of file diff --git a/tox.ini b/tox.ini index 5b567560c..d6acf6de9 100644 --- a/tox.ini +++ b/tox.ini @@ -54,7 +54,7 @@ commands = {py3,otnrenderer}: nosetests --with-xunit transportpce_tests/2.2.1/test_otn_renderer.py {py3,otnshrenderer}: nosetests --with-xunit transportpce_tests/2.2.1/test_otn_sh_renderer.py {py3,olm221}: nosetests --with-xunit transportpce_tests/2.2.1/test_olm.py - {py3,tapi221}: nosetests --with-xunit transportpce_tests/2.2.1/test_tapi.py + #{py3,tapi221}: nosetests --with-xunit transportpce_tests/2.2.1/test_tapi.py {py3,otnend2end}: nosetests --with-xunit transportpce_tests/2.2.1/test_otn_end2end.py {py3,end2end}: nosetests --with-xunit transportpce_tests/1.2.1/test_end2end.py {py3,end2end221}: nosetests --with-xunit transportpce_tests/2.2.1/test_end2end.py -- 2.36.6