Drop the service name from ODU connection name
[transportpce.git] / tests / transportpce_tests / hybrid / test02_B100G_end2end.py
index 70d21dafdb0b02e450e0f27b2d1da11dd7ae7a06..51dc2e60ba2bc940f6d203f8c191461ee3afc16d 100644 (file)
@@ -48,13 +48,7 @@ class TransportPCEtesting(unittest.TestCase):
             "service-format": "OTU",
             "otu-service-rate": "org-openroadm-otn-common-types:OTUCn",
             "clli": "NodeSA",
-            "subrate-eth-sla": {
-                    "subrate-eth-sla": {
-                        "committed-info-rate": "100000",
-                        "committed-burst-size": "64"
-                    }
-            },
-            "tx-direction": {
+            "tx-direction": [{
                 "port": {
                     "port-device-name": "XPDR-A2-XPDR2",
                     "port-type": "fixed",
@@ -67,9 +61,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": "XPDR-A2-XPDR2",
                     "port-type": "fixed",
@@ -82,8 +77,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": {
@@ -92,13 +88,7 @@ class TransportPCEtesting(unittest.TestCase):
             "service-format": "OTU",
             "otu-service-rate": "org-openroadm-otn-common-types:OTUCn",
             "clli": "NodeSC",
-            "subrate-eth-sla": {
-                    "subrate-eth-sla": {
-                        "committed-info-rate": "100000",
-                        "committed-burst-size": "64"
-                    }
-            },
-            "tx-direction": {
+            "tx-direction": [{
                 "port": {
                     "port-device-name": "XPDR-C2-XPDR2",
                     "port-type": "fixed",
@@ -111,9 +101,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": "XPDR-C2-XPDR2",
                     "port-type": "fixed",
@@ -126,8 +117,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",
@@ -609,13 +601,13 @@ class TransportPCEtesting(unittest.TestCase):
         self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "100"
         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"] = "XPDR2-CLIENT1"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR2-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT1"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "100"
         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"] = "XPDR2-CLIENT1"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR2-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT1"
         response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
@@ -657,10 +649,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_32_check_interface_ODU4_CLIENT_xpdra2(self):
         response = test_utils.check_netconf_node_request(
-            "XPDR-A2", "interface/XPDR2-CLIENT1-ODU4-service-100GE")
+            "XPDR-A2", "interface/XPDR2-CLIENT1-ODU4")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR2-CLIENT1-ODU4-service-100GE',
+        input_dict_1 = {'name': 'XPDR2-CLIENT1-ODU4',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': '1/2/1/1-PLUG-CLIENT',
                         'supporting-interface-list': 'XPDR2-CLIENT1-ETHERNET-100G',
@@ -682,10 +674,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_33_check_interface_ODU4_NETWORK_xpdra2(self):
         response = test_utils.check_netconf_node_request(
-            "XPDR-A2", "interface/XPDR2-NETWORK1-ODU4-service-100GE")
+            "XPDR-A2", "interface/XPDR2-NETWORK1-ODU4")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR2-NETWORK1-ODU4-service-100GE',
+        input_dict_1 = {'name': 'XPDR2-NETWORK1-ODU4',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': '1/2/2-PLUG-NET',
                         'supporting-interface-list': 'XPDR2-NETWORK1-ODUC4',
@@ -714,20 +706,20 @@ class TransportPCEtesting(unittest.TestCase):
     def test_34_check_ODU4_connection_xpdra2(self):
         response = test_utils.check_netconf_node_request(
             "XPDR-A2",
-            "odu-connection/XPDR2-CLIENT1-ODU4-service-100GE-x-XPDR2-NETWORK1-ODU4-service-100GE")
+            "odu-connection/XPDR2-CLIENT1-ODU4-x-XPDR2-NETWORK1-ODU4")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         input_dict_1 = {
             'connection-name':
-            'XPDR2-CLIENT1-ODU4-service-100GE-x-XPDR2-NETWORK1-ODU4-service-100GE',
+            'XPDR2-CLIENT1-ODU4-x-XPDR2-NETWORK1-ODU4',
             'direction': 'bidirectional'
         }
 
         self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
                              res['odu-connection'][0])
-        self.assertDictEqual({'dst-if': 'XPDR2-NETWORK1-ODU4-service-100GE'},
+        self.assertDictEqual({'dst-if': 'XPDR2-NETWORK1-ODU4'},
                              res['odu-connection'][0]['destination'])
-        self.assertDictEqual({'src-if': 'XPDR2-CLIENT1-ODU4-service-100GE'},
+        self.assertDictEqual({'src-if': 'XPDR2-CLIENT1-ODU4'},
                              res['odu-connection'][0]['source'])
 
     def test_35_check_interface_100GE_CLIENT_xpdrc2(self):
@@ -749,10 +741,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_36_check_interface_ODU4_CLIENT_xpdrc2(self):
         response = test_utils.check_netconf_node_request(
-            "XPDR-C2", "interface/XPDR2-CLIENT1-ODU4-service-100GE")
+            "XPDR-C2", "interface/XPDR2-CLIENT1-ODU4")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR2-CLIENT1-ODU4-service-100GE',
+        input_dict_1 = {'name': 'XPDR2-CLIENT1-ODU4',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': '1/2/1/1-PLUG-CLIENT',
                         'supporting-interface-list': 'XPDR2-CLIENT1-ETHERNET-100G',
@@ -774,10 +766,10 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_37_check_interface_ODU4_NETWORK_xpdrc2(self):
         response = test_utils.check_netconf_node_request(
-            "XPDR-C2", "interface/XPDR2-NETWORK1-ODU4-service-100GE")
+            "XPDR-C2", "interface/XPDR2-NETWORK1-ODU4")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        input_dict_1 = {'name': 'XPDR2-NETWORK1-ODU4-service-100GE',
+        input_dict_1 = {'name': 'XPDR2-NETWORK1-ODU4',
                         'administrative-state': 'inService',
                         'supporting-circuit-pack-name': '1/2/2-PLUG-NET',
                         'supporting-interface-list': 'XPDR2-NETWORK1-ODUC4',
@@ -812,20 +804,20 @@ class TransportPCEtesting(unittest.TestCase):
     def test_38_check_ODU4_connection_xpdrc2(self):
         response = test_utils.check_netconf_node_request(
             "XPDR-C2",
-            "odu-connection/XPDR2-CLIENT1-ODU4-service-100GE-x-XPDR2-NETWORK1-ODU4-service-100GE")
+            "odu-connection/XPDR2-CLIENT1-ODU4-x-XPDR2-NETWORK1-ODU4")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         input_dict_1 = {
             'connection-name':
-            'XPDR2-CLIENT1-ODU4-service-100GE-x-XPDR2-NETWORK1-ODU4-service-100GE',
+            'XPDR2-CLIENT1-ODU4-x-XPDR2-NETWORK1-ODU4',
             'direction': 'bidirectional'
         }
 
         self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
                              res['odu-connection'][0])
-        self.assertDictEqual({'dst-if': 'XPDR2-NETWORK1-ODU4-service-100GE'},
+        self.assertDictEqual({'dst-if': 'XPDR2-NETWORK1-ODU4'},
                              res['odu-connection'][0]['destination'])
-        self.assertDictEqual({'src-if': 'XPDR2-CLIENT1-ODU4-service-100GE'},
+        self.assertDictEqual({'src-if': 'XPDR2-CLIENT1-ODU4'},
                              res['odu-connection'][0]['source'])
 
     def test_39_check_otn_topo_links(self):
@@ -867,12 +859,12 @@ class TransportPCEtesting(unittest.TestCase):
         self.cr_serv_sample_data["input"]["connection-type"] = "service"
         self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "100"
         self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "Ethernet"
-        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR2-CLIENT2"
-        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR2-CLIENT2"
+        self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT2"
+        self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT2"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "100"
         self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "Ethernet"
-        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR2-CLIENT2"
-        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR2-CLIENT2"
+        self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT2"
+        self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR2-CLIENT2"
         response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
@@ -967,12 +959,12 @@ class TransportPCEtesting(unittest.TestCase):
 
     def test_50_check_no_interface_ODU4_NETWORK_xpdra2(self):
         response = test_utils.check_netconf_node_request(
-            "XPDR-A2", "interface/XPDR2-NETWORK1-ODU4-service-100GE")
+            "XPDR-A2", "interface/XPDR2-NETWORK1-ODU4")
         self.assertEqual(response.status_code, requests.codes.conflict)
 
     def test_51_check_no_interface_ODU4_CLIENT_xpdra2(self):
         response = test_utils.check_netconf_node_request(
-            "XPDR-A2", "interface/XPDR2-CLIENT1-ODU4-service-100GE")
+            "XPDR-A2", "interface/XPDR2-CLIENT1-ODU4")
         self.assertEqual(response.status_code, requests.codes.conflict)
 
     def test_52_check_no_interface_100GE_CLIENT_xpdra2(self):
@@ -1141,15 +1133,17 @@ class TransportPCEtesting(unittest.TestCase):
     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"
+        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"] = "400"
-        del self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"]
-        del self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"]
-        del self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"]
-        del self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-device-name"]
-        del self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"]
-        del self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-device-name"]
-        del self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"]
-        del self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-device-name"]
+        del self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"]
+        del self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-device-name"]
+        del self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"]
+        del self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-device-name"]
+        del self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"]
+        del self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-device-name"]
+        del self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"]
+        del self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-device-name"]
         response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()