print("all processes killed")
def setUp(self):
- time.sleep(5)
+ time.sleep(2)
def test_01_connect_xpdra2(self):
response = test_utils.mount_device("XPDR-A2", ('xpdra2', self.NODE_VERSION_71))
'type': 'org-openroadm-interfaces:otnOtu',
'supporting-port': 'L1'
}
- input_dict_2 = {'tx-sapi': 'LY9PxYJqUbw=',
- 'expected-dapi': 'LY9PxYJqUbw=',
+ input_dict_2 = {'tx-sapi': 'G54UFNImtOE=',
+ 'expected-dapi': 'G54UFNImtOE=',
+ 'tx-dapi': 'J/FIUzQc+4M=',
+ 'expected-sapi': 'J/FIUzQc+4M=',
'rate': 'org-openroadm-otn-common-types:OTUCn',
'degthr-percentage': 100,
'degm-intervals': 2,
'type': 'org-openroadm-interfaces:otnOtu',
'supporting-port': 'L1'
}
- input_dict_2 = {'tx-dapi': 'LY9PxYJqUbw=',
- 'expected-sapi': 'LY9PxYJqUbw=',
- 'tx-sapi': 'Nmbu2MNHvc4=',
- 'expected-dapi': 'Nmbu2MNHvc4=',
+ input_dict_2 = {'tx-dapi': 'G54UFNImtOE=',
+ 'expected-sapi': 'G54UFNImtOE=',
+ 'tx-sapi': 'J/FIUzQc+4M=',
+ 'expected-dapi': 'J/FIUzQc+4M=',
'rate': 'org-openroadm-otn-common-types:OTUCn',
'degthr-percentage': 100,
'degm-intervals': 2,
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 node['node-id'] == 'XPDR-C2-XPDR2':
+ if node['node-id'] in ('XPDR-A2-XPDR2', '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 node['node-id'] == 'XPDR-C2-XPDR2':
+ if node['node-id'] in ('XPDR-A2-XPDR2', '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 node['node-id'] == 'XPDR-C2-XPDR2':
+ if node['node-id'] in ('XPDR-A2-XPDR2', '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 node['node-id'] == 'XPDR-C2-XPDR2':
+ if node['node-id'] in ('XPDR-A2-XPDR2', '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 node['node-id'] == 'XPDR-C2-XPDR2':
+ if node['node-id'] in ('XPDR-A2-XPDR2', 'XPDR-C2-XPDR2'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
if tp['tp-id'] == 'XPDR2-NETWORK1':
links = res['network'][0]['ietf-network-topology:link']
self.assertEqual(22, len(links), 'Topology should contain 22 links')
- def test_68_connect_xprda2_2_N1_to_roadma_PP2(self):
+ def test_68_connect_xprda2_1_N1_to_roadma_PP2(self):
response = test_utils.connect_xpdr_to_rdm_request("XPDR-A2", "1", "1",
"ROADM-A1", "1", "SRG1-PP1-TXRX")
self.assertEqual(response.status_code, requests.codes.ok)
res["output"]["result"])
time.sleep(2)
- def test_69_connect_roadma_PP2_to_xpdra2_2_N1(self):
+ def test_69_connect_roadma_PP2_to_xpdra2_1_N1(self):
response = test_utils.connect_rdm_to_xpdr_request("XPDR-A2", "1", "1",
"ROADM-A1", "1", "SRG1-PP1-TXRX")
self.assertEqual(response.status_code, requests.codes.ok)
res["output"]["result"])
time.sleep(2)
- def test_70_connect_xprdc2_2_N1_to_roadmc_PP2(self):
+ def test_70_connect_xprdc2_1_N1_to_roadmc_PP2(self):
response = test_utils.connect_xpdr_to_rdm_request("XPDR-C2", "1", "1",
"ROADM-C1", "1", "SRG1-PP1-TXRX")
self.assertEqual(response.status_code, requests.codes.ok)
res["output"]["result"])
time.sleep(2)
- def test_71_connect_roadmc_PP2_to_xpdrc2_2_N1(self):
+ def test_71_connect_roadmc_PP2_to_xpdrc2_1_N1(self):
response = test_utils.connect_rdm_to_xpdr_request("XPDR-C2", "1", "1",
"ROADM-C1", "1", "SRG1-PP1-TXRX")
self.assertEqual(response.status_code, requests.codes.ok)
res["output"]["result"])
time.sleep(2)
+
# test service-create for 400GE service from xpdra2 to xpdrc2
+
+
def test_72_create_400GE_service(self):
self.cr_serv_sample_data["input"]["service-name"] = "service-400GE"
self.cr_serv_sample_data["input"]["service-a-end"]["service-rate"] = "400"
- 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-z-end"]["service-rate"] = "400"
- 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"
response = test_utils.service_create_request(self.cr_serv_sample_data)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(freq_map_array[95], 0, "Index 1 should not be available")
time.sleep(3)
- def test_78_check_interface_100GE_CLIENT_xpdra2(self):
+ def test_78_check_interface_400GE_CLIENT_xpdra2(self):
response = test_utils.check_netconf_node_request(
"XPDR-A2", "interface/XPDR1-CLIENT1-ETHERNET")
self.assertEqual(response.status_code, requests.codes.ok)
['supporting-interface-list'][0]: 'XPDR1-NETWORK1-OTSI-GROUP',
'type': 'org-openroadm-interfaces:otnOtu',
'supporting-port': 'L1'}
- input_dict_2 = {"tx-sapi": "AIGiVAQ4gDil", "rate": "org-openroadm-otn-common-types:OTUCn",
+ input_dict_2 = {"tx-sapi": "ANeUjNzWtDLV",
+ "expected-dapi": "ANeUjNzWtDLV",
+ 'tx-dapi': 'AKsqPmWceByv',
+ 'expected-sapi': 'AKsqPmWceByv',
+ "rate": "org-openroadm-otn-common-types:OTUCn",
"degthr-percentage": 100,
"tim-detect-mode": "Disabled",
"otucn-n-rate": 4,
- "degm-intervals": 2,
- "expected-dapi": "AIGiVAQ4gDil"}
+ "degm-intervals": 2}
self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
res['interface'][0])
input_dict_1 = {'name': 'XPDR1-NETWORK1-ODUC4',
'administrative-state': 'inService',
'supporting-circuit-pack-name': '1/1/2-PLUG-NET',
- ['supporting-interface-list'][0]: 'XPDR1-NETWORK1-OTSI-GROUP',
+ ['supporting-interface-list'][0]: 'XPDR1-NETWORK1-OTUC4',
'type': 'org-openroadm-interfaces:otnOdu',
- 'supporting-port': 'L1'}
+ 'supporting-port': 'L1',
+ 'circuit-id': 'TBD',
+ 'description': 'TBD'}
input_dict_2 = {"odu-function": "org-openroadm-otn-common-types:ODU-TTP",
"tim-detect-mode": "Disabled",
"degm-intervals": 2,
self.assertDictEqual(dict(input_dict_3,
**res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu']),
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
+ self.assertEqual('XPDR1-NETWORK1-OTUC4', res['interface'][0]['supporting-interface-list'][0])
+
+ def test_82a_check_interface_ODUFLEX_xpdra2(self):
+ response = test_utils.check_netconf_node_request(
+ "XPDR-A2", "interface/XPDR1-NETWORK1-ODUFLEX")
+ self.assertEqual(response.status_code, requests.codes.ok)
+ res = response.json()
+ input_dict_1 = {'name': 'XPDR1-NETWORK1-ODUFLEX',
+ 'administrative-state': 'inService',
+ 'supporting-circuit-pack-name': '1/1/2-PLUG-NET',
+ ['supporting-interface-list'][0]: 'XPDR1-NETWORK1-ODUC4',
+ 'type': 'org-openroadm-interfaces:otnOdu',
+ 'supporting-port': 'L1',
+ 'circuit-id': 'TBD',
+ 'description': 'TBD'}
+ input_dict_2 = {"odu-function": "org-openroadm-otn-common-types:ODU-TTP-CTP",
+ "tim-detect-mode": "Disabled",
+ "degm-intervals": 2,
+ "degthr-percentage": 100,
+ "monitoring-mode": "terminated",
+ "rate": "org-openroadm-otn-common-types:ODUflex-cbr",
+ "oduflex-cbr-service": "org-openroadm-otn-common-types:ODUflex-cbr-400G"
+ }
+ input_dict_3 = {"exp-payload-type": "32", "payload-type": "32"}
+ input_dict_4 = {'trib-port-number': 1}
+
+ self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
+ res['interface'][0])
+ self.assertDictEqual(dict(input_dict_2,
+ **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
+ res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
+ self.assertDictEqual(dict(input_dict_3,
+ **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu']),
+ res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
+ self.assertDictEqual(dict(input_dict_4,
+ **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'][
+ 'parent-odu-allocation']),
+ res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation'])
+ self.assertIn('1.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertIn('1.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertIn('2.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertIn('2.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertIn('3.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertIn('3.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertIn('4.1', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertIn('4.20', res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']
+ ['opucn-trib-slots'])
+ self.assertEqual('XPDR1-NETWORK1-ODUC4', res['interface'][0]['supporting-interface-list'][0])
def test_83_delete_400GE_service(self):
response = test_utils.service_delete_request("service-400GE")
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)