Merge "Drop the service name from ODU connection name"
authorGilles Thouenon <gilles.thouenon@orange.com>
Mon, 2 May 2022 09:09:37 +0000 (09:09 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 2 May 2022 09:09:37 +0000 (09:09 +0000)
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface710.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java
tests/installMavenCentOS.sh
tests/transportpce_tests/7.1/test02_otn_renderer.py

index 1d72b2552f3f0647cf4c502e946db38046a3bea3..7fa28d5f540f2b0af70899e21b9943051c473005 100644 (file)
@@ -365,9 +365,11 @@ public class OpenRoadmInterface710 {
             // create OCH interface
             interfaceOchOtsiOtsigroup = createOpenRoadmOchInterface(nodeId, logicalConnPoint, spectrumInformation);
         } else if (portMap.getSupportedInterfaceCapability().contains(IfOtsiOtsigroup.class)) {
-            // Create OTSi and OTSi-group
+            // Create OTSi and OTSi-group and concat the names of the interface
             String interfaceOtsiName = createOpenRoadmOtsiInterface(nodeId, logicalConnPoint, spectrumInformation);
-            interfaceOchOtsiOtsigroup = createOpenRoadmOtsiGroupInterface(nodeId, logicalConnPoint, interfaceOtsiName,
+            // Concat the two names for this interface
+            interfaceOchOtsiOtsigroup = interfaceOtsiName
+                + "#" + createOpenRoadmOtsiGroupInterface(nodeId, logicalConnPoint, interfaceOtsiName,
                 spectrumInformation);
         }
 
@@ -877,17 +879,19 @@ public class OpenRoadmInterface710 {
         }
         // Depending on OTU4 or OTUCn, supporting interface should
         // reflect that
-        String interfaceOdu4Oducn = null;
+        String interfaceOdu4OducnOduflex = null;
         if (portMap.getSupportedInterfaceCapability().contains(IfOCHOTU4ODU4.class)) {
             // create OTU4 interface
-            interfaceOdu4Oducn = createOpenRoadmOdu4Interface(nodeId, logicalConnPoint, apiInfoA, apiInfoZ);
+            interfaceOdu4OducnOduflex = createOpenRoadmOdu4Interface(nodeId, logicalConnPoint, apiInfoA, apiInfoZ);
         } else if (portMap.getSupportedInterfaceCapability().contains(IfOtsiOtsigroup.class)) {
             // Create ODUCn and ODUFlex interface.
             String interfaceOducn = createOpenRoadmOducnInterface(nodeId, logicalConnPoint);
-            interfaceOdu4Oducn = createOpenRoadmOduflexInterface(nodeId, logicalConnPoint, interfaceOducn);
+            // Here we concat the two interfaces
+            interfaceOdu4OducnOduflex = interfaceOducn + "#"
+                + createOpenRoadmOduflexInterface(nodeId, logicalConnPoint, interfaceOducn);
         }
 
-        return interfaceOdu4Oducn;
+        return interfaceOdu4OducnOduflex;
     }
 
     public String createOpenRoadmOtnOducnInterface(String nodeId, String logicalConnPoint,
index fba0a588c94d81cfb4f7cb19d69df8ac8d69bd57..aae347bc25350459005b822edbc461674ed8d11e 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.transportpce.renderer.provisiondevice;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.FluentFuture;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -158,15 +159,23 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
                         crossConnectFlag++;
                         String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
                                 nodeId, destTp, spectrumInformation);
-                        createdOchInterfaces.add(supportingOchInterface);
+                        // Split the string based on # pass the last element as the supported Interface
+                        // This is needed for 7.1 device models with B100G, we have OTSI, OTSI-group combined as OCH
+                        String[] listOfSuppOchInf = supportingOchInterface.split("#");
+                        createdOchInterfaces = Arrays.asList(listOfSuppOchInf);
+                        // Taking the last element
+                        supportingOchInterface = createdOchInterfaces.get(createdOchInterfaces.size() - 1);
                         String supportingOtuInterface = this.openRoadmInterfaceFactory.createOpenRoadmOtu4Interface(
                                 nodeId, destTp, supportingOchInterface, apiInfoA, apiInfoZ);
                         createdOtuInterfaces.add(supportingOtuInterface);
                         if (srcTp == null) {
                             otnLinkTps.add(new LinkTpBuilder().setNodeId(nodeId).setTpId(destTp).build());
                         } else {
-                            createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4HOInterface(
-                                    nodeId, destTp, false, apiInfoA, apiInfoZ, PT_07));
+                            // This is needed for 7.1 device models for 400GE, since we have ODUC4 and ODUflex
+                            // are combined
+                            createdOduInterfaces = Arrays.asList(this.openRoadmInterfaceFactory
+                                .createOpenRoadmOdu4HOInterface(
+                                    nodeId, destTp, false, apiInfoA, apiInfoZ, PT_07).split("#"));
                         }
                     }
                     if ((srcTp != null) && srcTp.contains(StringConstants.CLIENT_TOKEN)) {
index 185f0788e4115fe70bbf137b6ec79082573e07a3..b943d518ffa3dd622c38f8764ad8a62c294f64f2 100755 (executable)
@@ -27,9 +27,9 @@ else
         fi
 fi
 
-#download maven image 3.6.3 and install it
-wget -nv https://dlcdn.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
+#download maven image 3.8.5 and install it
+wget -nv https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz -P /tmp
 sudo mkdir -p /opt
-sudo tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
-sudo ln -s /opt/apache-maven-3.6.3 /opt/maven
+sudo tar xf /tmp/apache-maven-3.8.5-bin.tar.gz -C /opt
+sudo ln -s /opt/apache-maven-3.8.5 /opt/maven
 sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn
index 7f3f042c891a1ce782625a8585dd2d25d5472909..b7510bc42e4e8d89879dae409540568b808a2cd9 100644 (file)
@@ -86,7 +86,9 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
         self.assertIn(
             {'node-id': 'XPDR-A2',
              'otu-interface-id': ['XPDR2-NETWORK1-OTUC2'],
-             'och-interface-id': ['XPDR2-NETWORK1-OTSIGROUP-200G']}, response['output']['node-interface'])
+             'och-interface-id': ['XPDR2-NETWORK1-OTSIGROUP-200G',
+                                  'XPDR2-NETWORK1-755:768']},
+            response['output']['node-interface'])
 
     def test_03_get_portmapping_network1(self):
         response = test_utils_rfc8040.portmapping_request("XPDR-A2", "XPDR2-NETWORK1")
@@ -454,7 +456,9 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
         self.assertIn(
             {'node-id': 'XPDR-A2',
              'otu-interface-id': ['XPDR2-NETWORK1-OTUC3'],
-             'och-interface-id': ['XPDR2-NETWORK1-OTSIGROUP-300G']}, response['output']['node-interface'])
+             'och-interface-id': ['XPDR2-NETWORK1-755:768',
+                                  'XPDR2-NETWORK1-OTSIGROUP-300G']},
+            response['output']['node-interface'])
 
     def test_27_get_portmapping_network1(self):
         response = test_utils_rfc8040.portmapping_request("XPDR-A2", "XPDR2-NETWORK1")
@@ -674,7 +678,9 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
         self.assertIn(
             {'node-id': 'XPDR-A2',
              'otu-interface-id': ['XPDR2-NETWORK1-OTUC4'],
-             'och-interface-id': ['XPDR2-NETWORK1-OTSIGROUP-400G']}, response['output']['node-interface'])
+             'och-interface-id': ['XPDR2-NETWORK1-755:768',
+                                  'XPDR2-NETWORK1-OTSIGROUP-400G']},
+            response['output']['node-interface'])
 
     def test_41_get_portmapping_network1(self):
         response = test_utils_rfc8040.portmapping_request("XPDR-A2", "XPDR2-NETWORK1")