# Path computed by PCE is feasible according to Gnpy
def test_04_path_computation_FeasibleWithPCE(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {
- "input": {
- "service-name": "service-1",
- "resource-reserve": "true",
- "pce-metric": "hop-count",
- "service-handler-header": {
- "request-id": "request-1"
- },
- "service-a-end": {
- "node-id": "XPONDER-1",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "Node1"
- },
- "service-z-end": {
- "node-id": "XPONDER-5",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "Node5"
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request-1", "service-1",
+ {"node-id": "XPONDER-1", "service-rate": "100", "service-format": "Ethernet", "clli": "Node1"},
+ {"node-id": "XPONDER-5", "service-rate": "100", "service-format": "Ethernet", "clli": "Node5"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(res['output']['configuration-response-common'][
# Path computed by PCE is not feasible by GNPy and GNPy cannot find
# another one (low SNR)
def test_05_path_computation_FoundByPCE_NotFeasibleByGnpy(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {
- "input": {
- "service-name": "service-2",
- "resource-reserve": "true",
- "pce-metric": "hop-count",
- "service-handler-header": {
- "request-id": "request-2"
- },
- "service-a-end": {
- "node-id": "XPONDER-1",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "Node1"
- },
- "service-z-end": {
- "node-id": "XPONDER-5",
- "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",
- "hop-type": {
- "node-id": "OpenROADM-3"
- }
- },
- {
- "hop-number": "2",
- "hop-type": {
- "node-id": "OpenROADM-4"
- }
- }
- ]
- }
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request-2", "service-2",
+ {"node-id": "XPONDER-1", "service-rate": "100", "service-format": "Ethernet", "clli": "Node1"},
+ {"node-id": "XPONDER-5", "service-rate": "100", "service-format": "Ethernet", "clli": "Node5"},
+ {"include_": { "ordered-hops": [
+ {"hop-number": "0", "hop-type": {"node-id": "OpenROADM-2"}},
+ {"hop-number": "1", "hop-type": {"node-id": "OpenROADM-3"}},
+ {"hop-number": "2", "hop-type": {"node-id": "OpenROADM-4"}}]}})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(res['output']['configuration-response-common'][
# #PCE cannot find a path while GNPy finds a feasible one
def test_06_path_computation_NotFoundByPCE_FoundByGNPy(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {
- "input": {
- "service-name": "service-3",
- "resource-reserve": "true",
- "pce-metric": "hop-count",
- "service-handler-header": {
- "request-id": "request-3"
- },
- "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",
- "hop-type": {
- "node-id": "OpenROADM-3"
- }
- }
- ]
- }
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request-3", "service-3",
+ {"node-id": "XPONDER-1", "service-rate": "100", "service-format": "Ethernet", "clli": "Node1"},
+ {"node-id": "XPONDER-4", "service-rate": "100", "service-format": "Ethernet", "clli": "Node5"},
+ {"include_": {"ordered-hops": [
+ {"hop-number": "0", "hop-type": {"node-id": "OpenROADM-2"}},
+ {"hop-number": "1", "hop-type": {"node-id": "OpenROADM-3"}}]}})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(res['output']['configuration-response-common'][
# 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"
- data = {
- "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",
- "hop-type": {
- "node-id": "OpenROADM-3"
- }
- },
- {
- "hop-number": "2",
- "hop-type": {
- "node-id": "OpenROADM-4"
- }
- },
- {
- "hop-number": "3",
- "hop-type": {
- "node-id": "OpenROADM-3"
- }
- }
- ]
- }
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request-4", "service-4",
+ {"node-id": "XPONDER-1", "service-rate": "100", "service-format": "Ethernet", "clli": "Node1"},
+ {"node-id": "XPONDER-4", "service-rate": "100", "service-format": "Ethernet", "clli": "Node5"},
+ {"include_": {"ordered-hops": [
+ {"hop-number": "0","hop-type": {"node-id": "OpenROADM-2"}},
+ {"hop-number": "1","hop-type": {"node-id": "OpenROADM-3"}},
+ {"hop-number": "2","hop-type": {"node-id": "OpenROADM-4"}},
+ {"hop-number": "3","hop-type": {"node-id": "OpenROADM-3"}}]}})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(res['output']['configuration-response-common'][
# Path Computation success
def test_04_path_computation_xpdr_bi(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service-1",
- "resource-reserve": "true",
- "pce-metric": "hop-count",
- "service-handler-header": {
- "request-id": "request-1"
- },
- "service-a-end": {
- "node-id": "XPDRA01",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "nodeA"
- },
- "service-z-end": {
- "node-id": "XPDRC01",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "nodeC"
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request-1", "service-1",
+ {"node-id": "XPDRA01", "service-rate": "100", "service-format": "Ethernet", "clli": "nodeA"},
+ {"node-id": "XPDRC01", "service-rate": "100", "service-format": "Ethernet", "clli": "nodeC"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Path Computation success
def test_05_path_computation_rdm_bi(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service-1",
- "resource-reserve": "true",
- "pce-metric": "hop-count",
- "service-handler-header": {
- "request-id": "request-1"
- },
- "service-a-end": {
- "node-id": "ROADMA01",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "NodeA"
- },
- "service-z-end": {
- "node-id": "ROADMC01",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "NodeC"
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request-1", "service-1",
+ {"node-id": "ROADMA01", "service-rate": "100", "service-format": "Ethernet", "clli": "NodeA"},
+ {"node-id": "ROADMC01", "service-rate": "100", "service-format": "Ethernet", "clli": "NodeC"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Path Computation success
def test_11_path_computation_xpdr_uni(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service-1",
- "resource-reserve": "true",
- "pce-metric": "hop-count",
- "service-handler-header": {
- "request-id": "request-1"
- },
- "service-a-end": {
- "node-id": "XPONDER-1-2",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "ORANGE1"
- },
- "service-z-end": {
- "node-id": "XPONDER-3-2",
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "ORANGE3"
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request-1", "service-1",
+ {"node-id": "XPONDER-1-2", "service-rate": "100", "service-format": "Ethernet", "clli": "ORANGE1"},
+ {"node-id": "XPONDER-3-2", "service-rate": "100", "service-format": "Ethernet", "clli": "ORANGE3"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Path Computation success
def test_12_path_computation_rdm_uni(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service1",
- "resource-reserve": "true",
- "service-handler-header": {
- "request-id": "request1"
- },
- "service-a-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "cll21",
- "node-id": "OpenROADM-2-1"
- },
- "service-z-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "clli": "ncli22",
- "node-id": "OpenROADM-2-2"
- },
- "pce-metric": "hop-count"
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request1", "service1",
+ {"service-rate": "100", "service-format": "Ethernet", "clli": "cll21", "node-id": "OpenROADM-2-1"},
+ {"service-rate": "100", "service-format": "Ethernet", "clli": "ncli22", "node-id": "OpenROADM-2-2"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Test failed path computation
def test_17_fail_path_computation(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-handler-header": {
- "request-id": "request-1"
- }
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.post_request(test_utils.URL_PATH_COMPUTATION_REQUEST,
+ {"input": { "service-handler-header": { "request-id": "request-1" }}})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Service Name is not set',
# Test1 success path computation
def test_18_success1_path_computation(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service1",
- "resource-reserve": "true",
- "service-handler-header": {
- "request-id": "request1"
- },
- "service-a-end": {
- "service-format": "Ethernet",
- "service-rate": "100",
- "clli": "ORANGE2",
- "node-id": "XPONDER-2-2",
- "tx-direction": {
- "port": {
+ response = test_utils.path_computation_request("request1", "service1",
+ {"service-format": "Ethernet","service-rate": "100", "clli": "ORANGE2", "node-id": "XPONDER-2-2",
+ "tx-direction": {"port": {
"port-device-name": "Some port-device-name",
"port-type": "Some port-type",
"port-name": "Some port-name",
"port-shelf": "Some port-shelf",
"port-slot": "Some port-slot",
"port-sub-slot": "Some port-sub-slot"
- }
- },
- "rx-direction": {
- "port": {
+ }},
+ "rx-direction": {"port": {
"port-device-name": "Some port-device-name",
"port-type": "Some port-type",
"port-name": "Some port-name",
"port-shelf": "Some port-shelf",
"port-slot": "Some port-slot",
"port-sub-slot": "Some port-sub-slot"
- }
- }
- },
- "service-z-end": {
- "service-format": "Ethernet",
- "service-rate": "100",
- "clli": "ORANGE1",
- "node-id": "XPONDER-1-2",
- "tx-direction": {
- "port": {
+ }}},
+ {"service-format": "Ethernet", "service-rate": "100", "clli": "ORANGE1", "node-id": "XPONDER-1-2",
+ "tx-direction": {"port": {
"port-device-name": "Some port-device-name",
"port-type": "Some port-type",
"port-name": "Some port-name",
"port-shelf": "Some port-shelf",
"port-slot": "Some port-slot",
"port-sub-slot": "Some port-sub-slot"
- }
- },
- "rx-direction": {
- "port": {
+ }},
+ "rx-direction": {"port": {
"port-device-name": "Some port-device-name",
"port-type": "Some port-type",
"port-name": "Some port-name",
"port-shelf": "Some port-shelf",
"port-slot": "Some port-slot",
"port-sub-slot": "Some port-sub-slot"
- }
- }
- },
- "hard-constraints": {
- "customer-code": [
- "Some customer-code"
- ],
- "co-routing": {
- "existing-service": [
- "Some existing-service"
- ]
- }
- },
- "soft-constraints": {
- "customer-code": [
- "Some customer-code"
- ],
- "co-routing": {
- "existing-service": [
- "Some existing-service"
- ]
- }
- },
- "pce-metric": "hop-count",
- "locally-protected-links": "true"
- }
- }
- response = test_utils.post_request(url, data)
+ }}},
+ {"customer-code": ["Some customer-code"], "co-routing": {"existing-service": ["Some existing-service"]}},
+ {"customer-code": ["Some customer-code"], "co-routing": {"existing-service": ["Some existing-service"]}},
+ "hop-count", {"locally-protected-links": "true"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Test2 success path computation with path description
def test_19_success2_path_computation(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service 1",
- "resource-reserve": "true",
- "service-handler-header": {
- "request-id": "request 1"
- },
- "service-a-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-1-2",
- "clli": "ORANGE1"
- },
- "service-z-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-3-2",
- "clli": "ORANGE3"
- },
- "pce-metric": "hop-count"
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request 1", "service 1",
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-1-2", "clli": "ORANGE1"},
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-3-2", "clli": "ORANGE3"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Test3 success path computation with hard-constraints exclude
def test_20_success3_path_computation(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service 1",
- "resource-reserve": "true",
- "service-handler-header": {
- "request-id": "request 1"
- },
- "service-a-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-1-2",
- "clli": "ORANGE1"
- },
- "service-z-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-3-2",
- "clli": "ORANGE3"
- },
- "hard-constraints": {
- "exclude_": {
- "node-id": ["OpenROADM-2-1", "OpenROADM-2-2"]
- }
- },
- "pce-metric": "hop-count"
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request 1", "service 1",
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-1-2", "clli": "ORANGE1"},
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-3-2", "clli": "ORANGE3"},
+ {"exclude_": { "node-id": ["OpenROADM-2-1", "OpenROADM-2-2"] }})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Path computation before deleting oms-attribute of the link :openroadm1-3 to openroadm1-2
def test_21_path_computation_before_oms_attribute_deletion(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service 1",
- "resource-reserve": "true",
- "service-handler-header": {
- "request-id": "request 1"
- },
- "service-a-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-2-2",
- "clli": "ORANGE2"
- },
- "service-z-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-1-2",
- "clli": "ORANGE1"
- },
- "pce-metric": "hop-count"
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request 1", "service 1",
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-2-2", "clli": "ORANGE2"},
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-1-2", "clli": "ORANGE1"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',
# Path computation after deleting oms-attribute of the link :openroadm1-3 to openroadm1-2
def test_23_path_computation_after_oms_attribute_deletion(self):
- url = "{}/operations/transportpce-pce:path-computation-request"
- data = {"input": {
- "service-name": "service 1",
- "resource-reserve": "true",
- "service-handler-header": {
- "request-id": "request 1"
- },
- "service-a-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-2-2",
- "clli": "ORANGE2"
- },
- "service-z-end": {
- "service-rate": "100",
- "service-format": "Ethernet",
- "node-id": "XPONDER-1-2",
- "clli": "ORANGE1"
- },
- "pce-metric": "hop-count"
- }
- }
- response = test_utils.post_request(url, data)
+ response = test_utils.path_computation_request("request 1", "service 1",
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-2-2", "clli": "ORANGE2"},
+ {"service-rate": "100", "service-format": "Ethernet", "node-id": "XPONDER-1-2", "clli": "ORANGE1"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn('Path is calculated',