# 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
res['interface'][0])
self.assertDictEqual(
- {u'frequency': 196.1, u'rate': u'org-openroadm-common-types:R100G',
- u'transmit-power': -5, u'modulation-format': 'dp-qpsk'},
+ {'frequency': 196.1, 'rate': 'org-openroadm-common-types:R100G',
+ 'transmit-power': -5, 'modulation-format': 'dp-qpsk'},
res['interface'][0]['org-openroadm-optical-channel-interfaces:och'])
def test_15_check_interface_OTU4_spdra(self):
'type': 'org-openroadm-interfaces:otnOtu',
'supporting-port': 'CP1-CFP0-P1'
}
- input_dict_2 = {'tx-sapi': 'Swfw02qXGyI=',
- 'expected-dapi': 'Swfw02qXGyI=',
+ input_dict_2 = {'tx-sapi': 'H/OelLynehI=',
+ 'expected-dapi': 'H/OelLynehI=',
+ 'tx-dapi': 'AMf1n5hK6Xkk',
+ 'expected-sapi': 'AMf1n5hK6Xkk',
'rate': 'org-openroadm-otn-common-types:OTU4',
'fec': 'scfec'
}
res['interface'][0])
self.assertDictEqual(
- {u'frequency': 196.1, u'rate': u'org-openroadm-common-types:R100G',
- u'transmit-power': -5, u'modulation-format': 'dp-qpsk'},
+ {'frequency': 196.1, 'rate': 'org-openroadm-common-types:R100G',
+ 'transmit-power': -5, 'modulation-format': 'dp-qpsk'},
res['interface'][0]['org-openroadm-optical-channel-interfaces:och'])
def test_17_check_interface_OTU4_spdrc(self):
'type': 'org-openroadm-interfaces:otnOtu',
'supporting-port': 'CP1-CFP0-P1'
}
- input_dict_2 = {'tx-dapi': 'Swfw02qXGyI=',
- 'expected-sapi': 'Swfw02qXGyI=',
- 'tx-sapi': 'fuYZwEO660g=',
- 'expected-dapi': 'fuYZwEO660g=',
+ input_dict_2 = {'tx-dapi': 'H/OelLynehI=',
+ 'expected-sapi': 'H/OelLynehI=',
+ 'tx-sapi': 'AMf1n5hK6Xkk',
+ 'expected-dapi': 'AMf1n5hK6Xkk',
'rate': 'org-openroadm-otn-common-types:OTU4',
'fec': 'scfec'
}
res = response.json()
ele = res['node'][0]['ietf-network-topology:termination-point'][0]
self.assertEqual('XPDR1-NETWORK1', ele['tp-id'])
- self.assertEqual({u'frequency': 196.1,
- u'width': 40},
+ self.assertEqual({'frequency': 196.1,
+ 'width': 40},
ele['org-openroadm-network-topology:xpdr-network-attributes']['wavelength'])
time.sleep(3)
'supporting-circuit-pack-name': 'CP1-CFP0',
'supporting-interface': 'XPDR1-NETWORK1-OTU',
'type': 'org-openroadm-interfaces:otnOdu',
- 'supporting-port': 'CP1-CFP0-P1'}
+ 'supporting-port': 'CP1-CFP0-P1',
+ 'circuit-id': 'TBD',
+ 'description': 'TBD'}
# SAPI/DAPI are added in the Otu4 renderer
input_dict_2 = {'odu-function': 'org-openroadm-otn-common-types:ODU-TTP',
'rate': 'org-openroadm-otn-common-types:ODU4',
- 'expected-dapi': 'Swfw02qXGyI=',
- 'expected-sapi': 'fuYZwEO660g=',
- 'tx-dapi': 'fuYZwEO660g=',
- 'tx-sapi': 'Swfw02qXGyI='}
+ 'monitoring-mode': 'terminated',
+ 'expected-dapi': 'H/OelLynehI=',
+ 'expected-sapi': 'AMf1n5hK6Xkk',
+ 'tx-dapi': 'AMf1n5hK6Xkk',
+ 'tx-sapi': 'H/OelLynehI='}
self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
res['interface'][0])
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']
)
self.assertDictEqual(
- {u'payload-type': u'21', u'exp-payload-type': u'21'},
+ {'payload-type': '21', 'exp-payload-type': '21'},
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_26_check_interface_ODU4_spdrc(self):
'supporting-circuit-pack-name': 'CP1-CFP0',
'supporting-interface': 'XPDR1-NETWORK1-OTU',
'type': 'org-openroadm-interfaces:otnOdu',
- 'supporting-port': 'CP1-CFP0-P1'}
+ 'supporting-port': 'CP1-CFP0-P1',
+ 'circuit-id': 'TBD',
+ 'description': 'TBD'}
# SAPI/DAPI are added in the Otu4 renderer
input_dict_2 = {'odu-function': 'org-openroadm-otn-common-types:ODU-TTP',
'rate': 'org-openroadm-otn-common-types:ODU4',
- 'tx-sapi': 'fuYZwEO660g=',
- 'tx-dapi': 'Swfw02qXGyI=',
- 'expected-sapi': 'Swfw02qXGyI=',
- 'expected-dapi': 'fuYZwEO660g='
+ 'monitoring-mode': 'terminated',
+ 'tx-sapi': 'AMf1n5hK6Xkk',
+ 'tx-dapi': 'H/OelLynehI=',
+ 'expected-sapi': 'H/OelLynehI=',
+ 'expected-dapi': 'AMf1n5hK6Xkk'
}
self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
res['interface'][0])
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']
)
self.assertDictEqual(
- {u'payload-type': u'21', u'exp-payload-type': u'21'},
+ {'payload-type': '21', 'exp-payload-type': '21'},
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_27_check_otn_topo_links(self):
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'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
self.assertDictEqual(dict(input_dict, **res['interface'][0]),
res['interface'][0])
self.assertDictEqual(
- {u'speed': 10000},
+ {'speed': 10000},
res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
def test_32_check_interface_ODU2E_CLIENT_spdra(self):
**res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
self.assertDictEqual(
- {u'payload-type': u'03', u'exp-payload-type': u'03'},
+ {'payload-type': '03', 'exp-payload-type': '03'},
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_33_check_interface_ODU2E_NETWORK_spdra(self):
self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
res['odu-connection'][0])
- self.assertDictEqual({u'dst-if': u'XPDR1-NETWORK1-ODU2e-service1-10GE'},
+ self.assertDictEqual({'dst-if': 'XPDR1-NETWORK1-ODU2e-service1-10GE'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR1-CLIENT1-ODU2e-service1-10GE'},
+ self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e-service1-10GE'},
res['odu-connection'][0]['source'])
def test_35_check_interface_10GE_CLIENT_spdrc(self):
self.assertDictEqual(dict(input_dict, **res['interface'][0]),
res['interface'][0])
self.assertDictEqual(
- {u'speed': 10000},
+ {'speed': 10000},
res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
def test_36_check_interface_ODU2E_CLIENT_spdrc(self):
**res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
self.assertDictEqual(
- {u'payload-type': u'03', u'exp-payload-type': u'03'},
+ {'payload-type': '03', 'exp-payload-type': '03'},
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_37_check_interface_ODU2E_NETWORK_spdrc(self):
self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
res['odu-connection'][0])
- self.assertDictEqual({u'dst-if': u'XPDR1-NETWORK1-ODU2e-service1-10GE'},
+ self.assertDictEqual({'dst-if': 'XPDR1-NETWORK1-ODU2e-service1-10GE'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR1-CLIENT1-ODU2e-service1-10GE'},
+ self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e-service1-10GE'},
res['odu-connection'][0]['source'])
def test_39_check_otn_topo_links(self):
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'] in ('SPDR-SA1-XPDR1', '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'] in ('SPDR-SA1-XPDR1', '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'] in ('SPDR-SA1-XPDR1', 'SPDR-SC1-XPDR1'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR1-NETWORK1':
tp = res['node'][0]['ietf-network-topology:termination-point'][0]
self.assertEqual('XPDR1-NETWORK1', tp['tp-id'])
self.assertNotIn('wavelength', dict.keys(
- tp[u'org-openroadm-network-topology:xpdr-network-attributes']))
+ tp['org-openroadm-network-topology:xpdr-network-attributes']))
time.sleep(3)
def test_60_check_openroadm_topo_ROADMA_SRG(self):
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"
self.assertDictEqual(dict(input_dict, **res['interface'][0]),
res['interface'][0])
self.assertDictEqual(
- {u'speed': 1000},
+ {'speed': 1000},
res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
def test_73_check_interface_ODU0_CLIENT_spdra(self):
**res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
self.assertDictEqual(
- {u'payload-type': u'07', u'exp-payload-type': u'07'},
+ {'payload-type': '07', 'exp-payload-type': '07'},
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_74_check_interface_ODU0_NETWORK_spdra(self):
self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
res['odu-connection'][0])
- self.assertDictEqual({u'dst-if': u'XPDR3-NETWORK1-ODU0-service1-1GE'},
+ self.assertDictEqual({'dst-if': 'XPDR3-NETWORK1-ODU0-service1-1GE'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR3-CLIENT1-ODU0-service1-1GE'},
+ self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0-service1-1GE'},
res['odu-connection'][0]['source'])
def test_76_check_interface_1GE_CLIENT_spdrc(self):
self.assertDictEqual(dict(input_dict, **res['interface'][0]),
res['interface'][0])
self.assertDictEqual(
- {u'speed': 1000},
+ {'speed': 1000},
res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
def test_77_check_interface_ODU0_CLIENT_spdrc(self):
**res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
self.assertDictEqual(
- {u'payload-type': u'07', u'exp-payload-type': u'07'},
+ {'payload-type': '07', 'exp-payload-type': '07'},
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_78_check_interface_ODU0_NETWORK_spdrc(self):
self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
res['odu-connection'][0])
- self.assertDictEqual({u'dst-if': u'XPDR3-NETWORK1-ODU0-service1-1GE'},
+ self.assertDictEqual({'dst-if': 'XPDR3-NETWORK1-ODU0-service1-1GE'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR3-CLIENT1-ODU0-service1-1GE'},
+ self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0-service1-1GE'},
res['odu-connection'][0]['source'])
def test_80_check_otn_topo_links(self):
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'] in ('SPDR-SA1-XPDR3', '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'] in ('SPDR-SA1-XPDR3', 'SPDR-SC1-XPDR3'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR3-NETWORK1':
res = response.json()
links = res['network'][0]['ietf-network-topology:link']
for link in links:
- if (link["org-openroadm-common-network:link-type"] == "XPONDER-OUTPUT" or
- link["org-openroadm-common-network:link-type"] == "XPONDER-INPUT"):
+ if link["org-openroadm-common-network:link-type"] in ('XPONDER-OUTPUT', 'XPONDER-INPUT'):
link_name = link["link-id"]
response = test_utils.delete_request(url+link_name)
self.assertEqual(response.status_code, requests.codes.ok)