Set xponder-type in portmapping 07/98607/1
authorGilles Thouenon <gilles.thouenon@orange.com>
Thu, 7 Oct 2021 11:07:25 +0000 (13:07 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Thu, 18 Nov 2021 16:25:06 +0000 (17:25 +0100)
Set xponder-type for all ports of xponder to be able to distinguish
service-type 100GEs from 100GEm (and not only on network ports).

JIRA: TRNSPRTPCE-499
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: I71391133ca3659fa8b3b316cafb34a8bac6a0040

common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion221.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion710.java
tests/transportpce_tests/7.1/test01_portmapping.py

index 39521f172e27c22db6fe272ab8684530ad9892c5..1f1c0853dfc719811372c06de509e830b9fcc874 100644 (file)
@@ -962,7 +962,7 @@ public class PortMappingVersion221 {
                     PortMappingUtils.createXpdrLogicalConnectionPort(xponderNb, client, StringConstants.CLIENT_TOKEN);
                 lcpMap.put(circuitPackName + '+' + port.getPortName(), lcp0);
                 mappingMap.put(lcp0,
-                    createXpdrMappingObject(nodeId, port, circuitPackName, lcp0, null, null, null, null));
+                    createXpdrMappingObject(nodeId, port, circuitPackName, lcp0, null, null, null, xponderType));
                 client++;
                 break;
 
index cfed29e9ce41ca0d6f5f87d9a2e4b9d6802a0d14..134840ddaceb8cd24e48b656e78467a37fd807c1 100644 (file)
@@ -1163,7 +1163,7 @@ public class PortMappingVersion710 {
                     PortMappingUtils.createXpdrLogicalConnectionPort(xponderNb, client, StringConstants.CLIENT_TOKEN);
                 lcpMap.put(circuitPackName + '+' + port.getPortName(), lcp0);
                 mappingMap.put(lcp0,
-                    createXpdrMappingObject(nodeId, port, circuitPackName, lcp0, null, null, null, null));
+                    createXpdrMappingObject(nodeId, port, circuitPackName, lcp0, null, null, null, xponderType));
                 client++;
                 break;
 
index 34632ee2e1980cf637ed7d9224e9f2e9a253ded9..da909364f59760efe88f5e9876639a98697db488 100644 (file)
@@ -103,7 +103,8 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
              'logical-connection-point': 'XPDR1-CLIENT1', 'port-direction': 'bidirectional',
              'connection-map-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client',
              'lcp-hash-val': 'AODABTVSOHH0',
-             'port-admin-state': 'InService', 'port-oper-state': 'InService'},
+             'port-admin-state': 'InService', 'port-oper-state': 'InService',
+             'xponder-type': 'tpdr'},
             res['mapping'])
 
     # Check the port-mapping for the switch-client and switch-network port-quals
@@ -142,6 +143,7 @@ class TransportPCE400GPortMappingTesting(unittest.TestCase):
         self.assertEqual('AK+Cna4EclRH', res['mapping'][0]['lcp-hash-val'])
         self.assertEqual('InService', res['mapping'][0]['port-admin-state'])
         self.assertEqual('InService', res['mapping'][0]['port-oper-state'])
+        self.assertEqual('mpdr', res['mapping'][0]['xponder-type'])
         self.assertEqual({
             "min-trib-slot": "1.1",
             "max-trib-slot": "1.20"