# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
import unittest
-import json
import os
import sys
import time
@classmethod
def setUpClass(cls):
+ # pylint: disable=bare-except
try:
sample_files_parsed = False
TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
@classmethod
def tearDownClass(cls):
+ # pylint: disable=not-an-iterable
for process in cls.processes:
test_utils.shutdown_process(process)
print("all processes killed")
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"})
+ {"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',
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"})
+ {"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',
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"})
+ {"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',
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"})
+ {"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',
for i in range(0, 15):
atoz = res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]
ztoa = res['output']['response-parameters']['path-description']['zToA-direction']['zToA'][i]
- if (atoz['id'] == '14'):
+ if atoz['id'] == '14':
self.assertEqual(atoz['resource']['tp-id'], 'SRG1-PP1-TX')
- if (ztoa['id'] == '0'):
+ if ztoa['id'] == '0':
self.assertEqual(ztoa['resource']['tp-id'], 'SRG1-PP1-RX')
time.sleep(5)
# Test1 success path computation
def test_18_success1_path_computation(self):
response = test_utils.path_computation_request("request1", "service1",
- {"service-format": "Ethernet", "service-rate": "100", "clli": "ORANGE2", "node-id": "XPONDER-2-2",
+ {"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-slot": "Some port-slot",
"port-sub-slot": "Some port-sub-slot"
}}},
- {"service-format": "Ethernet", "service-rate": "100", "clli": "ORANGE1", "node-id": "XPONDER-1-2",
+ {"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-sub-slot": "Some port-sub-slot"
}}},
{"customer-code": ["Some customer-code"],
- "co-routing": {"existing-service": ["Some existing-service"]}},
+ "co-routing": {"existing-service": ["Some existing-service"]}
+ },
{"customer-code": ["Some customer-code"],
- "co-routing": {"existing-service": ["Some existing-service"]}},
+ "co-routing": {"existing-service": ["Some existing-service"]}
+ },
"hop-count", {"locally-protected-links": "true"})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
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"})
+ {"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',
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"})
+ {"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',
link = {"link-id": "OpenROADM-1-3-DEG2-to-OpenROADM-1-2-DEG2"}
find = False
for i in range(0, nbElmPath):
- resource_i = res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]['resource']
- if(resource_i == link):
+ resource_i = (res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]
+ ['resource'])
+ if resource_i == link:
find = True
self.assertEqual(find, True)
time.sleep(5)
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"})
+ {"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',
link = {"link-id": "OpenROADM-1-3-DEG2-to-OpenROADM-1-2-DEG2"}
find = False
for i in range(0, nbElmPath):
- resource_i = res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]['resource']
- if (resource_i == link):
+ resource_i = (res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]
+ ['resource'])
+ if resource_i == link:
find = True
self.assertNotEqual(find, True)
time.sleep(5)