Set port states in portMapping
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test_otn_renderer.py
index ee670fd140c9216f5a08d1a4d98f5d0ccc7f1847..8c2cec49f57ca0f3cb9e40ae5dde2aea61024491 100644 (file)
@@ -29,6 +29,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     @classmethod
     def tearDownClass(cls):
+        # pylint: disable=not-an-iterable
         for process in cls.processes:
             test_utils.shutdown_process(process)
         print("all processes killed")
@@ -58,6 +59,8 @@ class TransportPCEtesting(unittest.TestCase):
         self.assertEqual('bidirectional', res_mapping['port-direction'])
         self.assertEqual('xpdr-client', res_mapping['port-qual'])
         self.assertEqual('FqlcrxV7p3g=', res_mapping['lcp-hash-val'])
+        self.assertEqual('InService', res_mapping['port-admin-state'])
+        self.assertEqual('InService', res_mapping['port-oper-state'])
         self.assertIn('org-openroadm-port-types:if-10GE-ODU2e', res_mapping['supported-interface-capability'])
         self.assertIn('org-openroadm-port-types:if-10GE-ODU2', res_mapping['supported-interface-capability'])
         self.assertIn('org-openroadm-port-types:if-10GE', res_mapping['supported-interface-capability'])
@@ -76,12 +79,16 @@ class TransportPCEtesting(unittest.TestCase):
                 "port-qual": "xpdr-network",
                 "supporting-circuit-pack-name": "CP1-CFP0",
                 "xponder-type": "mpdr",
-             'lcp-hash-val': 'Swfw02qXGyI='},
-            res['mapping'])
+             'lcp-hash-val': 'Swfw02qXGyI=',
+             'port-admin-state': 'InService',
+             'port-oper-state': 'InService'},
+           res['mapping'])
 
     def test_04_service_path_create_OCH_OTU4(self):
         response = test_utils.service_path_request("create", "service_OCH_OTU4", "1",
-                                                   [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}])
+                                                   [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}],
+                                                   196.1, 40, 196.075, 196.125, 761,
+                                                    768)
         time.sleep(3)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
@@ -90,7 +97,7 @@ class TransportPCEtesting(unittest.TestCase):
         self.assertIn(
             {'node-id': 'SPDR-SA1',
              'otu-interface-id': ['XPDR1-NETWORK1-OTU'],
-             'och-interface-id': ['XPDR1-NETWORK1-1']}, res["output"]['node-interface'])
+             'och-interface-id': ['XPDR1-NETWORK1-761:768']}, res["output"]['node-interface'])
 
     def test_05_get_portmapping_NETWORK1(self):
         response = test_utils.portmapping_request("SPDR-SA1/mapping/XPDR1-NETWORK1")
@@ -106,15 +113,17 @@ class TransportPCEtesting(unittest.TestCase):
                 "port-qual": "xpdr-network",
                 "supporting-circuit-pack-name": "CP1-CFP0",
                 "xponder-type": "mpdr",
-                "lcp-hash-val": "Swfw02qXGyI="},
+                "lcp-hash-val": "Swfw02qXGyI=",
+                "port-admin-state": "InService",
+                "port-oper-state": "InService"},
             res['mapping'])
 
     def test_06_check_interface_och(self):
-        response = test_utils.check_netconf_node_request("SPDR-SA1", "interface/XPDR1-NETWORK1-1")
+        response = test_utils.check_netconf_node_request("SPDR-SA1", "interface/XPDR1-NETWORK1-761:768")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
 
-        self.assertDictEqual(dict(res['interface'][0], **{'name': 'XPDR1-NETWORK1-1',
+        self.assertDictEqual(dict(res['interface'][0], **{'name': 'XPDR1-NETWORK1-761:768',
                                                           'administrative-state': 'inService',
                                                           'supporting-circuit-pack-name': 'CP1-CFP0',
                                                           'type': 'org-openroadm-interfaces:opticalChannel',
@@ -134,7 +143,7 @@ class TransportPCEtesting(unittest.TestCase):
         input_dict_1 = {'name': 'XPDR1-NETWORK1-OTU',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP1-CFP0',
-                        'supporting-interface': 'XPDR1-NETWORK1-1',
+                        'supporting-interface': 'XPDR1-NETWORK1-761:768',
                         'type': 'org-openroadm-interfaces:otnOtu',
                         'supporting-port': 'CP1-CFP0-P1'
                         }
@@ -180,7 +189,9 @@ class TransportPCEtesting(unittest.TestCase):
                 "supporting-circuit-pack-name": "CP1-CFP0",
                 "xponder-type": "mpdr",
                 "supporting-odu4": "XPDR1-NETWORK1-ODU4",
-                "lcp-hash-val": "Swfw02qXGyI="
+                "lcp-hash-val": "Swfw02qXGyI=",
+                "port-admin-state": "InService",
+                "port-oper-state": "InService"
              },
             res['mapping'])
 
@@ -364,7 +375,9 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_23_service_path_delete_OCH_OTU4(self):
         response = test_utils.service_path_request("delete", "service_OCH_OTU4", "1",
-                                                   [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}])
+                                                   [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}],
+                                                   196.1, 40, 196.075, 196.125, 761,
+                                                    768)
         time.sleep(3)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()