import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils_rfc8040 # nopep8
print("all processes killed")
def setUp(self):
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(10)
import time
import unittest
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils_rfc8040 # nopep8
import time
import unittest
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
(check_list[linkType]).remove(linkId)
else:
self.assertFalse(True)
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
def test_05_getNodes_OpenRoadmTopology(self):
# pylint: disable=redundant-unittest-assert
(check_list[linkType]).remove(linkId)
else:
self.assertFalse(True)
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
def test_13_connect_ROADMC(self):
response = test_utils.mount_device("ROADMC01", ('roadmc', self.NODE_VERSION))
(check_list[linkType]).remove(linkId)
else:
self.assertFalse(True)
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
def test_19_getLinkOmsAttributesOpenRoadmTopology(self):
response = test_utils.get_ordm_topo_request("")
(check_list[linkType]).remove(linkId)
else:
roadmtoroadmLink += 1
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
self.assertEqual(roadmtoroadmLink, 6)
for i in range(0, nbLink):
self.assertNotEqual(res['network'][0]['ietf-network-topology:link'][i]
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
print("all processes killed")
def setUp(self):
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(10)
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
print("all processes killed")
def setUp(self):
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(1)
import time
import unittest
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
print("all processes killed")
def setUp(self): # instruction executed before each test method
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
# connect netconf devices
self.test_35_check_topo_ROADMA_DEG1()
def test_49_loop_create_eth_service(self):
+ # pylint: disable=consider-using-f-string
for i in range(1, 6):
print("iteration number {}".format(i))
print("eth service creation")
response = test_utils.service_delete_request("service1")
time.sleep(5)
+ # pylint: disable=consider-using-f-string
for i in range(1, 6):
print("iteration number {}".format(i))
print("oc service creation")
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils_rfc8040 # nopep8
print("all processes killed")
def setUp(self):
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(10)
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils_rfc8040 # nopep8
nbMappings = 0
for i in range(0, len(firstEntry)):
nodeId = firstEntry[i]['node-id']
+ # pylint: disable=consider-using-f-string
print("nodeId={}".format(nodeId))
nodeMapId = nodeId.split("-")[0] + "-" + nodeId.split("-")[1]
print("nodeMapId={}".format(nodeMapId))
import time
import logging
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
(check_list[linkType]).remove(linkId)
else:
self.assertFalse(True)
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
def test_05_getNodes_OpenRoadmTopology(self):
# pylint: disable=redundant-unittest-assert
(check_list[linkType]).remove(linkId)
else:
self.assertFalse(True)
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
def test_13_connect_ROADMC(self):
response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION))
(check_list[linkType]).remove(linkId)
else:
self.assertFalse(True)
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
def test_19_getLinkOmsAttributesOpenRoadmTopology(self):
response = test_utils.get_ordm_topo_request("")
(check_list[linkType]).remove(linkId)
else:
roadmtoroadmLink += 1
- for link_type in check_list:
- self.assertEqual(len(check_list[link_type]), 0)
+ for val in check_list.values():
+ self.assertEqual(len(val), 0)
self.assertEqual(roadmtoroadmLink, 6)
for i in range(0, nbLink):
self.assertNotEqual(res['network'][0]['ietf-network-topology:link'][i]
import time
import logging
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
tpId = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
if tpType == 'XPONDER-CLIENT':
client += 1
+ # pylint: disable=consider-using-f-string
print("tpId = {}".format(tpId))
print("tp= {}".format(res['network'][0]['node'][i]
['ietf-network-topology:termination-point'][j]))
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+# pylint: disable=no-member
+
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
@classmethod
def tearDownClass(cls):
+ # pylint: disable=not-an-iterable
for process in cls.processes:
test_utils.shutdown_process(process)
print("all processes killed")
def setUp(self):
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(10)
import unittest
# from unittest.result import failfast
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
print("all processes killed")
def setUp(self):
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(1)
# pylint: disable=unsupported-assignment-operation
import os
+# pylint: disable=wrong-import-order
import sys
import time
import unittest
import requests
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
def setUp(self): # instruction executed before each test method
if self.init_failed:
self.fail('Feature installation failed')
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
def test_01_get_tapi_topology_T100G(self):
def count_object_with_double_key(list_dicts, key1, key2, value):
nb = 0
- for dict in list_dicts:
- if dict[key1][0][key2] == value:
+ for dictio in list_dicts:
+ if dictio[key1][0][key2] == value:
nb += 1
return nb
# pylint: disable=no-member
# pylint: disable=too-many-public-methods
+# pylint: disable=too-many-lines
import base64
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1':
+ if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1':
+ if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if (node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1'):
+ if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1':
+ if node['node-id'] == 'SPDR-SA1-XPDR1' or node['node-id'] == 'SPDR-SC1-XPDR1':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
time.sleep(2)
def test_66_create_OCH_OTU4_service_2(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service2-OCH-OTU4"
self.cr_serv_sample_data["input"]["connection-type"] = "infrastructure"
self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "100"
time.sleep(2)
def test_68_create_ODU4_service_2(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service2-ODU4"
self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "ODU"
self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
time.sleep(2)
def test_70_create_1GE_service(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service1-1GE"
self.cr_serv_sample_data["input"]["connection-type"] = "service"
self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "1"
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'SPDR-SA1-XPDR3' or 'SPDR-SC1-XPDR3':
+ if node['node-id'] == 'SPDR-SA1-XPDR3' or node['node-id'] == 'SPDR-SC1-XPDR3':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR3-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if (node['node-id'] == 'SPDR-SA1-XPDR3' or 'SPDR-SC1-XPDR3'):
+ if node['node-id'] == 'SPDR-SA1-XPDR3' or node['node-id'] == 'SPDR-SC1-XPDR3':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR3-NETWORK1':
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
print("all processes killed")
def setUp(self): # instruction executed before each test method
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
def test_01_connect_xpdrA(self):
def test_49_loop_create_eth_service(self):
for i in range(1, 6):
+ # pylint: disable=consider-using-f-string
print("iteration number {}".format(i))
print("eth service creation")
self.test_11_create_eth_service1()
time.sleep(5)
for i in range(1, 6):
+ # pylint: disable=consider-using-f-string
print("iteration number {}".format(i))
print("oc service creation")
self.test_36_create_oc_service1()
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
@classmethod
def setUpClass(cls):
+ # pylint: disable=unsubscriptable-object
cls.init_failed = False
os.environ['JAVA_MIN_MEM'] = '1024M'
os.environ['JAVA_MAX_MEM'] = '4096M'
time.sleep(self.WAITING)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- global service_pm_uuid
- service_pm_uuid = res['output']['service']['uuid']
+ global SERVICE_PM_UUID
+ SERVICE_PM_UUID = res['output']['service']['uuid']
+ # pylint: disable=consider-using-f-string
print("photonic media service uuid : {}".format(res['output']['service']['uuid']))
input_dict_1 = {'administrative-state': 'LOCKED',
def test_16_get_service_PhotonicMedia(self):
response = test_utils.get_service_list_request(
- "services/" + str(service_pm_uuid))
+ "services/" + str(SERVICE_PM_UUID))
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(
res['services'][0]['administrative-state'], 'inService')
self.assertEqual(
- res['services'][0]['service-name'], service_pm_uuid)
+ res['services'][0]['service-name'], SERVICE_PM_UUID)
self.assertEqual(
res['services'][0]['connection-type'], 'infrastructure')
self.assertEqual(
# test create connectivity service from spdrA to spdrC for odu
def test_17_create_connectivity_service_ODU(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["end-point"][0]["layer-protocol-name"] = "ODU"
self.cr_serv_sample_data["input"]["end-point"][0]["service-interface-point"]["service-interface-point-uuid"] = "eecbfa6e-57ab-3651-9606-c22c8ce73f18"
self.cr_serv_sample_data["input"]["end-point"][1]["layer-protocol-name"] = "ODU"
time.sleep(self.WAITING)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- global service_odu_uuid
- service_odu_uuid = res['output']['service']['uuid']
+ global SERVICE_ODU_UUID
+ SERVICE_ODU_UUID = res['output']['service']['uuid']
+ # pylint: disable=consider-using-f-string
print("odu service uuid : {}".format(res['output']['service']['uuid']))
input_dict_1 = {'administrative-state': 'LOCKED',
def test_18_get_service_ODU(self):
response = test_utils.get_service_list_request(
- "services/" + str(service_odu_uuid))
+ "services/" + str(SERVICE_ODU_UUID))
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(
res['services'][0]['administrative-state'], 'inService')
self.assertEqual(
- res['services'][0]['service-name'], service_odu_uuid)
+ res['services'][0]['service-name'], SERVICE_ODU_UUID)
self.assertEqual(
res['services'][0]['connection-type'], 'infrastructure')
self.assertEqual(
# test create connectivity service from spdrA to spdrC for dsr
def test_19_create_connectivity_service_DSR(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["end-point"][0]["layer-protocol-name"] = "DSR"
self.cr_serv_sample_data["input"]["end-point"][0]["service-interface-point"]["service-interface-point-uuid"] = "c14797a0-adcc-3875-a1fe-df8949d1a2d7"
self.cr_serv_sample_data["input"]["end-point"][1]["layer-protocol-name"] = "DSR"
time.sleep(self.WAITING)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- global service_dsr_uuid
- service_dsr_uuid = res['output']['service']['uuid']
+ global SERVICE_DSR_UUID
+ SERVICE_DSR_UUID = res['output']['service']['uuid']
+ # pylint: disable=consider-using-f-string
print("dsr service uuid : {}".format(res['output']['service']['uuid']))
input_dict_1 = {'administrative-state': 'LOCKED',
def test_20_get_service_DSR(self):
response = test_utils.get_service_list_request(
- "services/" + str(service_dsr_uuid))
+ "services/" + str(SERVICE_DSR_UUID))
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(
res['services'][0]['administrative-state'], 'inService')
self.assertEqual(
- res['services'][0]['service-name'], service_dsr_uuid)
+ res['services'][0]['service-name'], SERVICE_DSR_UUID)
self.assertEqual(
res['services'][0]['connection-type'], 'service')
self.assertEqual(
res = response.json()
liste_service = res['output']['service']
for ele in liste_service:
- if ele['uuid'] == service_pm_uuid:
+ if ele['uuid'] == SERVICE_PM_UUID:
self.assertEqual(ele['operational-state'], 'ENABLED')
self.assertEqual(ele['service-layer'], 'PHOTONIC_MEDIA')
nbconnection = len(ele['connection'])
self.assertEqual(nbconnection, 9, 'There should be 9 connections')
- elif ele['uuid'] == service_odu_uuid:
+ elif ele['uuid'] == SERVICE_ODU_UUID:
self.assertEqual(ele['operational-state'], 'ENABLED')
self.assertEqual(ele['service-layer'], 'ODU')
nbconnection = len(ele['connection'])
self.assertEqual(nbconnection, 3, 'There should be 3 connections')
- elif ele['uuid'] == service_dsr_uuid:
+ elif ele['uuid'] == SERVICE_DSR_UUID:
self.assertEqual(ele['operational-state'], 'ENABLED')
self.assertEqual(ele['service-layer'], 'DSR')
nbconnection = len(ele['connection'])
time.sleep(2)
def test_22_delete_connectivity_service_DSR(self):
- response = test_utils.tapi_delete_connectivity_request(service_dsr_uuid)
+ response = test_utils.tapi_delete_connectivity_request(SERVICE_DSR_UUID)
self.assertEqual(response.status_code, requests.codes.no_content)
time.sleep(self.WAITING)
def test_23_delete_connectivity_service_ODU(self):
- response = test_utils.tapi_delete_connectivity_request(service_odu_uuid)
+ response = test_utils.tapi_delete_connectivity_request(SERVICE_ODU_UUID)
self.assertEqual(response.status_code, requests.codes.no_content)
time.sleep(self.WAITING)
def test_24_delete_connectivity_service_PhotonicMedia(self):
- response = test_utils.tapi_delete_connectivity_request(service_pm_uuid)
+ response = test_utils.tapi_delete_connectivity_request(SERVICE_PM_UUID)
self.assertEqual(response.status_code, requests.codes.no_content)
time.sleep(self.WAITING)
# pylint: disable=no-member
# pylint: disable=too-many-public-methods
+# pylint: disable=too-many-lines
import base64
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
# test service-create for OCH-OTU4 service from spdrB to spdrC
def test_35_create_OCH_OTU4_service_BC(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service-OCH-OTU4-BC"
self.cr_serv_sample_data["input"]["service-a-end"]["node-id"] = "SPDR-SB1"
self.cr_serv_sample_data["input"]["service-a-end"]["clli"] = "NodeSB"
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
liste_tp = res['node'][0]['ietf-network-topology:termination-point']
+ # pylint: disable=consider-using-f-string
for ele in liste_tp:
if ele['tp-id'] == 'XPDR2-NETWORK1':
self.assertEqual({'frequency': 196.1,
# test service-create for 100GE service from spdrA to spdrC via spdrB
def test_46_create_100GE_service_ABC(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service-100GE-ABC"
self.cr_serv_sample_data["input"]["connection-type"] = "service"
self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "Ethernet"
self.assertEqual(response.status_code, requests.codes.created)
def test_83_create_OCH_OTU4_service_AC(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service-OCH-OTU4-AC"
self.cr_serv_sample_data["input"]["connection-type"] = "infrastructure"
self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "100"
# test service-create for 100GE service from spdrA to spdrC via spdrB
def test_85_create_100GE_service_AC(self):
+ # pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["service-name"] = "service-100GE-AC"
self.cr_serv_sample_data["input"]["connection-type"] = "service"
self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "Ethernet"
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils_rfc8040 # nopep8
print("all processes killed")
def setUp(self):
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(10)
import json
import os
+# pylint: disable=wrong-import-order
import sys
import re
import signal
import psutil
import requests
+# pylint: disable=import-error
import simulators
SIMS = simulators.SIMS
executable = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"..", "..", "..", KARAF_INSTALLDIR, "target", "assembly", "bin", "karaf")
- with open('odl.log', 'w') as outfile:
+ with open('odl.log', 'w', encoding='utf-8') as outfile:
return subprocess.Popen(
["sh", executable, "server"], stdout=outfile, stderr=outfile, stdin=None)
os.path.dirname(os.path.realpath(__file__)),
"..", "..", "..", "lighty", "target", "tpce",
"clean-start-controller.sh")
- with open(TPCE_LOG, 'w') as outfile:
+ with open(TPCE_LOG, 'w', encoding='utf-8') as outfile:
return subprocess.Popen(
["sh", executable], stdout=outfile, stderr=outfile, stdin=None)
sample_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "openroadm", sim[1])
if os.path.isfile(executable):
- with open(log_file, 'w') as outfile:
+ with open(log_file, 'w', encoding='utf-8') as outfile:
return subprocess.Popen(
[executable, SIMS[sim]['port'], os.path.join(sample_directory, SIMS[sim]['configfile'])],
stdout=outfile, stderr=outfile)
with TimeOut(seconds=time_to_wait):
while not os.path.exists(log_file):
time.sleep(0.2)
- filelogs = open(log_file, 'r')
+ filelogs = open(log_file, 'r', encoding='utf-8')
filelogs.seek(0, 2)
filefound = True
print("Searching for pattern '" + regexp + "' in " + os.path.basename(log_file), end='... ', flush=True)
import json
import os
+# pylint: disable=wrong-import-order
import sys
import re
import signal
import psutil
import requests
+# pylint: disable=import-error
import simulators
SIMS = simulators.SIMS
executable = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"..", "..", "..", KARAF_INSTALLDIR, "target", "assembly", "bin", "karaf")
- with open('odl.log', 'w') as outfile:
+ with open('odl.log', 'w', encoding='utf-8') as outfile:
return subprocess.Popen(
["sh", executable, "server"], stdout=outfile, stderr=outfile, stdin=None)
os.path.dirname(os.path.realpath(__file__)),
"..", "..", "..", "lighty", "target", "tpce",
"clean-start-controller.sh")
- with open(TPCE_LOG, 'w') as outfile:
+ with open(TPCE_LOG, 'w', encoding='utf-8') as outfile:
return subprocess.Popen(
["sh", executable], stdout=outfile, stderr=outfile, stdin=None)
sample_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "openroadm", sim[1])
if os.path.isfile(executable):
- with open(log_file, 'w') as outfile:
+ with open(log_file, 'w', encoding='utf-8') as outfile:
return subprocess.Popen(
[executable, SIMS[sim]['port'], os.path.join(sample_directory, SIMS[sim]['configfile'])],
stdout=outfile, stderr=outfile)
with TimeOut(seconds=time_to_wait):
while not os.path.exists(log_file):
time.sleep(0.2)
- filelogs = open(log_file, 'r')
+ filelogs = open(log_file, 'r', encoding='utf-8')
filelogs.seek(0, 2)
filefound = True
print("Searching for pattern '" + regexp + "' in " + os.path.basename(log_file), end='... ', flush=True)
url = "{}/data/transportpce-portmapping:network/nodes={}/node-info"
response = get_request(url.format('{}', node))
res = response.json()
- key = u'transportpce-portmapping:node-info'
+ key = 'transportpce-portmapping:node-info'
if key in res.keys():
node_info = res[key]
else:
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
time.sleep(10)
def setUp(self): # instruction executed before each test method
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
def test_01_connect_xpdrA(self):
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+# pylint: disable=invalid-name
# pylint: disable=no-member
# pylint: disable=too-many-public-methods
+# pylint: disable=too-many-lines
import base64
import unittest
import time
import requests
+# pylint: disable=wrong-import-order
import sys
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'XPDR-A2-XPDR2' or 'XPDR-C2-XPDR2':
+ if node['node-id'] == 'XPDR-A2-XPDR2' or node['node-id'] == 'XPDR-C2-XPDR2':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR2-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'XPDR-A2-XPDR2' or 'XPDR-C2-XPDR2':
+ if node['node-id'] == 'XPDR-A2-XPDR2' or node['node-id'] == 'XPDR-C2-XPDR2':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR2-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'XPDR-A2-XPDR2' or 'XPDR-C2-XPDR2':
+ if node['node-id'] == 'XPDR-A2-XPDR2' or node['node-id'] == 'XPDR-C2-XPDR2':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR2-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if (node['node-id'] == 'XPDR-A2-XPDR2' or 'XPDR-C2-XPDR2'):
+ if node['node-id'] == 'XPDR-A2-XPDR2' or node['node-id'] == 'XPDR-C2-XPDR2':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR2-NETWORK1':
response = test_utils.get_otn_topo_request()
res = response.json()
for node in res['network'][0]['node']:
- if node['node-id'] == 'XPDR-A2-XPDR2' or 'XPDR-C2-XPDR2':
+ if node['node-id'] == 'XPDR-A2-XPDR2' or node['node-id'] == 'XPDR-C2-XPDR2':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR2-NETWORK1':
import unittest
import os
+# pylint: disable=wrong-import-order
import sys
import time
import requests
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
sample_files_parsed = False
TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "honeynode-topo.xml")
- with open(TOPO_BI_DIR_FILE, 'r') as topo_bi_dir:
+ with open(TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as topo_bi_dir:
cls.simple_topo_bi_dir_data = topo_bi_dir.read()
TOPO_UNI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "NW-simple-topology.xml")
- with open(TOPO_UNI_DIR_FILE, 'r') as topo_uni_dir:
+ with open(TOPO_UNI_DIR_FILE, 'r', encoding='utf-8') as topo_uni_dir:
cls.simple_topo_uni_dir_data = topo_uni_dir.read()
TOPO_UNI_DIR_COMPLEX_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "NW-for-test-5-4.xml")
- with open(TOPO_UNI_DIR_COMPLEX_FILE, 'r') as topo_uni_dir_complex:
+ with open(TOPO_UNI_DIR_COMPLEX_FILE, 'r', encoding='utf-8') as topo_uni_dir_complex:
cls.complex_topo_uni_dir_data = topo_uni_dir_complex.read()
PORT_MAPPING_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "pce_portmapping_121.json")
- with open(PORT_MAPPING_FILE, 'r') as port_mapping:
+ with open(PORT_MAPPING_FILE, 'r', encoding='utf-8') as port_mapping:
cls.port_mapping_data = port_mapping.read()
sample_files_parsed = True
except PermissionError as err:
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+# pylint: disable=invalid-name
# pylint: disable=no-member
# pylint: disable=too-many-public-methods
import unittest
import os
+# pylint: disable=wrong-import-order
import sys
import time
import requests
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
@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__)),
- "..", "..", "sample_configs", "honeynode-topo400G.json")
- with open(TOPO_BI_DIR_FILE, 'r') as topo_bi_dir:
+ "..", "..", "sample_configs",
+ "honeynode-topo400G.json")
+ with open(TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as topo_bi_dir:
cls.topo_bi_dir_data = topo_bi_dir.read()
OTN_TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- "..", "..", "sample_configs", "honeynode-otntopo400G.json")
- with open(OTN_TOPO_BI_DIR_FILE, 'r') as otn_topo_bi_dir:
+ "..", "..", "sample_configs",
+ "honeynode-otntopo400G.json")
+ with open(OTN_TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as otn_topo_bi_dir:
cls.otn_topo_bi_dir_data = otn_topo_bi_dir.read()
OTUC4_OTN_TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- "..", "..", "sample_configs", "honeynode-otntopo400GwithOTUC4.json")
- with open(OTUC4_OTN_TOPO_BI_DIR_FILE, 'r') as otuc4_otn_topo_bi_dir:
+ "..", "..", "sample_configs",
+ "honeynode-otntopo400GwithOTUC4.json")
+ with open(OTUC4_OTN_TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as otuc4_otn_topo_bi_dir:
cls.otuc4_otn_topo_bi_dir_data = otuc4_otn_topo_bi_dir.read()
ODUC4_OTN_TOPO_BI_DIR_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- "..", "..", "sample_configs", "honeynode-otntopo400GwithODUC4.json")
- with open(ODUC4_OTN_TOPO_BI_DIR_FILE, 'r') as oduc4_otn_topo_bi_dir:
+ "..", "..", "sample_configs",
+ "honeynode-otntopo400GwithODUC4.json")
+ with open(ODUC4_OTN_TOPO_BI_DIR_FILE, 'r', encoding='utf-8') as oduc4_otn_topo_bi_dir:
cls.oduc4_otn_topo_bi_dir_data = oduc4_otn_topo_bi_dir.read()
PORT_MAPPING_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- "..", "..", "sample_configs", "pce_portmapping_71.json")
- with open(PORT_MAPPING_FILE, 'r') as port_mapping:
+ "..", "..", "sample_configs",
+ "pce_portmapping_71.json")
+ with open(PORT_MAPPING_FILE, 'r', encoding='utf-8') as port_mapping:
cls.port_mapping_data = port_mapping.read()
sample_files_parsed = True
except PermissionError as err:
print("all processes killed")
def setUp(self): # instruction executed before each test method
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
time.sleep(1)
# Path Computation success
def test_05_path_computation_OTUC4_xpdr_bi(self):
response = test_utils.path_computation_request("request-1", "service-OTUC4",
- {"service-rate": "400", "clli": "NodeA",
- "service-format": "OTU", "node-id": "XPDR-A2",
- "rx-direction": {"port": {"port-device-name": "XPDR-A2-XPDR2"}}
+ {"service-rate": "400",
+ "clli": "NodeA",
+ "service-format": "OTU",
+ "node-id": "XPDR-A2",
+ "rx-direction": {"port": {"port-device-name": "XPDR-A2-XPDR2"}}
},
- {"service-rate": "400", "clli": "NodeC",
- "service-format": "OTU", "node-id": "XPDR-C2",
- "rx-direction": {"port": {"port-device-name": "XPDR-C2-XPDR2"}}
+ {"service-rate": "400",
+ "clli": "NodeC",
+ "service-format": "OTU",
+ "node-id": "XPDR-C2",
+ "rx-direction": {"port": {"port-device-name": "XPDR-C2-XPDR2"}}
})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
# Path Computation success
def test_07_path_computation_ODUC4_xpdr_bi(self):
response = test_utils.path_computation_request("request-1", "service-ODUC4",
- {"service-rate": "400", "clli": "NodeA", "service-format": "ODU",
- "node-id": "XPDR-A2",
- "tx-direction": {"port": {"port-device-name": "XPDR-A2-XPDR2"}}
+ {"service-rate": "400",
+ "clli": "NodeA",
+ "service-format": "ODU",
+ "node-id": "XPDR-A2",
+ "tx-direction": {"port": {"port-device-name": "XPDR-A2-XPDR2"}}
},
- {"service-rate": "400", "clli": "NodeC", "service-format": "ODU",
- "node-id": "XPDR-C2",
- "tx-direction": {"port": {"port-device-name": "XPDR-C2-XPDR2"}}
+ {"service-rate": "400",
+ "clli": "NodeC",
+ "service-format": "ODU",
+ "node-id": "XPDR-C2",
+ "tx-direction": {"port": {"port-device-name": "XPDR-C2-XPDR2"}}
})
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
# Path Computation success
def test_09_path_computation_100G_xpdr_bi(self):
response = test_utils.path_computation_request("request-1", "service-100GE",
- {"service-rate": "100", "clli": "NodeA", "service-format": "Ethernet",
+ {"service-rate": "100",
+ "clli": "NodeA",
+ "service-format": "Ethernet",
"node-id": "XPDR-A2",
"tx-direction": {"port": {"port-device-name": "XPDR-A2-XPDR2",
"port-name": "XPDR2-CLIENT1"}}},
- {"service-rate": "100", "clli": "NodeC", "service-format": "Ethernet",
+ {"service-rate": "100",
+ "clli": "NodeC",
+ "service-format": "Ethernet",
"node-id": "XPDR-C2",
"tx-direction": {"port": {"port-device-name": "XPDR-C2-XPDR2",
"port-name": "XPDR2-CLIENT1"}}})
import unittest
import os
+# pylint: disable=wrong-import-order
import sys
import time
import requests
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
sample_files_parsed = False
TOPO_CLLINET_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "gnpy", "clliNetwork.json")
- with open(TOPO_CLLINET_FILE, 'r') as topo_cllinet:
+ with open(TOPO_CLLINET_FILE, 'r', encoding='utf-8') as topo_cllinet:
cls.topo_cllinet_data = topo_cllinet.read()
TOPO_ORDNET_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "gnpy", "openroadmNetwork.json")
- with open(TOPO_ORDNET_FILE, 'r') as topo_ordnet:
+ with open(TOPO_ORDNET_FILE, 'r', encoding='utf-8') as topo_ordnet:
cls.topo_ordnet_data = topo_ordnet.read()
TOPO_ORDTOPO_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "gnpy", "openroadmTopology.json")
- with open(TOPO_ORDTOPO_FILE, 'r') as topo_ordtopo:
+ with open(TOPO_ORDTOPO_FILE, 'r', encoding='utf-8') as topo_ordtopo:
cls.topo_ordtopo_data = topo_ordtopo.read()
PORT_MAPPING_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"..", "..", "sample_configs", "gnpy", "gnpy_portmapping_121.json")
- with open(PORT_MAPPING_FILE, 'r') as port_mapping:
+ with open(PORT_MAPPING_FILE, 'r', encoding='utf-8') as port_mapping:
cls.port_mapping_data = port_mapping.read()
sample_files_parsed = True
except PermissionError as err:
import os
import json
+# pylint: disable=wrong-import-order
import sys
import unittest
import time
import requests
sys.path.append('transportpce_tests/common/')
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
import test_utils # nopep8
@classmethod
def setUpClass(cls):
+ # pylint: disable=unsubscriptable-object
# TODO: for lighty manage the activation of NBI notification feature
cls.init_failed = False
cls.processes = test_utils.start_tpce()
print("all processes killed")
def setUp(self): # instruction executed before each test method
+ # pylint: disable=consider-using-f-string
print("execution of {}".format(self.id().split(".")[-1]))
def test_01_connect_xpdrA(self):