Add missing ODUFlex interface 96/99196/4
authorBalagangadhar Bathula <bb4341@att.com>
Wed, 5 Jan 2022 22:59:07 +0000 (17:59 -0500)
committerBalagangadhar Bathula <bb4341@att.com>
Fri, 14 Jan 2022 12:45:13 +0000 (07:45 -0500)
- 400G device renderer is missing ODUFlex interface
  creation.
- Add functional test to verify creation of ODUFlex
  interface.

JIRA: TRNSPRTPCE-582

Change-Id: Ia428e72a3320a83bfd887c9d9973a33e90699ef3
Signed-off-by: Balagangadhar Bathula <bb4341@att.com>
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterfaceFactory.java
tests/transportpce_tests/hybrid/test02_B100G_end2end.py

index 91e22ac37ff10f77eb247ec17cb995bad3aea3c0..5a72621590acddfd69774e9e95d5029bfb0e199b 100644 (file)
@@ -131,7 +131,11 @@ public class OpenRoadmInterfaceFactory {
                 return openRoadmInterface221.createOpenRoadmOdu4HOInterface(nodeId, logicalConnPoint, isCTP,
                     apiInfoA, apiInfoZ, payloadType);
             case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
-                return openRoadmInterface710.createOpenRoadmOducnInterface(nodeId, logicalConnPoint);
+                // Here ODUCn and ODUflex are combined
+                String interfaceNameOduc4 = openRoadmInterface710.createOpenRoadmOducnInterface(nodeId,
+                    logicalConnPoint);
+                return openRoadmInterface710.createOpenRoadmOduflexInterface(nodeId, logicalConnPoint,
+                    interfaceNameOduc4);
             default:
                 return null;
         }
index aa49014e03a459d7edf7a4e5b4e373968eeb76df..aabe50b0ac9c62bd2ae31c99baa5370266be35ef 100644 (file)
@@ -1137,6 +1137,7 @@ class TransportPCEtesting(unittest.TestCase):
 
 # test service-create for 400GE service from xpdra2 to xpdrc2
 
+
     def test_72_create_400GE_service(self):
         self.cr_serv_sample_data["input"]["service-name"] = "service-400GE"
         self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "400"
@@ -1240,7 +1241,7 @@ class TransportPCEtesting(unittest.TestCase):
                 self.assertEqual(freq_map_array[95], 0, "Index 1 should not be available")
         time.sleep(3)
 
-    def test_78_check_interface_100GE_CLIENT_xpdra2(self):
+    def test_78_check_interface_400GE_CLIENT_xpdra2(self):
         response = test_utils.check_netconf_node_request(
             "XPDR-A2", "interface/XPDR1-CLIENT1-ETHERNET")
         self.assertEqual(response.status_code, requests.codes.ok)
@@ -1362,6 +1363,60 @@ class TransportPCEtesting(unittest.TestCase):
                              res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
         self.assertEqual('XPDR1-NETWORK1-OTUC4', res['interface'][0]['supporting-interface-list'][0])
 
+    def test_82a_check_interface_ODUFLEX_xpdra2(self):
+        response = test_utils.check_netconf_node_request(
+            "XPDR-A2", "interface/XPDR1-NETWORK1-ODUFLEX")
+        self.assertEqual(response.status_code, requests.codes.ok)
+        res = response.json()
+        input_dict_1 = {'name': 'XPDR1-NETWORK1-ODUFLEX',
+                        'administrative-state': 'inService',
+                        'supporting-circuit-pack-name': '1/1/2-PLUG-NET',
+                        ['supporting-interface-list'][0]: 'XPDR1-NETWORK1-ODUC4',
+                        'type': 'org-openroadm-interfaces:otnOdu',
+                        'supporting-port': 'L1',
+                        'circuit-id': 'TBD',
+                        'description': 'TBD'}
+        input_dict_2 = {"odu-function": "org-openroadm-otn-common-types:ODU-TTP-CTP",
+                        "tim-detect-mode": "Disabled",
+                        "degm-intervals": 2,
+                        "degthr-percentage": 100,
+                        "monitoring-mode": "terminated",
+                        "rate": "org-openroadm-otn-common-types:ODUflex-cbr",
+                        "oduflex-cbr-service": "org-openroadm-otn-common-types:ODUflex-cbr-400G"
+                        }
+        input_dict_3 = {"exp-payload-type": "32", "payload-type": "32"}
+        input_dict_4 = {'trib-port-number': 1}
+
+        self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
+                             res['interface'][0])
+        self.assertDictEqual(dict(input_dict_2,
+                                  **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
+                             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
+        self.assertDictEqual(dict(input_dict_3,
+                                  **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu']),
+                             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
+        self.assertDictEqual(dict(input_dict_4,
+                                  **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'][
+                                      'parent-odu-allocation']),
+                             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation'])
+        self.assertIn('1.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertIn('1.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertIn('2.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertIn('2.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertIn('3.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertIn('3.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertIn('4.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertIn('4.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+                      ['opucn-trib-slots'])
+        self.assertEqual('XPDR1-NETWORK1-ODUC4', res['interface'][0]['supporting-interface-list'][0])
+
     def test_83_delete_400GE_service(self):
         response = test_utils.service_delete_request("service-400GE")
         self.assertEqual(response.status_code, requests.codes.ok)