Manage OTN links at 400G 15/96915/12
authorGilles Thouenon <gilles.thouenon@orange.com>
Mon, 12 Jul 2021 11:34:41 +0000 (13:34 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 30 Jul 2021 16:11:11 +0000 (18:11 +0200)
- put otn-link-type as prefix for link name
- propagate and use otn-link-type to differentiate treatments between
100G and 400G supported links
- use min and max trib slot and trib port comming from path-description
to update ODU4/ODUC4 links
- adapt existing UT

jira: TRNSPRTPCE-492
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: I4bef0c7edbe02f5b8cbee3f1db7bc32cd0746f59

12 files changed:
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/service/NetworkModelService.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/service/NetworkModelServiceImpl.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmOtnTopology.java
networkmodel/src/test/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmOtnTopologyTest.java
networkmodel/src/test/java/org/opendaylight/transportpce/networkmodel/util/test/NetworkmodelTestUtil.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/RendererListenerImpl.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java
tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopoTest.java
tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/TapiTopologyImplTest.java
tapi/src/test/resources/otn-topology.xml
tests/transportpce_tests/2.2.1/test_otn_end2end.py

index c3606ed2b284df24eb155e31360d655d783e9790..4845ba30789cf3c1f25323e9dd34d514f87df960 100644 (file)
@@ -97,14 +97,16 @@ public interface NetworkModelService {
      * @param link
      *     link containing termination points to be updated
      * @param serviceRate
-     *     Service rate may be 1G, 10G or 100G
+     *     Service rate may be 1G, 10G, 100G or 400G
      * @param tribPortNb
      *     Trib port number allocated by the service
-     * @param tribSoltNb
-     *     First trib slot number allocated by the service
+     * @param minTribSoltNb
+     *     First contiguous trib slot number allocated by the service
+     * @param maxTribSoltNb
+     *     Last contiguous trib slot number allocated by the service
      * @param isDeletion
      *       True indicates if the low-order otn service must be deleted
      */
-    void updateOtnLinks(Link link, Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion);
-
+    void updateOtnLinks(Link link, Uint32 serviceRate, Short tribPortNb, Short minTribSoltNb, Short maxTribSoltNb,
+            boolean isDeletion);
 }
index fb8059c2ff3ed08225ebe2dd24f4d80fe4bd415a..867f341e6a0d6aec15f0db94dd71708e0044e10d 100644 (file)
@@ -390,18 +390,25 @@ public class NetworkModelServiceImpl implements NetworkModelService {
         TopologyShard otnTopologyShard;
         switch (linkType) {
             case OTU4:
+            case OTUC4:
                 otnTopologyShard = OpenRoadmOtnTopology.createOtnLinks(nodeA, tpA, nodeZ, tpZ, linkType);
                 break;
             case ODTU4:
+            case ODUC4:
                 String nodeTopoA = new StringBuilder(nodeA).append("-").append(tpA.split("-")[0]).toString();
                 String nodeTopoZ = new StringBuilder(nodeZ).append("-").append(tpZ.split("-")[0]).toString();
                 List<LinkId> linkIdList = new ArrayList<>();
-                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "OTU4"));
-                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "OTU4"));
+                String prefix;
+                if (OtnLinkType.ODTU4.equals(linkType)) {
+                    prefix = OtnLinkType.OTU4.getName();
+                } else {
+                    prefix = OtnLinkType.OTUC4.getName();
+                }
+                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix));
+                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix));
                 List<Link> supportedOtu4links = getOtnLinks(linkIdList);
                 List<TerminationPoint> tps = getOtnNodeTps(nodeTopoA, tpA, nodeTopoZ, tpZ);
-
-                otnTopologyShard = OpenRoadmOtnTopology.createOtnLinks(supportedOtu4links, tps);
+                otnTopologyShard = OpenRoadmOtnTopology.createOtnLinks(supportedOtu4links, tps, linkType);
                 break;
             default:
                 LOG.error("unknown otn link type {}", linkType);
@@ -446,32 +453,48 @@ public class NetworkModelServiceImpl implements NetworkModelService {
         TopologyShard otnTopologyShard;
         String nodeTopoA = new StringBuilder(nodeA).append("-").append(tpA.split("-")[0]).toString();
         String nodeTopoZ = new StringBuilder(nodeZ).append("-").append(tpZ.split("-")[0]).toString();
-        List<Link> otu4Links;
+        List<Link> otuLinks;
         List<LinkId> linkIdList = new ArrayList<>();
+        String prefix;
         switch (linkType) {
             case OTU4:
-                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "OTU4"));
-                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "OTU4"));
-                otu4Links = getOtnLinks(linkIdList);
-                if (checkLinks(otu4Links)) {
-                    deleteLinks(otu4Links);
+            case OTUC4:
+                if (OtnLinkType.OTU4.equals(linkType)) {
+                    prefix = OtnLinkType.OTU4.getName();
+                } else {
+                    prefix = OtnLinkType.OTUC4.getName();
+                }
+                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix));
+                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix));
+                otuLinks = getOtnLinks(linkIdList);
+                if (checkLinks(otuLinks)) {
+                    deleteLinks(otuLinks);
                 } else {
                     LOG.error("Error deleting OTU4 links");
                 }
                 otnTopologyShard = new TopologyShard(null, null);
                 break;
             case ODTU4:
-                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "ODU4"));
-                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "ODU4"));
-                List<Link> odu4Links = getOtnLinks(linkIdList);
+            case ODUC4:
+                String prefix2;
+                if (OtnLinkType.ODTU4.equals(linkType)) {
+                    prefix = OtnLinkType.ODTU4.getName();
+                    prefix2 = OtnLinkType.OTU4.getName();
+                } else {
+                    prefix = OtnLinkType.ODUC4.getName();
+                    prefix2 = OtnLinkType.OTUC4.getName();
+                }
+                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix));
+                linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix));
+                List<Link> oduLinks = getOtnLinks(linkIdList);
                 List<TerminationPoint> tps = getOtnNodeTps(nodeTopoA, tpA, nodeTopoZ, tpZ);
-                if (checkLinks(odu4Links) && checkTerminationPoints(tps)) {
-                    deleteLinks(odu4Links);
+                if (checkLinks(oduLinks) && checkTerminationPoints(tps)) {
+                    deleteLinks(oduLinks);
                     linkIdList.clear();
-                    linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "OTU4"));
-                    linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "OTU4"));
-                    otu4Links = getOtnLinks(linkIdList);
-                    otnTopologyShard = OpenRoadmOtnTopology.deleteOtnLinks(otu4Links, tps);
+                    linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix2));
+                    linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix2));
+                    otuLinks = getOtnLinks(linkIdList);
+                    otnTopologyShard = OpenRoadmOtnTopology.deleteOtnLinks(otuLinks, tps, linkType);
                 } else {
                     LOG.error("Error deleting ODU4 links");
                     otnTopologyShard = new TopologyShard(null, null);
@@ -518,7 +541,8 @@ public class NetworkModelServiceImpl implements NetworkModelService {
     @Override
     public void updateOtnLinks(
         org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210618.renderer.rpc.result.sp.Link
-            notifLink, Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion) {
+            notifLink, Uint32 serviceRate, Short tribPortNb, Short minTribSoltNb, Short maxTribSlotNb,
+            boolean isDeletion) {
 
         LinkTp atermination = new LinkTpBuilder()
             .setNodeId(notifLink.getATermination().getNodeId())
@@ -536,7 +560,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
         List<TerminationPoint> tps = getOtnNodeTps(linkTerminations);
         TopologyShard otnTopologyShard;
         otnTopologyShard = OpenRoadmOtnTopology.updateOtnLinks(supportedOdu4Links, tps, serviceRate, tribPortNb,
-            tribSoltNb, isDeletion);
+            minTribSoltNb, maxTribSlotNb, isDeletion);
         if (otnTopologyShard.getLinks() != null) {
             for (Link otnTopologyLink : otnTopologyShard.getLinks()) {
                 LOG.info("creating and updating otn links {} in {}", otnTopologyLink.getLinkId().getValue(),
@@ -737,7 +761,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
             odu4links = netw1Opt
                 .get()
                 .nonnullLink().values()
-                .stream().filter(lk -> lk.getLinkId().getValue().startsWith("ODU4"))
+                .stream().filter(lk -> lk.getLinkId().getValue().startsWith("ODTU4"))
                 .collect(Collectors.toList());
         }
         List<Link> links = new ArrayList<>();
index 0700331a9bbd054671aac0ac1f69bbc5f3f37495..649852dba6af94fadf8c7596bf9601a2827b923e 100644 (file)
@@ -36,10 +36,12 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.x
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.xpdr.tp.supported.interfaces.SupportedInterfaceCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.xpdr.tp.supported.interfaces.SupportedInterfaceCapabilityKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODTU4TsAllocated;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODTUCnTs;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU0;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU2;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU2e;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OdtuTypeIdentity;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OduRateIdentity;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder;
@@ -122,32 +124,36 @@ public final class OpenRoadmOtnTopology {
     public static TopologyShard createOtnLinks(String nodeA, String tpA, String nodeZ, String tpZ,
         OtnLinkType linkType) {
         List<Link> links = null;
-        if (OtnLinkType.OTU4.equals(linkType)) {
-            links = initialiseOtnLinks(nodeA, tpA, nodeZ, tpZ, linkType, "OTU4");
+        if (OtnLinkType.OTU4.equals(linkType) || OtnLinkType.OTUC4.equals(linkType)) {
+            links = initialiseOtnLinks(nodeA, tpA, nodeZ, tpZ, linkType);
         }
         return new TopologyShard(null, links);
     }
 
-    public static TopologyShard createOtnLinks(List<Link> suppOtu4Links, List<TerminationPoint> oldTps) {
+    public static TopologyShard createOtnLinks(List<Link> suppOtuLinks, List<TerminationPoint> oldTps,
+            OtnLinkType linkType) {
         List<Link> links = new ArrayList<>();
-        for (Link link : suppOtu4Links) {
-            if (link.augmentation(Link1.class) != null
+        for (Link link : suppOtuLinks) {
+            if (OtnLinkType.ODTU4.equals(linkType) && link.augmentation(Link1.class) != null
                 && link.augmentation(Link1.class).getAvailableBandwidth().equals(Uint32.valueOf(100000))) {
                 links.add(updateOtnLinkBwParameters(link, 0L, 100000L));
+            } else if (OtnLinkType.ODUC4.equals(linkType) && link.augmentation(Link1.class) != null
+                && link.augmentation(Link1.class).getAvailableBandwidth().equals(Uint32.valueOf(400000))) {
+                links.add(updateOtnLinkBwParameters(link, 0L, 400000L));
             } else {
                 LOG.error("Error with otn parameters of supported link {}", link.getLinkId().getValue());
             }
         }
         if (links.size() == 2) {
-            links.addAll(initialiseOtnLinks(suppOtu4Links.get(0).getSource().getSourceNode().getValue(),
-                suppOtu4Links.get(0).getSource().getSourceTp().toString(),
-                suppOtu4Links.get(0).getDestination().getDestNode().getValue(),
-                suppOtu4Links.get(0).getDestination().getDestTp().toString(),
-                OtnLinkType.ODTU4, "ODU4"));
+            links.addAll(initialiseOtnLinks(suppOtuLinks.get(0).getSource().getSourceNode().getValue(),
+                suppOtuLinks.get(0).getSource().getSourceTp().toString(),
+                suppOtuLinks.get(0).getDestination().getDestNode().getValue(),
+                suppOtuLinks.get(0).getDestination().getDestTp().toString(),
+                linkType));
         }
         List<TerminationPoint> tps = new ArrayList<>();
         for (TerminationPoint tp : oldTps) {
-            tps.add(updateTp(tp, true));
+            tps.add(updateTp(tp, true, linkType));
         }
         if (links.size() == 4 && tps.size() == 2) {
             return new TopologyShard(null, links, tps);
@@ -156,14 +162,25 @@ public final class OpenRoadmOtnTopology {
         }
     }
 
-    public static TopologyShard updateOtnLinks(List<Link> suppOdu4Links, List<TerminationPoint> oldTps,
-        Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion) {
+    public static TopologyShard updateOtnLinks(List<Link> suppOduLinks, List<TerminationPoint> oldTps,
+        Uint32 serviceRate, Short tribPortNb, Short minTribSlotNb, Short maxTribSlotNb, boolean isDeletion) {
         List<Link> links = new ArrayList<>();
-        Long bwIncr = 10000L;
-        if (serviceRate.intValue() == 1) {
-            bwIncr = 1000L;
+        Long bwIncr;
+        switch (serviceRate.intValue()) {
+            case 1:
+                bwIncr = 1000L;
+                break;
+            case 10:
+                bwIncr = 10000L;
+                break;
+            case 100:
+                bwIncr = 100000L;
+                break;
+            default:
+                LOG.warn("Error with not managed service rate {}", serviceRate.toString());
+                return new TopologyShard(null, null, null);
         }
-        for (Link link : suppOdu4Links) {
+        for (Link link : suppOduLinks) {
             if (link.augmentation(Link1.class) != null && link.augmentation(Link1.class).getAvailableBandwidth() != null
                 && link.augmentation(Link1.class).getUsedBandwidth() != null) {
                 Uint32 avlBw = link.augmentation(Link1.class).getAvailableBandwidth();
@@ -185,7 +202,7 @@ public final class OpenRoadmOtnTopology {
         List<TerminationPoint> tps = new ArrayList<>();
         for (TerminationPoint tp : oldTps) {
             if (bwIncr != 0) {
-                tps.add(updateNodeTpTsPool(tp, serviceRate, tribPortNb, tribSoltNb, isDeletion));
+                tps.add(updateNodeTpTsPool(tp, serviceRate, tribPortNb, minTribSlotNb, maxTribSlotNb, isDeletion));
             }
         }
         if (!links.isEmpty() && !tps.isEmpty()) {
@@ -196,18 +213,30 @@ public final class OpenRoadmOtnTopology {
         }
     }
 
-    public static TopologyShard deleteOtnLinks(List<Link> suppOtu4Links, List<TerminationPoint> oldTps) {
+    public static TopologyShard deleteOtnLinks(List<Link> suppOtuLinks, List<TerminationPoint> oldTps,
+            OtnLinkType linkType) {
         List<Link> links = new ArrayList<>();
-        for (Link link : suppOtu4Links) {
-            if (link.augmentation(Link1.class) != null) {
-                links.add(updateOtnLinkBwParameters(link, 100000L, 0L));
+        OtnLinkType otnLinkType = null;
+        for (Link link : suppOtuLinks) {
+            if (link.augmentation(Link1.class) != null && link.augmentation(
+                    org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1.class) != null) {
+                otnLinkType = link.augmentation(
+                        org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1.class).getOtnLinkType();
+                if (OtnLinkType.OTU4.equals(otnLinkType)) {
+                    links.add(updateOtnLinkBwParameters(link, 100000L, 0L));
+                } else if (OtnLinkType.OTUC4.equals(otnLinkType)) {
+                    links.add(updateOtnLinkBwParameters(link, 400000L, 0L));
+                } else {
+                    LOG.warn("Unexpected otn-link-type {} for link {}", otnLinkType, link.getLinkId());
+                }
             } else {
                 LOG.error("Error with otn parameters of supported link {}", link.getLinkId().getValue());
+                return new TopologyShard(null, null, null);
             }
         }
         List<TerminationPoint> tps = new ArrayList<>();
         for (TerminationPoint tp : oldTps) {
-            tps.add(updateTp(tp, false));
+            tps.add(updateTp(tp, false, linkType));
         }
         if (links.size() == 2 && tps.size() == 2) {
             return new TopologyShard(null, links, tps);
@@ -217,29 +246,33 @@ public final class OpenRoadmOtnTopology {
     }
 
     private static List<Link> initialiseOtnLinks(String nodeA, String tpA, String nodeZ, String tpZ,
-        OtnLinkType linkType, String linkIdPrefix) {
+            OtnLinkType linkType) {
         List<Link> links = new ArrayList<>();
+        String nodeATopo = formatNodeName(nodeA, tpA);
+        String nodeZTopo = formatNodeName(nodeZ, tpZ);
         org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1 tpceLink1
             = new org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1Builder()
             .setOtnLinkType(linkType).build();
-        Link1 otnLink1 = new Link1Builder()
-            .setAvailableBandwidth(Uint32.valueOf(100000))
-            .setUsedBandwidth(Uint32.valueOf(0))
-            .build();
-        // create link A-Z
-        String nodeATopo;
-        String nodeZTopo;
-        if (nodeA.contains(XPDR) && nodeZ.contains(XPDR)) {
-            nodeATopo = nodeA;
-            nodeZTopo = nodeZ;
-        } else {
-            nodeATopo = nodeA + "-" + tpA.split("-")[0];
-            nodeZTopo = nodeZ + "-" + tpZ.split("-")[0];
+        Link1Builder otnLink1Bldr = new Link1Builder()
+            .setUsedBandwidth(Uint32.valueOf(0));
+        switch (linkType) {
+            case OTU4:
+            case ODTU4:
+                otnLink1Bldr.setAvailableBandwidth(Uint32.valueOf(100000));
+                break;
+            case OTUC4:
+            case ODUC4:
+                otnLink1Bldr.setAvailableBandwidth(Uint32.valueOf(400000));
+                break;
+            default:
+                LOG.error("unable to set available bandwidth to unknown link type");
+                break;
         }
-        LinkBuilder ietfLinkAZBldr = TopologyUtils.createLink(nodeATopo, nodeZTopo, tpA, tpZ, linkIdPrefix);
+        // create link A-Z
+        LinkBuilder ietfLinkAZBldr = TopologyUtils.createLink(nodeATopo, nodeZTopo, tpA, tpZ, linkType.getName());
         ietfLinkAZBldr
             .addAugmentation(tpceLink1)
-            .addAugmentation(otnLink1)
+            .addAugmentation(otnLink1Bldr.build())
             .addAugmentation(
                 new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1Builder(
                         ietfLinkAZBldr.augmentation(
@@ -250,10 +283,10 @@ public final class OpenRoadmOtnTopology {
                         .build());
         links.add(ietfLinkAZBldr.build());
         // create link Z-A
-        LinkBuilder ietfLinkZABldr = TopologyUtils.createLink(nodeZTopo, nodeATopo, tpZ, tpA, linkIdPrefix);
+        LinkBuilder ietfLinkZABldr = TopologyUtils.createLink(nodeZTopo, nodeATopo, tpZ, tpA, linkType.getName());
         ietfLinkZABldr
             .addAugmentation(tpceLink1)
-            .addAugmentation(otnLink1)
+            .addAugmentation(otnLink1Bldr.build())
             .addAugmentation(
                 new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1Builder(
                         ietfLinkZABldr.augmentation(
@@ -276,7 +309,8 @@ public final class OpenRoadmOtnTopology {
         return updatedLinkBldr.build();
     }
 
-    private static TerminationPoint updateTp(TerminationPoint originalTp, boolean addingTsTpnPoolTermination) {
+    private static TerminationPoint updateTp(TerminationPoint originalTp, boolean addingTsTpnPoolTermination,
+            OtnLinkType linkType) {
         LOG.debug("in updateTp");
         TerminationPointBuilder tpBldr = new TerminationPointBuilder(originalTp);
         TerminationPoint1Builder otnTp1Bldr = new TerminationPoint1Builder(
@@ -285,12 +319,16 @@ public final class OpenRoadmOtnTopology {
             .getXpdrTpPortConnectionAttributes());
         if (addingTsTpnPoolTermination) {
             List<Uint16> tsPool = new ArrayList<>();
-            for (int i = 0; i < NB_TRIB_SLOTS; i++) {
-                tsPool.add(Uint16.valueOf(i + 1));
+            for (int i = 1; i <= NB_TRIB_SLOTS; i++) {
+                tsPool.add(Uint16.valueOf(i));
             }
             xtpcaBldr.setTsPool(tsPool);
             List<Uint16> tpnPool = new ArrayList<>();
-            for (int i = 1; i <= NB_TRIB_PORTS; i++) {
+            int nbTribPort = NB_TRIB_PORTS;
+            if (OtnLinkType.ODUC4.equals(linkType)) {
+                nbTribPort = 4;
+            }
+            for (int i = 1; i <= nbTribPort; i++) {
                 tpnPool.add(Uint16.valueOf(i));
             }
             OdtuTpnPool oduTpnPool = new OdtuTpnPoolBuilder().setOdtuType(ODTU4TsAllocated.class)
@@ -304,35 +342,21 @@ public final class OpenRoadmOtnTopology {
     }
 
     private static TerminationPoint updateNodeTpTsPool(TerminationPoint tp, Uint32 serviceRate, Short tribPortNb,
-        Short tribSlotNb, boolean isDeletion) {
+        Short minTribSlotNb, Short maxTribSlotNb, boolean isDeletion) {
         LOG.debug("in updateNodeTpTsPool");
         TerminationPointBuilder tpBldr = new TerminationPointBuilder(tp);
         @Nullable
         XpdrTpPortConnectionAttributesBuilder xtpcaBldr = new XpdrTpPortConnectionAttributesBuilder(
             tpBldr.augmentation(TerminationPoint1.class).getXpdrTpPortConnectionAttributes());
         List<Uint16> tsPool = new ArrayList<>(xtpcaBldr.getTsPool());
-        switch (serviceRate.intValue()) {
-            case 1:
-                if (isDeletion) {
-                    tsPool.add(Uint16.valueOf(tribSlotNb));
-                } else {
-                    tsPool.remove(Uint16.valueOf(tribSlotNb));
-                }
-                break;
-            case 10:
-                if (isDeletion) {
-                    for (int i = 0; i < NB_TRIB_SLOT_PER_10GE; i++) {
-                        tsPool.add(Uint16.valueOf(tribSlotNb + i));
-                    }
-                } else {
-                    for (int i = 0; i < NB_TRIB_SLOT_PER_10GE; i++) {
-                        tsPool.remove(Uint16.valueOf(tribSlotNb + i));
-                    }
-                }
-                break;
-            default:
-                LOG.error("error updating tpn and ts pool for tp {}", tp.getTpId().getValue());
-                break;
+        if (isDeletion) {
+            for (int i = minTribSlotNb; i <= maxTribSlotNb; i++) {
+                tsPool.add(Uint16.valueOf(i));
+            }
+        } else {
+            for (int i = minTribSlotNb; i <= maxTribSlotNb; i++) {
+                tsPool.remove(Uint16.valueOf(i));
+            }
         }
         xtpcaBldr.setTsPool(tsPool);
         List<Uint16> tpnPool;
@@ -347,7 +371,20 @@ public final class OpenRoadmOtnTopology {
         } else {
             tpnPool = new ArrayList<>();
         }
-        OdtuTpnPool odtuTpnPool = new OdtuTpnPoolBuilder().setOdtuType(ODTU4TsAllocated.class)
+        Class<? extends OdtuTypeIdentity> odtuType = null;
+        switch (serviceRate.intValue()) {
+            case 1:
+            case 10:
+                odtuType = ODTU4TsAllocated.class;
+                break;
+            case 100:
+                odtuType = ODTUCnTs.class;
+                break;
+            default:
+                LOG.warn("Unable to set the odtu-type");
+                break;
+        }
+        OdtuTpnPool odtuTpnPool = new OdtuTpnPoolBuilder().setOdtuType(odtuType)
             .setTpnPool(tpnPool).build();
         xtpcaBldr.setOdtuTpnPool(ImmutableMap.of(odtuTpnPool.key(),odtuTpnPool));
 
@@ -721,4 +758,14 @@ public final class OpenRoadmOtnTopology {
             .addAugmentation(ocnTp);
         return ietfTpBldr.build();
     }
+
+    private static String formatNodeName(String nodeName, String tpName) {
+        String newNodeName = null;
+        if (nodeName.contains(XPDR)) {
+            newNodeName = nodeName;
+        } else {
+            newNodeName = new StringBuilder(nodeName).append("-").append(tpName.split("-")[0]).toString();
+        }
+        return newNodeName;
+    }
 }
index df5d60f526953b90a2aeb1270df8e0c7fedf180f..5a186b52b5d0f4025ac16ad00dbb268584dba459 100644 (file)
@@ -296,7 +296,7 @@ public class OpenRoadmOtnTopologyTest {
         TopologyShard topoShard = OpenRoadmOtnTopology
             .createOtnLinks(
                 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000)),
-                NetworkmodelTestUtil.createTpList(false));
+                NetworkmodelTestUtil.createTpList(false), OtnLinkType.ODTU4);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertNull("list of nodes should be null", topoShard.getNodes());
         List<Link> sortedLinks = topoShard.getLinks().stream()
@@ -314,10 +314,10 @@ public class OpenRoadmOtnTopologyTest {
             sortedLinks.get(2).augmentation(Link1.class).getUsedBandwidth());
 
         assertEquals(
-            "ODU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
+            "ODTU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
             sortedLinks.get(0).getLinkId().getValue());
         assertEquals(
-            "ODU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
+            "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
             sortedLinks.get(1).getLinkId().getValue());
         assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
         assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
@@ -339,7 +339,7 @@ public class OpenRoadmOtnTopologyTest {
                 .getLinkType());
         assertEquals(
             "opposite link must be present",
-            "ODU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
+            "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
             sortedLinks.get(0)
                 .augmentation(
                     org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1.class)
@@ -404,7 +404,8 @@ public class OpenRoadmOtnTopologyTest {
             otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
         }
         TopologyShard topoShard =
-            OpenRoadmOtnTopology.createOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(false));
+            OpenRoadmOtnTopology.createOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(false),
+                OtnLinkType.OTU4);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertNull("list of nodes should be null", topoShard.getNodes());
         assertNull("list of links should be null", topoShard.getLinks());
@@ -414,7 +415,7 @@ public class OpenRoadmOtnTopologyTest {
         topoShard =
             OpenRoadmOtnTopology.createOtnLinks(
                     NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(99000)),
-                    NetworkmodelTestUtil.createTpList(false));
+                    NetworkmodelTestUtil.createTpList(false), OtnLinkType.OTU4);
         assertNull("list of nodes should be null", topoShard.getNodes());
         assertNull("list of links should be null", topoShard.getLinks());
         assertNull("list of tps should be null", topoShard.getTps());
@@ -425,7 +426,7 @@ public class OpenRoadmOtnTopologyTest {
         TopologyShard topoShard =
             OpenRoadmOtnTopology.deleteOtnLinks(
                     NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0)),
-                    NetworkmodelTestUtil.createTpList(true));
+                    NetworkmodelTestUtil.createTpList(true), OtnLinkType.OTU4);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertEquals("list of links should contain 2 links", 2, topoShard.getLinks().size());
         assertEquals(
@@ -464,7 +465,8 @@ public class OpenRoadmOtnTopologyTest {
             otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
         }
         TopologyShard topoShard =
-            OpenRoadmOtnTopology.deleteOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(true));
+            OpenRoadmOtnTopology.deleteOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(true),
+                OtnLinkType.OTU4);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertNull("list of nodes should be null", topoShard.getNodes());
         assertNull("list of links should be null", topoShard.getLinks());
@@ -478,14 +480,14 @@ public class OpenRoadmOtnTopologyTest {
             OpenRoadmOtnTopology.updateOtnLinks(
                     NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
                     NetworkmodelTestUtil.createTpList(true),
-                    Uint32.valueOf(10), (short)1, (short)1, false);
+                    Uint32.valueOf(10), (short)1, (short)1, (short)8, false);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertNull("list of nodes should be null", topoShard.getNodes());
         List<Link> sortedLinks = topoShard.getLinks().stream()
             .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
             .collect(Collectors.toList());
         assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
-        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
         assertEquals(
             "after 10G creation, available BW of supported ODU4 should be 90000",
             Uint32.valueOf(90000),
@@ -550,12 +552,12 @@ public class OpenRoadmOtnTopologyTest {
         // tests update for 10G deletion
         sortedLinks.clear();
         topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), Uint32.valueOf(10),
-            (short)1, (short)1, true);
+            (short)1, (short)1, (short)8, true);
         sortedLinks = topoShard.getLinks().stream()
             .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
             .collect(Collectors.toList());
         assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
-        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
         assertEquals(
             "after 10G deletion, available BW of supported ODU4 should be 100 000",
             Uint32.valueOf(100000),
@@ -616,14 +618,14 @@ public class OpenRoadmOtnTopologyTest {
             OpenRoadmOtnTopology.updateOtnLinks(
                     NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
                     NetworkmodelTestUtil.createTpList(true),
-                    Uint32.valueOf(1), (short)1, (short)1, false);
+                    Uint32.valueOf(1), (short)1, (short)1, (short)1, false);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertNull("list of nodes should be null", topoShard.getNodes());
         List<Link> sortedLinks = topoShard.getLinks().stream()
             .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
             .collect(Collectors.toList());
         assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
-        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
         assertEquals(
             "after 1G creation, available BW of supported ODU4 should be 99000",
             Uint32.valueOf(99000),
@@ -690,12 +692,12 @@ public class OpenRoadmOtnTopologyTest {
             OpenRoadmOtnTopology.updateOtnLinks(
                     topoShard.getLinks(),
                     topoShard.getTps(),
-                    Uint32.valueOf(1), (short)1, (short)1, true);
+                    Uint32.valueOf(1), (short)1, (short)1, (short)1, true);
         sortedLinks = topoShard.getLinks().stream()
             .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
             .collect(Collectors.toList());
         assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
-        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+        assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
         assertEquals(
             "after 1G deletion, available BW of supported ODU4 should be 100 000",
             Uint32.valueOf(100000),
@@ -760,7 +762,7 @@ public class OpenRoadmOtnTopologyTest {
             OpenRoadmOtnTopology.updateOtnLinks(
                     odu4LinksWithBadBWParam,
                     NetworkmodelTestUtil.createTpList(true),
-                    Uint32.valueOf(1), (short)1, (short)1, false);
+                    Uint32.valueOf(1), (short)1, (short)1, (short)10, false);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertNull("list of nodes should be null", topoShard.getNodes());
         assertNull("list of links should be null", topoShard.getLinks());
@@ -775,7 +777,7 @@ public class OpenRoadmOtnTopologyTest {
             OpenRoadmOtnTopology.updateOtnLinks(
                     odu4LinksWithBadBWParam,
                     NetworkmodelTestUtil.createTpList(true),
-                    Uint32.valueOf(10), (short)1, (short)1, false);
+                    Uint32.valueOf(10), (short)1, (short)1, (short)10, false);
         assertNotNull("TopologyShard should never be null", topoShard);
         assertNull("list of nodes should be null", topoShard.getNodes());
         assertNull("list of links should be null", topoShard.getLinks());
index 30457ecdae6c463763b88cae75900fe37bd61995..6bafebb88611d41d696e9b0a8d5267a1f9e2a1c0 100644 (file)
@@ -87,14 +87,8 @@ public final class NetworkmodelTestUtil {
     }
 
     public static List<Link> createSuppOTNLinks(OtnLinkType type, Uint32 availBW) {
-        String prefix = null;
-        if (OtnLinkType.OTU4.equals(type)) {
-            prefix = "OTU4-";
-        } else if (OtnLinkType.ODTU4.equals(type)) {
-            prefix = "ODU4-";
-        }
         Link linkAZ = new LinkBuilder()
-            .setLinkId(new LinkId(prefix + "SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
+            .setLinkId(new LinkId(type.getName() + "-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
             .setSource(new SourceBuilder()
                     .setSourceNode(new NodeId("SPDRA-XPDR1"))
                     .setSourceTp("XPDR1-NETWORK1").build())
@@ -104,7 +98,8 @@ public final class NetworkmodelTestUtil {
             .addAugmentation(
                 new Link1Builder()
                     .setLinkType(OpenroadmLinkType.OTNLINK)
-                    .setOppositeLink(new LinkId(prefix + "SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
+                    .setOppositeLink(new LinkId(type.getName()
+                        + "-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
                     .build())
             .addAugmentation(
                 new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder()
@@ -117,7 +112,7 @@ public final class NetworkmodelTestUtil {
                     .build())
             .build();
         Link linkZA = new LinkBuilder()
-            .setLinkId(new LinkId(prefix + "SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
+            .setLinkId(new LinkId(type.getName() + "-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
             .setSource(new SourceBuilder()
                     .setSourceNode(new NodeId("SPDRZ-XPDR1"))
                     .setSourceTp("XPDR1-NETWORK1").build())
@@ -127,7 +122,8 @@ public final class NetworkmodelTestUtil {
             .addAugmentation(
                 new Link1Builder()
                     .setLinkType(OpenroadmLinkType.OTNLINK)
-                    .setOppositeLink(new LinkId(prefix + "SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
+                    .setOppositeLink(new LinkId(type.getName()
+                        + "-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
                     .build())
             .addAugmentation(
                 new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder()
index 0c76eb001ad3b5dd55864861fa79f94b32e49711..82eb677604059711435d25c8cdbfadb1615d43db 100644 (file)
@@ -93,25 +93,26 @@ public class RendererListenerImpl implements TransportpceRendererListener {
     private void onServiceDeleteResult(RendererRpcResultSp notification) {
         switch (serviceRpcResultSp.getStatus()) {
             case Successful:
-                LOG.info("Service '{}' deleted !", notification.getServiceName());
                 String serviceType = notification.getServiceType();
                 switch (serviceType) {
                     case StringConstants.SERVICE_TYPE_1GE:
                     case StringConstants.SERVICE_TYPE_10GE:
                     case StringConstants.SERVICE_TYPE_100GE_M:
                         Short tribPort = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
-                                .split("\\.")[0]);
+                            .split("\\.")[0]);
                         Short minTribSlot = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
-                                .split("\\.")[1]);
+                            .split("\\.")[1]);
+                        Short maxTribSlot = Short.valueOf(notification.getAToZDirection().getMaxTribSlot().getValue()
+                            .split("\\.")[1]);
                         updateOtnTopology(notification.getLink(), true, notification.getServiceType(),
-                            notification.getAToZDirection().getRate(), tribPort, minTribSlot);
+                            notification.getAToZDirection().getRate(), tribPort, minTribSlot, maxTribSlot);
                         break;
                     case StringConstants.SERVICE_TYPE_OTU4:
                     case StringConstants.SERVICE_TYPE_OTUC4:
                     case StringConstants.SERVICE_TYPE_ODU4:
                     case StringConstants.SERVICE_TYPE_ODUC4:
                         updateOtnTopology(notification.getLink(), true, notification.getServiceType(), null, null,
-                            null);
+                            null, null);
                         break;
                     default:
                         break;
@@ -187,17 +188,19 @@ public class RendererListenerImpl implements TransportpceRendererListener {
             case StringConstants.SERVICE_TYPE_10GE:
             case StringConstants.SERVICE_TYPE_100GE_M:
                 Short tribPort = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
-                        .split("\\.")[0]);
+                    .split("\\.")[0]);
                 Short minTribSlot = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
-                        .split("\\.")[1]);
+                    .split("\\.")[1]);
+                Short maxTribSlot = Short.valueOf(notification.getAToZDirection().getMaxTribSlot().getValue()
+                    .split("\\.")[1]);
                 updateOtnTopology(notification.getLink(), false, notification.getServiceType(),
-                    notification.getAToZDirection().getRate(), tribPort, minTribSlot);
+                    notification.getAToZDirection().getRate(), tribPort, minTribSlot, maxTribSlot);
                 break;
             case StringConstants.SERVICE_TYPE_OTU4:
             case StringConstants.SERVICE_TYPE_OTUC4:
             case StringConstants.SERVICE_TYPE_ODU4:
             case StringConstants.SERVICE_TYPE_ODUC4:
-                updateOtnTopology(notification.getLink(), false, notification.getServiceType(), null, null, null);
+                updateOtnTopology(notification.getLink(), false, notification.getServiceType(), null, null, null, null);
                 break;
             default:
                 break;
@@ -348,7 +351,7 @@ public class RendererListenerImpl implements TransportpceRendererListener {
     }
 
     private void updateOtnTopology(Link link, boolean isDeletion, String serviceType, Uint32 rate, Short portNb,
-            Short slotNb) {
+            Short minSlotNb, Short maxSlotNb) {
         if (link == null) {
             return;
         }
@@ -392,7 +395,7 @@ public class RendererListenerImpl implements TransportpceRendererListener {
             case StringConstants.SERVICE_TYPE_10GE:
             case StringConstants.SERVICE_TYPE_100GE_M:
                 LOG.info("updating otn-topology node tps -tps and tpn pools");
-                this.networkModelService.updateOtnLinks(link, rate, portNb, slotNb, isDeletion);
+                this.networkModelService.updateOtnLinks(link, rate, portNb, minSlotNb, maxSlotNb, isDeletion);
                 break;
             default:
                 break;
index 13b15e32f91150547dbb46dba47f53be4410335a..ac07c75828a417204219c20a5b673e1e9281983c 100644 (file)
@@ -1195,7 +1195,7 @@ public class ConvertORTopoToTapiFullTopo {
                     .setServerIntegrityProcessCharacteristic("server integrity process")
                     .setValidationMechanism(Map.of(validationMechanism.key(), validationMechanism))
                     .build();
-            case "ODU4":
+            case "ODTU4":
                 sourceUuidTp = this.uuidMap.get(String.join("+", sourceNode, E_ODU, sourceTp));
                 sourceUuidNode = this.uuidMap.get(String.join("+", sourceNode, DSR));
                 NodeEdgePoint sourceNep2 = new NodeEdgePointBuilder()
index 2a83ea0023e17700c1e470a83087fd17bab79dd3..6abf9471c715fcf640dd57dbc477db12ef4a4c37 100644 (file)
@@ -787,7 +787,7 @@ public class ConvertORTopoToTapiTopo {
                         .setValue(Uint64.valueOf(link.augmentation(Link1.class).getAvailableBandwidth())).build())
                     .build())
                 .build();
-            case "ODU4":
+            case "ODTU4":
                 sourceUuidTp = this.uuidMap.get(String.join("+", sourceNode, DSR, sourceTp));
                 sourceUuidNode = this.uuidMap.get(String.join("+", sourceNode, DSR));
                 NodeEdgePoint sourceNep2 = new NodeEdgePointBuilder()
index 890dab6cbda64bc04e7d50d8a1180a603bf6194d..56225bcbb44ef43c2bba25553c94d7e7810ba9c5 100644 (file)
@@ -309,7 +309,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
             .networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
             link = changeOtnLinkState(otnLinks.get(new LinkKey(
-                new LinkId("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))), null, null);
+                new LinkId("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))), null, null);
         otnLinksAlt.replace(link.key(), link);
 
         ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid);
@@ -346,7 +346,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
             .networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
             link = changeOtnLinkState(otnLinks.get(new LinkKey(
-                new LinkId("ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))), null, null);
+                new LinkId("ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))), null, null);
         otnLinksAlt.replace(link.key(), link);
 
         ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid);
@@ -383,7 +383,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
             .networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
             link = changeOtnLinkState(otnLinks.get(new LinkKey(
-                new LinkId("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
+                new LinkId("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
                 AdminStates.OutOfService, State.OutOfService);
         otnLinksAlt.replace(link.key(), link);
 
@@ -423,7 +423,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
             .networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
             link = changeOtnLinkState(otnLinks.get(new LinkKey(
-                new LinkId("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
+                new LinkId("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
                 AdminStates.Maintenance, State.Degraded);
         otnLinksAlt.replace(link.key(), link);
 
@@ -463,7 +463,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
             .networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
             link = changeOtnLinkState(otnLinks.get(new LinkKey(
-                new LinkId("ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))),
+                new LinkId("ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))),
                 AdminStates.OutOfService, State.OutOfService);
         otnLinksAlt.replace(link.key(), link);
 
@@ -629,7 +629,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
         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"
+            new Uuid(UUID.nameUUIDFromBytes("ODTU4-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"
@@ -639,7 +639,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
             .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");
+            "ODTU4-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");
     }
@@ -1240,7 +1240,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
         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)) {
+        } else if ("ODTU4".equals(prefix)) {
             assertEquals("Available capacity -total size value should be 100 000",
                 Uint64.valueOf(100000), link.getAvailableCapacity().getTotalSize().getValue());
         }
@@ -1251,7 +1251,7 @@ public class ConvertORTopoToTapiTopoTest extends AbstractTest {
         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)) {
+        } else if ("ODTU4".equals(prefix)) {
             assertEquals("otn link should be between 2 nodes of protocol layers ODU",
                 LayerProtocolName.ODU.getName(), link.getLayerProtocolName().get(0).getName());
         }
index 241f27591e7ab0b548909109306d2c042eed0940..96d709e016c774980fe982df14841e048c5f7249 100644 (file)
@@ -237,7 +237,7 @@ public class TapiTopologyImplTest extends AbstractTest {
         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"
+            new Uuid(UUID.nameUUIDFromBytes("ODTU4-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"
@@ -248,7 +248,7 @@ public class TapiTopologyImplTest extends AbstractTest {
             .sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue()))
             .collect(Collectors.toList());
         checkOtnLink(links.get(0), topoUuid, node1Uuid, node2Uuid, tp1Uuid, tp2Uuid, link1Uuid,
-            "ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
+            "ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
         checkOtnLink(links.get(1), topoUuid, node3Uuid, node4Uuid, tp3Uuid, tp4Uuid, link2Uuid,
             "OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
     }
@@ -263,7 +263,7 @@ public class TapiTopologyImplTest extends AbstractTest {
         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)) {
+        } else if ("ODTU4".equals(prefix)) {
             assertEquals("Available capacity -total size value should be 100 000",
                 Uint64.valueOf(100000), link.getAvailableCapacity().getTotalSize().getValue());
         }
@@ -274,7 +274,7 @@ public class TapiTopologyImplTest extends AbstractTest {
         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)) {
+        } else if ("ODTU4".equals(prefix)) {
             assertEquals("otn link should be between 2 nodes of protocol layers ODU",
                 LayerProtocolName.ODU.getName(), link.getLayerProtocolName().get(0).getName());
         }
index 0134fca526fcf4d3880e67ddbe7ac4a3f8df27bb..e02d8d0316d64dcc66ecdb6b4c3b3c226287c059 100644 (file)
     <otn-link-type xmlns="http://transportpce/topology">OTU4</otn-link-type>
   </link>
   <link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
-    <link-id>ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</link-id>
+    <link-id>ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</link-id>
     <source>
       <source-node>SPDR-SC1-XPDR1</source-node>
       <source-tp>XPDR1-NETWORK1</source-tp>
     <used-bandwidth xmlns="http://org/openroadm/otn/network/topology">0</used-bandwidth>
     <link-type xmlns="http://org/openroadm/common/network">OTN-LINK</link-type>
     <operational-state xmlns="http://org/openroadm/common/network">inService</operational-state>
-    <opposite-link xmlns="http://org/openroadm/common/network">ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</opposite-link>
+    <opposite-link xmlns="http://org/openroadm/common/network">ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</opposite-link>
     <administrative-state xmlns="http://org/openroadm/common/network">inService</administrative-state>
     <destination>
       <dest-tp>XPDR1-NETWORK1</dest-tp>
     <otn-link-type xmlns="http://transportpce/topology">ODTU4</otn-link-type>
   </link>
   <link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
-    <link-id>ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</link-id>
+    <link-id>ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</link-id>
     <source>
       <source-node>SPDR-SA1-XPDR1</source-node>
       <source-tp>XPDR1-NETWORK1</source-tp>
     <used-bandwidth xmlns="http://org/openroadm/otn/network/topology">0</used-bandwidth>
     <link-type xmlns="http://org/openroadm/common/network">OTN-LINK</link-type>
     <operational-state xmlns="http://org/openroadm/common/network">inService</operational-state>
-    <opposite-link xmlns="http://org/openroadm/common/network">ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</opposite-link>
+    <opposite-link xmlns="http://org/openroadm/common/network">ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</opposite-link>
     <administrative-state xmlns="http://org/openroadm/common/network">inService</administrative-state>
     <destination>
       <dest-tp>XPDR1-NETWORK1</dest-tp>
index 6e04ca93e6de6c1cc41ce554a87656da3ec3e35c..9ffbd62f040911772681d7b0141e05eda161560a 100644 (file)
@@ -542,8 +542,8 @@ class TransportPCEtesting(unittest.TestCase):
                     link['org-openroadm-otn-network-topology:available-bandwidth'], 0)
                 self.assertEqual(
                     link['org-openroadm-otn-network-topology:used-bandwidth'], 100000)
-            elif (linkId in ('ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
-                             'ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1')):
+            elif (linkId in ('ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
+                             'ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1')):
                 self.assertEqual(
                     link['org-openroadm-otn-network-topology:available-bandwidth'], 100000)
                 self.assertEqual(
@@ -553,8 +553,8 @@ class TransportPCEtesting(unittest.TestCase):
                 self.assertEqual(
                     link['org-openroadm-common-network:link-type'], 'OTN-LINK')
                 self.assertIn(link['org-openroadm-common-network:opposite-link'],
-                              ['ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
-                               'ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1'])
+                              ['ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
+                               'ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1'])
             else:
                 self.fail("this link should not exist")