Replace tpce-topology yang by existing ordmodels
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test11_otn_end2end.py
index 9d6bcd84b6efe67fdd52275c87977655d6246d57..feb95046dfd3509c7a32d5885f741852fbcdcf99 100644 (file)
@@ -46,13 +46,7 @@ class TransportPCEtesting(unittest.TestCase):
             "service-format": "OTU",
             "otu-service-rate": "org-openroadm-otn-common-types:OTU4",
             "clli": "NodeSA",
-            "subrate-eth-sla": {
-                    "subrate-eth-sla": {
-                        "committed-info-rate": "100000",
-                        "committed-burst-size": "64"
-                    }
-            },
-            "tx-direction": {
+            "tx-direction": [{
                 "port": {
                     "port-device-name": "SPDR-SA1-XPDR1",
                     "port-type": "fixed",
@@ -65,9 +59,10 @@ class TransportPCEtesting(unittest.TestCase):
                     "lgx-port-name": "Some lgx-port-name",
                     "lgx-port-rack": "000000.00",
                     "lgx-port-shelf": "00"
-                }
-            },
-            "rx-direction": {
+                },
+                "index": 0
+            }],
+            "rx-direction": [{
                 "port": {
                     "port-device-name": "SPDR-SA1-XPDR1",
                     "port-type": "fixed",
@@ -80,8 +75,9 @@ class TransportPCEtesting(unittest.TestCase):
                     "lgx-port-name": "Some lgx-port-name",
                     "lgx-port-rack": "000000.00",
                     "lgx-port-shelf": "00"
-                }
-            },
+                },
+                "index": 0
+            }],
             "optic-type": "gray"
         },
         "service-z-end": {
@@ -90,13 +86,7 @@ class TransportPCEtesting(unittest.TestCase):
             "service-format": "OTU",
             "otu-service-rate": "org-openroadm-otn-common-types:OTU4",
             "clli": "NodeSC",
-            "subrate-eth-sla": {
-                    "subrate-eth-sla": {
-                        "committed-info-rate": "100000",
-                        "committed-burst-size": "64"
-                    }
-            },
-            "tx-direction": {
+            "tx-direction": [{
                 "port": {
                     "port-device-name": "SPDR-SC1-XPDR1",
                     "port-type": "fixed",
@@ -109,9 +99,10 @@ class TransportPCEtesting(unittest.TestCase):
                     "lgx-port-name": "Some lgx-port-name",
                     "lgx-port-rack": "000000.00",
                     "lgx-port-shelf": "00"
-                }
-            },
-            "rx-direction": {
+                },
+                "index": 0
+            }],
+            "rx-direction": [{
                 "port": {
                     "port-device-name": "SPDR-SC1-XPDR1",
                     "port-type": "fixed",
@@ -124,8 +115,9 @@ class TransportPCEtesting(unittest.TestCase):
                     "lgx-port-name": "Some lgx-port-name",
                     "lgx-port-rack": "000000.00",
                     "lgx-port-shelf": "00"
-                }
-            },
+                },
+                "index": 0
+            }],
             "optic-type": "gray"
         },
         "due-date": "2018-06-15T00:00:01Z",
@@ -302,8 +294,10 @@ class TransportPCEtesting(unittest.TestCase):
                         'type': 'org-openroadm-interfaces:otnOtu',
                         'supporting-port': 'CP1-CFP0-P1'
                         }
-        input_dict_2 = {'tx-sapi': 'Swfw02qXGyI=',
-                        'expected-dapi': 'Swfw02qXGyI=',
+        input_dict_2 = {'tx-sapi': 'H/OelLynehI=',
+                        'expected-dapi': 'H/OelLynehI=',
+                        'tx-dapi': 'AMf1n5hK6Xkk',
+                        'expected-sapi': 'AMf1n5hK6Xkk',
                         'rate': 'org-openroadm-otn-common-types:OTU4',
                         'fec': 'scfec'
                         }
@@ -344,10 +338,10 @@ class TransportPCEtesting(unittest.TestCase):
                         'type': 'org-openroadm-interfaces:otnOtu',
                         'supporting-port': 'CP1-CFP0-P1'
                         }
-        input_dict_2 = {'tx-dapi': 'Swfw02qXGyI=',
-                        'expected-sapi': 'Swfw02qXGyI=',
-                        'tx-sapi': 'fuYZwEO660g=',
-                        'expected-dapi': 'fuYZwEO660g=',
+        input_dict_2 = {'tx-dapi': 'H/OelLynehI=',
+                        'expected-sapi': 'H/OelLynehI=',
+                        'tx-sapi': 'AMf1n5hK6Xkk',
+                        'expected-dapi': 'AMf1n5hK6Xkk',
                         'rate': 'org-openroadm-otn-common-types:OTU4',
                         'fec': 'scfec'
                         }
@@ -432,7 +426,7 @@ class TransportPCEtesting(unittest.TestCase):
         for link in res['network'][0]['ietf-network-topology:link']:
             self.assertIn(link['link-id'], listLinkId)
             self.assertEqual(
-                link['transportpce-topology:otn-link-type'], 'OTU4')
+                link['transportpce-networkutils:otn-link-type'], 'OTU4')
             self.assertEqual(
                 link['org-openroadm-common-network:link-type'], 'OTN-LINK')
             self.assertEqual(
@@ -484,14 +478,17 @@ class TransportPCEtesting(unittest.TestCase):
                         'supporting-circuit-pack-name': 'CP1-CFP0',
                         'supporting-interface': 'XPDR1-NETWORK1-OTU',
                         'type': 'org-openroadm-interfaces:otnOdu',
-                        'supporting-port': 'CP1-CFP0-P1'}
+                        'supporting-port': 'CP1-CFP0-P1',
+                        'circuit-id': 'TBD',
+                        'description': 'TBD'}
         # SAPI/DAPI are added in the Otu4 renderer
         input_dict_2 = {'odu-function': 'org-openroadm-otn-common-types:ODU-TTP',
                         'rate': 'org-openroadm-otn-common-types:ODU4',
-                        'expected-dapi': 'Swfw02qXGyI=',
-                        'expected-sapi': 'fuYZwEO660g=',
-                        'tx-dapi': 'fuYZwEO660g=',
-                        'tx-sapi': 'Swfw02qXGyI='}
+                        'monitoring-mode': 'terminated',
+                        'expected-dapi': 'H/OelLynehI=',
+                        'expected-sapi': 'AMf1n5hK6Xkk',
+                        'tx-dapi': 'AMf1n5hK6Xkk',
+                        'tx-sapi': 'H/OelLynehI='}
 
         self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
                              res['interface'][0])
@@ -513,14 +510,17 @@ class TransportPCEtesting(unittest.TestCase):
                         'supporting-circuit-pack-name': 'CP1-CFP0',
                         'supporting-interface': 'XPDR1-NETWORK1-OTU',
                         'type': 'org-openroadm-interfaces:otnOdu',
-                        'supporting-port': 'CP1-CFP0-P1'}
+                        'supporting-port': 'CP1-CFP0-P1',
+                        'circuit-id': 'TBD',
+                        'description': 'TBD'}
         # SAPI/DAPI are added in the Otu4 renderer
         input_dict_2 = {'odu-function': 'org-openroadm-otn-common-types:ODU-TTP',
                         'rate': 'org-openroadm-otn-common-types:ODU4',
-                        'tx-sapi': 'fuYZwEO660g=',
-                        'tx-dapi': 'Swfw02qXGyI=',
-                        'expected-sapi': 'Swfw02qXGyI=',
-                        'expected-dapi': 'fuYZwEO660g='
+                        'monitoring-mode': 'terminated',
+                        'tx-sapi': 'AMf1n5hK6Xkk',
+                        'tx-dapi': 'H/OelLynehI=',
+                        'expected-sapi': 'H/OelLynehI=',
+                        'expected-dapi': 'AMf1n5hK6Xkk'
                         }
         self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
                              res['interface'][0])
@@ -553,7 +553,7 @@ class TransportPCEtesting(unittest.TestCase):
                 self.assertEqual(
                     link['org-openroadm-otn-network-topology:used-bandwidth'], 0)
                 self.assertEqual(
-                    link['transportpce-topology:otn-link-type'], 'ODTU4')
+                    link['transportpce-networkutils:otn-link-type'], 'ODTU4')
                 self.assertEqual(
                     link['org-openroadm-common-network:link-type'], 'OTN-LINK')
                 self.assertIn(link['org-openroadm-common-network:opposite-link'],
@@ -566,7 +566,7 @@ class TransportPCEtesting(unittest.TestCase):
         response = test_utils.get_otn_topo_request()
         res = response.json()
         for node in res['network'][0]['node']:
-            if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
+            if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
                 tpList = node['ietf-network-topology:termination-point']
                 for tp in tpList:
                     if tp['tp-id'] == 'XPDR1-NETWORK1':
@@ -584,13 +584,15 @@ class TransportPCEtesting(unittest.TestCase):
         self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "10"
         self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "Ethernet"
         del self.cr_serv_sample_data["input"]["service-a-end"]["odu-service-rate"]
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["ethernet-encoding"] = "10GBASE-R"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "10"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "Ethernet"
         del self.cr_serv_sample_data["input"]["service-z-end"]["odu-service-rate"]
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["ethernet-encoding"] = "10GBASE-R"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
         response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
@@ -632,10 +634,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_32_check_interface_ODU2E_CLIENT_spdra(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SA1", "interface/XPDR1-CLIENT1-ODU2e-service1-10GE")
+            "SPDR-SA1", "interface/XPDR1-CLIENT1-ODU2e")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e-service1-10GE',
+        input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP1-SFP4',
                         'supporting-interface': 'XPDR1-CLIENT1-ETHERNET10G',
@@ -657,10 +659,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_33_check_interface_ODU2E_NETWORK_spdra(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SA1", "interface/XPDR1-NETWORK1-ODU2e-service1-10GE")
+            "SPDR-SA1", "interface/XPDR1-NETWORK1-ODU2e")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e-service1-10GE',
+        input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP1-CFP0',
                         'supporting-interface': 'XPDR1-NETWORK1-ODU4',
@@ -687,20 +689,20 @@ class TransportPCEtesting(unittest.TestCase):
     def test_34_check_ODU2E_connection_spdra(self):
         response = test_utils.check_netconf_node_request(
             "SPDR-SA1",
-            "odu-connection/XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE")
+            "odu-connection/XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         input_dict_1 = {
             'connection-name':
-            'XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE',
+            'XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e',
             'direction': 'bidirectional'
         }
 
         self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
                              res['odu-connection'][0])
-        self.assertDictEqual({'dst-if': 'XPDR1-NETWORK1-ODU2e-service1-10GE'},
+        self.assertDictEqual({'dst-if': 'XPDR1-NETWORK1-ODU2e'},
                              res['odu-connection'][0]['destination'])
-        self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e-service1-10GE'},
+        self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e'},
                              res['odu-connection'][0]['source'])
 
     def test_35_check_interface_10GE_CLIENT_spdrc(self):
@@ -722,10 +724,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_36_check_interface_ODU2E_CLIENT_spdrc(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SC1", "interface/XPDR1-CLIENT1-ODU2e-service1-10GE")
+            "SPDR-SC1", "interface/XPDR1-CLIENT1-ODU2e")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e-service1-10GE',
+        input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP1-SFP4',
                         'supporting-interface': 'XPDR1-CLIENT1-ETHERNET10G',
@@ -747,10 +749,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_37_check_interface_ODU2E_NETWORK_spdrc(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SC1", "interface/XPDR1-NETWORK1-ODU2e-service1-10GE")
+            "SPDR-SC1", "interface/XPDR1-NETWORK1-ODU2e")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e-service1-10GE',
+        input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP1-CFP0',
                         'supporting-interface': 'XPDR1-NETWORK1-ODU4',
@@ -781,20 +783,20 @@ class TransportPCEtesting(unittest.TestCase):
     def test_38_check_ODU2E_connection_spdrc(self):
         response = test_utils.check_netconf_node_request(
             "SPDR-SC1",
-            "odu-connection/XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE")
+            "odu-connection/XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         input_dict_1 = {
             'connection-name':
-            'XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE',
+            'XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e',
             'direction': 'bidirectional'
         }
 
         self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
                              res['odu-connection'][0])
-        self.assertDictEqual({'dst-if': 'XPDR1-NETWORK1-ODU2e-service1-10GE'},
+        self.assertDictEqual({'dst-if': 'XPDR1-NETWORK1-ODU2e'},
                              res['odu-connection'][0]['destination'])
-        self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e-service1-10GE'},
+        self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e'},
                              res['odu-connection'][0]['source'])
 
     def test_39_check_otn_topo_links(self):
@@ -816,7 +818,7 @@ class TransportPCEtesting(unittest.TestCase):
         response = test_utils.get_otn_topo_request()
         res = response.json()
         for node in res['network'][0]['node']:
-            if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
+            if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
                 tpList = node['ietf-network-topology:termination-point']
                 for tp in tpList:
                     if tp['tp-id'] == 'XPDR1-NETWORK1':
@@ -886,7 +888,7 @@ class TransportPCEtesting(unittest.TestCase):
         response = test_utils.get_otn_topo_request()
         res = response.json()
         for node in res['network'][0]['node']:
-            if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
+            if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
                 tpList = node['ietf-network-topology:termination-point']
                 for tp in tpList:
                     if tp['tp-id'] == 'XPDR1-NETWORK1':
@@ -922,7 +924,7 @@ class TransportPCEtesting(unittest.TestCase):
         response = test_utils.get_otn_topo_request()
         res = response.json()
         for node in res['network'][0]['node']:
-            if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
+            if node['node-id'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
                 tpList = node['ietf-network-topology:termination-point']
                 for tp in tpList:
                     if tp['tp-id'] == 'XPDR1-NETWORK1':
@@ -1056,17 +1058,17 @@ class TransportPCEtesting(unittest.TestCase):
         self.cr_serv_sample_data["input"]["connection-type"] = "infrastructure"
         self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "100"
         self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "OTU"
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
         self.cr_serv_sample_data["input"]["service-a-end"]["otu-service-rate"] = "org-openroadm-otn-common-types:OTU4"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "100"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "OTU"
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
         self.cr_serv_sample_data["input"]["service-z-end"]["otu-service-rate"] = "org-openroadm-otn-common-types:OTU4"
         response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
@@ -1094,18 +1096,18 @@ class TransportPCEtesting(unittest.TestCase):
         # pylint: disable=line-too-long
         self.cr_serv_sample_data["input"]["service-name"] = "service2-ODU4"
         self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "ODU"
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
         self.cr_serv_sample_data["input"]["service-a-end"]["odu-service-rate"] = "org-openroadm-otn-common-types:ODU4"
         del self.cr_serv_sample_data["input"]["service-a-end"]["otu-service-rate"]
         self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "ODU"
         self.cr_serv_sample_data["input"]["service-z-end"]["odu-service-rate"] = "org-openroadm-otn-common-types:ODU4"
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
         del self.cr_serv_sample_data["input"]["service-z-end"]["otu-service-rate"]
 
         response = test_utils.service_create_request(self.cr_serv_sample_data)
@@ -1139,15 +1141,15 @@ class TransportPCEtesting(unittest.TestCase):
         self.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "1"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "Ethernet"
         del self.cr_serv_sample_data["input"]["service-a-end"]["odu-service-rate"]
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
         del self.cr_serv_sample_data["input"]["service-z-end"]["odu-service-rate"]
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
         response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
@@ -1188,10 +1190,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_73_check_interface_ODU0_CLIENT_spdra(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SA1", "interface/XPDR3-CLIENT1-ODU0-service1-1GE")
+            "SPDR-SA1", "interface/XPDR3-CLIENT1-ODU0")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0-service1-1GE',
+        input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP3-SFP1',
                         'supporting-interface': 'XPDR3-CLIENT1-ETHERNET1G',
@@ -1213,10 +1215,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_74_check_interface_ODU0_NETWORK_spdra(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SA1", "interface/XPDR3-NETWORK1-ODU0-service1-1GE")
+            "SPDR-SA1", "interface/XPDR3-NETWORK1-ODU0")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0-service1-1GE',
+        input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP3-CFP0',
                         'supporting-interface': 'XPDR3-NETWORK1-ODU4',
@@ -1243,20 +1245,20 @@ class TransportPCEtesting(unittest.TestCase):
     def test_75_check_ODU0_connection_spdra(self):
         response = test_utils.check_netconf_node_request(
             "SPDR-SA1",
-            "odu-connection/XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE")
+            "odu-connection/XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         input_dict_1 = {
             'connection-name':
-            'XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE',
+            'XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0',
             'direction': 'bidirectional'
         }
 
         self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
                              res['odu-connection'][0])
-        self.assertDictEqual({'dst-if': 'XPDR3-NETWORK1-ODU0-service1-1GE'},
+        self.assertDictEqual({'dst-if': 'XPDR3-NETWORK1-ODU0'},
                              res['odu-connection'][0]['destination'])
-        self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0-service1-1GE'},
+        self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0'},
                              res['odu-connection'][0]['source'])
 
     def test_76_check_interface_1GE_CLIENT_spdrc(self):
@@ -1278,10 +1280,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_77_check_interface_ODU0_CLIENT_spdrc(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SC1", "interface/XPDR3-CLIENT1-ODU0-service1-1GE")
+            "SPDR-SC1", "interface/XPDR3-CLIENT1-ODU0")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0-service1-1GE',
+        input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP3-SFP1',
                         'supporting-interface': 'XPDR3-CLIENT1-ETHERNET1G',
@@ -1303,10 +1305,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_78_check_interface_ODU0_NETWORK_spdrc(self):
         response = test_utils.check_netconf_node_request(
-            "SPDR-SC1", "interface/XPDR3-NETWORK1-ODU0-service1-1GE")
+            "SPDR-SC1", "interface/XPDR3-NETWORK1-ODU0")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0-service1-1GE',
+        input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': 'CP3-CFP0',
                         'supporting-interface': 'XPDR3-NETWORK1-ODU4',
@@ -1337,20 +1339,20 @@ class TransportPCEtesting(unittest.TestCase):
     def test_79_check_ODU0_connection_spdrc(self):
         response = test_utils.check_netconf_node_request(
             "SPDR-SC1",
-            "odu-connection/XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE")
+            "odu-connection/XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         input_dict_1 = {
             'connection-name':
-            'XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE',
+            'XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0',
             'direction': 'bidirectional'
         }
 
         self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
                              res['odu-connection'][0])
-        self.assertDictEqual({'dst-if': 'XPDR3-NETWORK1-ODU0-service1-1GE'},
+        self.assertDictEqual({'dst-if': 'XPDR3-NETWORK1-ODU0'},
                              res['odu-connection'][0]['destination'])
-        self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0-service1-1GE'},
+        self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0'},
                              res['odu-connection'][0]['source'])
 
     def test_80_check_otn_topo_links(self):
@@ -1372,7 +1374,7 @@ class TransportPCEtesting(unittest.TestCase):
         response = test_utils.get_otn_topo_request()
         res = response.json()
         for node in res['network'][0]['node']:
-            if node['node-id'] == 'SPDR-SA1-XPDR3' or node['node-id'] == 'SPDR-SC1-XPDR3':
+            if node['node-id'] in ('SPDR-SA1-XPDR3', 'SPDR-SC1-XPDR3'):
                 tpList = node['ietf-network-topology:termination-point']
                 for tp in tpList:
                     if tp['tp-id'] == 'XPDR3-NETWORK1':
@@ -1442,7 +1444,7 @@ class TransportPCEtesting(unittest.TestCase):
         response = test_utils.get_otn_topo_request()
         res = response.json()
         for node in res['network'][0]['node']:
-            if node['node-id'] == 'SPDR-SA1-XPDR3' or node['node-id'] == 'SPDR-SC1-XPDR3':
+            if node['node-id'] in ('SPDR-SA1-XPDR3', 'SPDR-SC1-XPDR3'):
                 tpList = node['ietf-network-topology:termination-point']
                 for tp in tpList:
                     if tp['tp-id'] == 'XPDR3-NETWORK1':
@@ -1474,8 +1476,7 @@ class TransportPCEtesting(unittest.TestCase):
         res = response.json()
         links = res['network'][0]['ietf-network-topology:link']
         for link in links:
-            if (link["org-openroadm-common-network:link-type"] == "XPONDER-OUTPUT" or
-                    link["org-openroadm-common-network:link-type"] == "XPONDER-INPUT"):
+            if link["org-openroadm-common-network:link-type"] in ('XPONDER-OUTPUT', 'XPONDER-INPUT'):
                 link_name = link["link-id"]
                 response = test_utils.delete_request(url+link_name)
                 self.assertEqual(response.status_code, requests.codes.ok)