+ "hop-number": "1",
+ "hop-type": {
+ "node-id": "OpenROADM-3"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ response = requests.request(
+ "POST", url, data=json.dumps(body), headers=test_utils.TYPE_APPLICATION_JSON,
+ auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
+ self.assertEqual(response.status_code, requests.codes.ok)
+ res = response.json()
+ self.assertEqual(res['output']['configuration-response-common'][
+ 'response-code'], '200')
+ self.assertEqual(res['output']['configuration-response-common'][
+ 'response-message'],
+ 'Path is calculated by GNPy')
+ self.assertEqual(res['output']['gnpy-response'][0]['path-dir'],
+ 'A-to-Z')
+ self.assertEqual(res['output']['gnpy-response'][0]['feasibility'], True)
+ self.assertEqual(res['output']['gnpy-response'][1]['path-dir'],
+ 'Z-to-A')
+ self.assertEqual(res['output']['gnpy-response'][1]['feasibility'], True)
+ time.sleep(5)
+
+ # Not found path by PCE and GNPy cannot find another one
+ def test_07_path_computation_FoundByPCE_NotFeasibleByGnpy(self):
+ url = ("{}/operations/transportpce-pce:path-computation-request"
+ .format(test_utils.RESTCONF_BASE_URL))
+ body = {
+ "input": {
+ "service-name": "service-4",
+ "resource-reserve": "true",
+ "pce-metric": "hop-count",
+ "service-handler-header": {
+ "request-id": "request-4"
+ },
+ "service-a-end": {
+ "node-id": "XPONDER-1",
+ "service-rate": "100",
+ "service-format": "Ethernet",
+ "clli": "Node1"
+ },
+ "service-z-end": {
+ "node-id": "XPONDER-4",
+ "service-rate": "100",
+ "service-format": "Ethernet",
+ "clli": "Node5"
+ },
+ "hard-constraints": {
+ "include_": {
+ "ordered-hops": [
+ {
+ "hop-number": "0",
+ "hop-type": {
+ "node-id": "OpenROADM-2"
+ }
+ },
+ {
+ "hop-number": "1",