rationalize service creation vars in E2E functests 27/91627/3
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 24 Jul 2020 12:17:41 +0000 (14:17 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Tue, 11 Aug 2020 07:30:39 +0000 (07:30 +0000)
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Id904afaee15d1375dd806555fdc431e2092f6ae6

tests/transportpce_tests/1.2.1/test_end2end.py
tests/transportpce_tests/2.2.1/test_end2end.py

index ebacc286857167fb1263a397070f8e01d5640732..abba02530dc5c8b31b85d0613065daafea20359e 100644 (file)
@@ -19,9 +19,105 @@ from common import test_utils
 
 class TransportPCEFulltesting(unittest.TestCase):
 
-    WAITING = 20  # nominal value is 300
-
+    cr_serv_sample_data = { "input": {
+                "sdnc-request-header": {
+                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
+                    "rpc-action": "service-create",
+                    "request-system-id": "appname",
+                    "notification-url":
+                        "http://localhost:8585/NotificationServer/notify"
+                },
+                "service-name": "service1",
+                "common-id": "ASATT1234567",
+                "connection-type": "service",
+                "service-a-end": {
+                    "service-rate": "100",
+                    "node-id": "XPDRA01",
+                    "service-format": "Ethernet",
+                    "clli": "SNJSCAMCJP8",
+                    "tx-direction": {
+                        "port": {
+                            "port-device-name":
+                                "ROUTER_SNJSCAMCJP8_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name":
+                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
+                            "lgx-port-name": "LGX Back.3",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "rx-direction": {
+                        "port": {
+                            "port-device-name":
+                                "ROUTER_SNJSCAMCJP8_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name":
+                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
+                            "lgx-port-name": "LGX Back.4",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "optic-type": "gray"
+                },
+                "service-z-end": {
+                    "service-rate": "100",
+                    "node-id": "XPDRC01",
+                    "service-format": "Ethernet",
+                    "clli": "SNJSCAMCJT4",
+                    "tx-direction": {
+                        "port": {
+                            "port-device-name":
+                                "ROUTER_SNJSCAMCJT4_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name":
+                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
+                            "lgx-port-name": "LGX Back.29",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "rx-direction": {
+                        "port": {
+                            "port-device-name":
+                                "ROUTER_SNJSCAMCJT4_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name":
+                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
+                            "lgx-port-name": "LGX Back.30",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "optic-type": "gray"
+                },
+                "due-date": "2016-11-28T00:00:01Z",
+                "operator-contact": "pw1234"
+            }
+        }
     processes = None
+    WAITING = 20
 
     @classmethod
     def setUpClass(cls):
@@ -138,105 +234,8 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     # test service-create for Eth service from xpdr to xpdr
     def test_11_create_eth_service1(self):
-        data = {
-            "input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url":
-                        "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service1",
-                "common-id": "ASATT1234567",
-                "connection-type": "service",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDRA01",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDRC01",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-            }
-        }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service1"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -401,105 +400,8 @@ class TransportPCEFulltesting(unittest.TestCase):
         time.sleep(2)
 
     def test_22_create_eth_service2(self):
-        data = {
-            "input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url":
-                        "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service2",
-                "common-id": "ASATT1234567",
-                "connection-type": "service",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDRA01",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDRC01",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-            }
-        }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service2"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -628,105 +530,8 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     #     creation service test on a non-available resource
     def test_28_create_eth_service3(self):
-        data = {
-            "input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url":
-                        "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service3",
-                "common-id": "ASATT1234567",
-                "connection-type": "service",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDRA01",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDRC01",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-            }
-        }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service3"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -887,105 +692,13 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     # test service-create for Optical Channel (OC) service from srg-pp to srg-pp
     def test_36_create_oc_service1(self):
-        data = {
-            "input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url":
-                        "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service1",
-                "common-id": "ASATT1234567",
-                "connection-type": "roadm-line",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADMA01",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADMC01",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-            }
-        }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service1"
+        self.cr_serv_sample_data["input"]["connection-type"] = "roadm-line"
+        self.cr_serv_sample_data["input"]["service-a-end"]["node-id"] = "ROADMA01"
+        self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "OC"
+        self.cr_serv_sample_data["input"]["service-z-end"]["node-id"] = "ROADMC01"
+        self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "OC"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -1053,105 +766,13 @@ class TransportPCEFulltesting(unittest.TestCase):
         time.sleep(7)
 
     def test_40_create_oc_service2(self):
-        data = {
-            "input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url":
-                        "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service2",
-                "common-id": "ASATT1234567",
-                "connection-type": "roadm-line",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADMA01",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADMC01",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name":
-                                "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name":
-                                "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-            }
-        }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service2"
+        self.cr_serv_sample_data["input"]["connection-type"] = "roadm-line"
+        self.cr_serv_sample_data["input"]["service-a-end"]["node-id"] = "ROADMA01"
+        self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "OC"
+        self.cr_serv_sample_data["input"]["service-z-end"]["node-id"] = "ROADMC01"
+        self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "OC"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
index 6b86cfdd71cd8f4afa74988e0e7acdcd16e01797..26ef9df946998e32f8990d7013a07c5f775512bc 100644 (file)
@@ -19,6 +19,95 @@ from common import test_utils
 class TransportPCEFulltesting(unittest.TestCase):
 
     processes = None
+    cr_serv_sample_data = {"input": {
+                "sdnc-request-header": {
+                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
+                    "rpc-action": "service-create",
+                    "request-system-id": "appname",
+                    "notification-url": "http://localhost:8585/NotificationServer/notify"
+                },
+                "service-name": "service1",
+                "common-id": "ASATT1234567",
+                "connection-type": "service",
+                "service-a-end": {
+                    "service-rate": "100",
+                    "node-id": "XPDR-A1",
+                    "service-format": "Ethernet",
+                    "clli": "SNJSCAMCJP8",
+                    "tx-direction": {
+                        "port": {
+                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
+                            "lgx-port-name": "LGX Back.3",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "rx-direction": {
+                        "port": {
+                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
+                            "lgx-port-name": "LGX Back.4",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "optic-type": "gray"
+                },
+                "service-z-end": {
+                    "service-rate": "100",
+                    "node-id": "XPDR-C1",
+                    "service-format": "Ethernet",
+                    "clli": "SNJSCAMCJT4",
+                    "tx-direction": {
+                        "port": {
+                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
+                            "lgx-port-name": "LGX Back.29",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "rx-direction": {
+                        "port": {
+                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
+                            "port-type": "router",
+                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
+                            "port-rack": "000000.00",
+                            "port-shelf": "00"
+                        },
+                        "lgx": {
+                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
+                            "lgx-port-name": "LGX Back.30",
+                            "lgx-port-rack": "000000.00",
+                            "lgx-port-shelf": "00"
+                        }
+                    },
+                    "optic-type": "gray"
+                },
+                "due-date": "2016-11-28T00:00:01Z",
+                "operator-contact": "pw1234"
+                }
+                }
+
     WAITING = 20  # nominal value is 300
 
     @classmethod
@@ -115,95 +204,8 @@ class TransportPCEFulltesting(unittest.TestCase):
 
 # test service-create for Eth service from xpdr to xpdr
     def test_11_create_eth_service1(self):
-        data = {"input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url": "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service1",
-                "common-id": "ASATT1234567",
-                "connection-type": "service",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDR-A1",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDR-C1",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-                }
-                }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service1"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -345,99 +347,12 @@ class TransportPCEFulltesting(unittest.TestCase):
                                                           "ROADM-C1", "1", "SRG1-PP2-TXRX")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
-        time.sleep(2)
-
-    def test_22_create_eth_service2(self):
-        data = {"input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url": "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service2",
-                "common-id": "ASATT1234567",
-                "connection-type": "service",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDR-A1",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDR-C1",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-                }
-                }
-        response = test_utils.service_create_request(data)
+        self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
+        time.sleep(2)
+
+    def test_22_create_eth_service2(self):
+        self.cr_serv_sample_data["input"]["service-name"] = "service2"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -549,95 +464,8 @@ class TransportPCEFulltesting(unittest.TestCase):
 
 #     creation service test on a non-available resource
     def test_28_create_eth_service3(self):
-        data = {"input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url": "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service3",
-                "common-id": "ASATT1234567",
-                "connection-type": "service",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDR-A1",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "XPDR-C1",
-                    "service-format": "Ethernet",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-                }
-                }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service3"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -769,95 +597,13 @@ class TransportPCEFulltesting(unittest.TestCase):
 
 # test service-create for Optical Channel (OC) service from srg-pp to srg-pp
     def test_36_create_oc_service1(self):
-        data = {"input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url": "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service1",
-                "common-id": "ASATT1234567",
-                "connection-type": "roadm-line",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADM-A1",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADM-C1",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-                }
-                }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service1"
+        self.cr_serv_sample_data["input"]["connection-type"] = "roadm-line"
+        self.cr_serv_sample_data["input"]["service-a-end"]["node-id"] = "ROADM-A1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "OC"
+        self.cr_serv_sample_data["input"]["service-z-end"]["node-id"] = "ROADM-C1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "OC"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -922,95 +668,13 @@ class TransportPCEFulltesting(unittest.TestCase):
         time.sleep(7)
 
     def test_40_create_oc_service2(self):
-        data = {"input": {
-                "sdnc-request-header": {
-                    "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
-                    "rpc-action": "service-create",
-                    "request-system-id": "appname",
-                    "notification-url": "http://localhost:8585/NotificationServer/notify"
-                },
-                "service-name": "service2",
-                "common-id": "ASATT1234567",
-                "connection-type": "roadm-line",
-                "service-a-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADM-A1",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJP8",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.3",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJP8_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-5/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJP8_000000.00_00",
-                            "lgx-port-name": "LGX Back.4",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "service-z-end": {
-                    "service-rate": "100",
-                    "node-id": "ROADM-C1",
-                    "service-format": "OC",
-                    "clli": "SNJSCAMCJT4",
-                    "tx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Tx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.29",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "rx-direction": {
-                        "port": {
-                            "port-device-name": "ROUTER_SNJSCAMCJT4_000000.00_00",
-                            "port-type": "router",
-                            "port-name": "Gigabit Ethernet_Rx.ge-1/0/0.0",
-                            "port-rack": "000000.00",
-                            "port-shelf": "00"
-                        },
-                        "lgx": {
-                            "lgx-device-name": "LGX Panel_SNJSCAMCJT4_000000.00_00",
-                            "lgx-port-name": "LGX Back.30",
-                            "lgx-port-rack": "000000.00",
-                            "lgx-port-shelf": "00"
-                        }
-                    },
-                    "optic-type": "gray"
-                },
-                "due-date": "2016-11-28T00:00:01Z",
-                "operator-contact": "pw1234"
-                }
-                }
-        response = test_utils.service_create_request(data)
+        self.cr_serv_sample_data["input"]["service-name"] = "service2"
+        self.cr_serv_sample_data["input"]["connection-type"] = "roadm-line"
+        self.cr_serv_sample_data["input"]["service-a-end"]["node-id"] = "ROADM-A1"
+        self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "OC"
+        self.cr_serv_sample_data["input"]["service-z-end"]["node-id"] = "ROADM-C1"
+        self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "OC"
+        response = test_utils.service_create_request(self.cr_serv_sample_data)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',