# 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
"service-format": "OTU",
"otu-service-rate": "org-openroadm-otn-common-types:OTU4",
"clli": "NodeSA",
- "subrate-eth-sla": {
- "subrate-eth-sla": {
- "committed-info-rate": "100000",
- "committed-burst-size": "64"
- }
- },
- "tx-direction": {
+ "tx-direction": [{
"port": {
"port-device-name": "SPDR-SA1-XPDR1",
"port-type": "fixed",
"lgx-port-name": "Some lgx-port-name",
"lgx-port-rack": "000000.00",
"lgx-port-shelf": "00"
- }
- },
- "rx-direction": {
+ },
+ "index": 0
+ }],
+ "rx-direction": [{
"port": {
"port-device-name": "SPDR-SA1-XPDR1",
"port-type": "fixed",
"lgx-port-name": "Some lgx-port-name",
"lgx-port-rack": "000000.00",
"lgx-port-shelf": "00"
- }
- },
+ },
+ "index": 0
+ }],
"optic-type": "gray"
},
"service-z-end": {
"service-format": "OTU",
"otu-service-rate": "org-openroadm-otn-common-types:OTU4",
"clli": "NodeSC",
- "subrate-eth-sla": {
- "subrate-eth-sla": {
- "committed-info-rate": "100000",
- "committed-burst-size": "64"
- }
- },
- "tx-direction": {
+ "tx-direction": [{
"port": {
"port-device-name": "SPDR-SC1-XPDR1",
"port-type": "fixed",
"lgx-port-name": "Some lgx-port-name",
"lgx-port-rack": "000000.00",
"lgx-port-shelf": "00"
- }
- },
- "rx-direction": {
+ },
+ "index": 0
+ }],
+ "rx-direction": [{
"port": {
"port-device-name": "SPDR-SC1-XPDR1",
"port-type": "fixed",
"lgx-port-name": "Some lgx-port-name",
"lgx-port-rack": "000000.00",
"lgx-port-shelf": "00"
- }
- },
+ },
+ "index": 0
+ }],
"optic-type": "gray"
},
"due-date": "2018-06-15T00:00:01Z",
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.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "10"
self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "Ethernet"
del self.cr_serv_sample_data["input"]["service-a-end"]["odu-service-rate"]
- self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
- self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["ethernet-encoding"] = "10GBASE-R"
+ self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
self.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "10"
self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "Ethernet"
del self.cr_serv_sample_data["input"]["service-z-end"]["odu-service-rate"]
- self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
- self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR1-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["ethernet-encoding"] = "10GBASE-R"
+ self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR1-CLIENT1"
response = test_utils.service_create_request(self.cr_serv_sample_data)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
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):
response = test_utils.check_netconf_node_request(
- "SPDR-SA1", "interface/XPDR1-CLIENT1-ODU2e-service1-10GE")
+ "SPDR-SA1", "interface/XPDR1-CLIENT1-ODU2e")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e-service1-10GE',
+ input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP1-SFP4',
'supporting-interface': 'XPDR1-CLIENT1-ETHERNET10G',
**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):
response = test_utils.check_netconf_node_request(
- "SPDR-SA1", "interface/XPDR1-NETWORK1-ODU2e-service1-10GE")
+ "SPDR-SA1", "interface/XPDR1-NETWORK1-ODU2e")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e-service1-10GE',
+ input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP1-CFP0',
'supporting-interface': 'XPDR1-NETWORK1-ODU4',
def test_34_check_ODU2E_connection_spdra(self):
response = test_utils.check_netconf_node_request(
"SPDR-SA1",
- "odu-connection/XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE")
+ "odu-connection/XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
input_dict_1 = {
'connection-name':
- 'XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE',
+ 'XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e',
'direction': 'bidirectional'
}
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'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR1-CLIENT1-ODU2e-service1-10GE'},
+ self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e'},
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):
response = test_utils.check_netconf_node_request(
- "SPDR-SC1", "interface/XPDR1-CLIENT1-ODU2e-service1-10GE")
+ "SPDR-SC1", "interface/XPDR1-CLIENT1-ODU2e")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e-service1-10GE',
+ input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP1-SFP4',
'supporting-interface': 'XPDR1-CLIENT1-ETHERNET10G',
**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):
response = test_utils.check_netconf_node_request(
- "SPDR-SC1", "interface/XPDR1-NETWORK1-ODU2e-service1-10GE")
+ "SPDR-SC1", "interface/XPDR1-NETWORK1-ODU2e")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e-service1-10GE',
+ input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP1-CFP0',
'supporting-interface': 'XPDR1-NETWORK1-ODU4',
def test_38_check_ODU2E_connection_spdrc(self):
response = test_utils.check_netconf_node_request(
"SPDR-SC1",
- "odu-connection/XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE")
+ "odu-connection/XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
input_dict_1 = {
'connection-name':
- 'XPDR1-CLIENT1-ODU2e-service1-10GE-x-XPDR1-NETWORK1-ODU2e-service1-10GE',
+ 'XPDR1-CLIENT1-ODU2e-x-XPDR1-NETWORK1-ODU2e',
'direction': 'bidirectional'
}
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'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR1-CLIENT1-ODU2e-service1-10GE'},
+ self.assertDictEqual({'src-if': 'XPDR1-CLIENT1-ODU2e'},
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"
self.cr_serv_sample_data["input"]["service-a-end"]["service-format"] = "OTU"
- self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
- self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
- self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
- self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
self.cr_serv_sample_data["input"]["service-a-end"]["otu-service-rate"] = "org-openroadm-otn-common-types:OTU4"
self.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "100"
self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "OTU"
- self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
- self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
- self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
- self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
self.cr_serv_sample_data["input"]["service-z-end"]["otu-service-rate"] = "org-openroadm-otn-common-types:OTU4"
response = test_utils.service_create_request(self.cr_serv_sample_data)
self.assertEqual(response.status_code, requests.codes.ok)
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"
- self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
- self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
- self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
self.cr_serv_sample_data["input"]["service-a-end"]["odu-service-rate"] = "org-openroadm-otn-common-types:ODU4"
del self.cr_serv_sample_data["input"]["service-a-end"]["otu-service-rate"]
self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "ODU"
self.cr_serv_sample_data["input"]["service-z-end"]["odu-service-rate"] = "org-openroadm-otn-common-types:ODU4"
- self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
- self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
- self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
- self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-NETWORK1"
del self.cr_serv_sample_data["input"]["service-z-end"]["otu-service-rate"]
response = test_utils.service_create_request(self.cr_serv_sample_data)
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.cr_serv_sample_data["input"]["service-z-end"]["service-rate"] = "1"
self.cr_serv_sample_data["input"]["service-z-end"]["service-format"] = "Ethernet"
del self.cr_serv_sample_data["input"]["service-a-end"]["odu-service-rate"]
- self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
- self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
- self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
- self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-a-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SA1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-a-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
del self.cr_serv_sample_data["input"]["service-z-end"]["odu-service-rate"]
- self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
- self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
- self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
- self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"]["port"]["port-name"] = "XPDR3-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-z-end"]["tx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
+ self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-device-name"] = "SPDR-SC1-XPDR3"
+ self.cr_serv_sample_data["input"]["service-z-end"]["rx-direction"][0]["port"]["port-name"] = "XPDR3-CLIENT1"
response = test_utils.service_create_request(self.cr_serv_sample_data)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
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):
response = test_utils.check_netconf_node_request(
- "SPDR-SA1", "interface/XPDR3-CLIENT1-ODU0-service1-1GE")
+ "SPDR-SA1", "interface/XPDR3-CLIENT1-ODU0")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0-service1-1GE',
+ input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP3-SFP1',
'supporting-interface': 'XPDR3-CLIENT1-ETHERNET1G',
**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):
response = test_utils.check_netconf_node_request(
- "SPDR-SA1", "interface/XPDR3-NETWORK1-ODU0-service1-1GE")
+ "SPDR-SA1", "interface/XPDR3-NETWORK1-ODU0")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0-service1-1GE',
+ input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP3-CFP0',
'supporting-interface': 'XPDR3-NETWORK1-ODU4',
def test_75_check_ODU0_connection_spdra(self):
response = test_utils.check_netconf_node_request(
"SPDR-SA1",
- "odu-connection/XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE")
+ "odu-connection/XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
input_dict_1 = {
'connection-name':
- 'XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE',
+ 'XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0',
'direction': 'bidirectional'
}
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'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR3-CLIENT1-ODU0-service1-1GE'},
+ self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0'},
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):
response = test_utils.check_netconf_node_request(
- "SPDR-SC1", "interface/XPDR3-CLIENT1-ODU0-service1-1GE")
+ "SPDR-SC1", "interface/XPDR3-CLIENT1-ODU0")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0-service1-1GE',
+ input_dict_1 = {'name': 'XPDR3-CLIENT1-ODU0',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP3-SFP1',
'supporting-interface': 'XPDR3-CLIENT1-ETHERNET1G',
**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):
response = test_utils.check_netconf_node_request(
- "SPDR-SC1", "interface/XPDR3-NETWORK1-ODU0-service1-1GE")
+ "SPDR-SC1", "interface/XPDR3-NETWORK1-ODU0")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0-service1-1GE',
+ input_dict_1 = {'name': 'XPDR3-NETWORK1-ODU0',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP3-CFP0',
'supporting-interface': 'XPDR3-NETWORK1-ODU4',
def test_79_check_ODU0_connection_spdrc(self):
response = test_utils.check_netconf_node_request(
"SPDR-SC1",
- "odu-connection/XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE")
+ "odu-connection/XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
input_dict_1 = {
'connection-name':
- 'XPDR3-CLIENT1-ODU0-service1-1GE-x-XPDR3-NETWORK1-ODU0-service1-1GE',
+ 'XPDR3-CLIENT1-ODU0-x-XPDR3-NETWORK1-ODU0',
'direction': 'bidirectional'
}
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'},
res['odu-connection'][0]['destination'])
- self.assertDictEqual({u'src-if': u'XPDR3-CLIENT1-ODU0-service1-1GE'},
+ self.assertDictEqual({'src-if': 'XPDR3-CLIENT1-ODU0'},
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)