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)
for i in range(0, nbElmPath):
resource_i = (res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]
['resource'])
- if(resource_i == link):
+ if resource_i == link:
find = True
self.assertEqual(find, True)
time.sleep(5)
for i in range(0, nbElmPath):
resource_i = (res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]
['resource'])
- if (resource_i == link):
+ if resource_i == link:
find = True
self.assertNotEqual(find, True)
time.sleep(5)
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['network-ref'], 'clli-network')
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeA')
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'XPDRA01'):
+ if nodeId == 'XPDRA01':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'XPONDER')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], '1')
- elif(nodeId == 'ROADMA01'):
+ elif nodeId == 'ROADMA01':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'ROADM')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], '2')
else:
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
# Tests related to XPDRA nodes
- if(nodeId == 'XPDRA01-XPDR1'):
+ if nodeId == 'XPDRA01-XPDR1':
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'XPDRA01'},
res['network'][0]['node'][i]['supporting-node'])
self.assertIn({'network-ref': 'clli-network', 'node-ref': 'NodeA'},
tpType = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j][
'org-openroadm-common-network:tp-type']
tpId = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
- if (tpId == 'XPDR1-NETWORK2'):
+ if tpId == 'XPDR1-NETWORK2':
self.assertEqual(res['network'][0]['node'][i]['ietf-network-topology:termination-point']
[j]['transportpce-topology:associated-connection-map-port'], 'XPDR1-CLIENT3')
- if (tpId == 'XPDR1-CLIENT3'):
+ if tpId == 'XPDR1-CLIENT3':
self.assertEqual(res['network'][0]['node'][i]['ietf-network-topology:termination-point']
[j]['transportpce-topology:associated-connection-map-port'], 'XPDR1-NETWORK2')
self.assertTrue(client == 4)
self.assertTrue(network == 2)
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-SRG1'):
+ elif nodeId == 'ROADMA01-SRG1':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-SRG3'):
+ elif nodeId == 'ROADMA01-SRG3':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG1'):
+ elif nodeId == 'ROADMA01-DEG1':
# Test related to DEG1
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG2'):
+ elif nodeId == 'ROADMA01-DEG2':
# Test related to DEG2
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
for i in range(0, nbLink):
nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
linkId = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(nodeType == 'EXPRESS-LINK'):
+ if nodeType == 'EXPRESS-LINK':
find = linkId in expressLink
self.assertEqual(find, True)
expressLink.remove(linkId)
- elif(nodeType == 'ADD-LINK'):
+ elif nodeType == 'ADD-LINK':
find = linkId in addLink
self.assertEqual(find, True)
addLink.remove(linkId)
- elif(nodeType == 'DROP-LINK'):
+ elif nodeType == 'DROP-LINK':
find = linkId in dropLink
self.assertEqual(find, True)
dropLink.remove(linkId)
- elif(nodeType == 'XPONDER-INPUT'):
+ elif nodeType == 'XPONDER-INPUT':
find = linkId in XPDR_IN
self.assertEqual(find, True)
XPDR_IN.remove(linkId)
- elif(nodeType == 'XPONDER-OUTPUT'):
+ elif nodeType == 'XPONDER-OUTPUT':
find = linkId in XPDR_OUT
self.assertEqual(find, True)
XPDR_OUT.remove(linkId)
nodeId = res['network'][0]['node'][i]['node-id']
find = nodeId in listNode
self.assertEqual(find, True)
- if(nodeId == 'NodeA'):
+ if nodeId == 'NodeA':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeA')
else:
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeC')
for i in range(0, nbNode):
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['network-ref'], 'clli-network')
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'XPDRA01'):
+ if nodeId == 'XPDRA01':
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeA')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'XPONDER')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], '1')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01'):
+ elif nodeId == 'ROADMA01':
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeA')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'ROADM')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], '2')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMC01'):
+ elif nodeId == 'ROADMC01':
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeC')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'ROADM')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], '2')
for i in range(0, nbLink):
nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
linkId = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(nodeType == 'EXPRESS-LINK'):
+ if nodeType == 'EXPRESS-LINK':
find = linkId in expressLink
self.assertEqual(find, True)
expressLink.remove(linkId)
- elif(nodeType == 'ADD-LINK'):
+ elif nodeType == 'ADD-LINK':
find = linkId in addLink
self.assertEqual(find, True)
addLink.remove(linkId)
- elif(nodeType == 'DROP-LINK'):
+ elif nodeType == 'DROP-LINK':
find = linkId in dropLink
self.assertEqual(find, True)
dropLink.remove(linkId)
- elif(nodeType == 'ROADM-TO-ROADM'):
+ elif nodeType == 'ROADM-TO-ROADM':
find = linkId in R2RLink
self.assertEqual(find, True)
R2RLink.remove(linkId)
- elif(nodeType == 'XPONDER-INPUT'):
+ elif nodeType == 'XPONDER-INPUT':
find = linkId in XPDR_IN
self.assertEqual(find, True)
XPDR_IN.remove(linkId)
- elif(nodeType == 'XPONDER-OUTPUT'):
+ elif nodeType == 'XPONDER-OUTPUT':
find = linkId in XPDR_OUT
self.assertEqual(find, True)
XPDR_OUT.remove(linkId)
'ROADMC01-DEG2-DEG2-TTP-TXRXtoROADMA01-DEG1-DEG1-TTP-TXRX']
for i in range(0, nbLink):
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(link_id in R2RLink):
+ if link_id in R2RLink:
find = False
spanLoss = (res['network'][0]['ietf-network-topology:link'][i]
['org-openroadm-network-topology:OMS-attributes']['span']["engineered-spanloss"])
length = (res['network'][0]['ietf-network-topology:link'][i]
['org-openroadm-network-topology:OMS-attributes']['span']['link-concatenation'][0]
['SRLG-length'])
- if((spanLoss != None) & (length != None)):
+ if (spanLoss != None) & (length != None):
find = True
self.assertTrue(find)
R2RLink.remove(link_id)
for i in range(0, nbNode):
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'XPDRA01-XPDR1'):
+ if nodeId == 'XPDRA01-XPDR1':
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'XPDRA01'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(nodeType, 'XPONDER')
for j in range(0, nbTps):
tpType = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j][
'org-openroadm-common-network:tp-type']
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
self.assertTrue(client == 4)
self.assertTrue(network == 2)
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-SRG1'):
+ elif nodeId == 'ROADMA01-SRG1':
# Test related to SRG1
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'tp-id': 'SRG1-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'SRG')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-SRG3'):
+ elif nodeId == 'ROADMA01-SRG3':
# Test related to SRG1
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'tp-id': 'SRG3-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'SRG')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG1'):
+ elif nodeId == 'ROADMA01-DEG1':
# Test related to DEG1
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'DEGREE')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG2'):
+ elif nodeId == 'ROADMA01-DEG2':
# Test related to DEG2
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'DEGREE')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMC01-SRG1'):
+ elif nodeId == 'ROADMC01-SRG1':
# Test related to SRG1
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'tp-id': 'SRG1-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'SRG')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMC01-DEG1'):
+ elif nodeId == 'ROADMC01-DEG1':
# Test related to DEG1
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'DEGREE')
listNode.remove(nodeId)
- elif(nodeId == 'ROADMC01-DEG2'):
+ elif nodeId == 'ROADMC01-DEG2':
# Test related to DEG2
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
nodeId = res['network'][0]['node'][i]['node-id']
find = nodeId in listNode
self.assertEqual(find, True)
- if(nodeId == 'NodeA'):
+ if nodeId == 'NodeA':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeA')
- elif(nodeId == 'NodeB'):
+ elif nodeId == 'NodeB':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeB')
else:
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeC')
'ROADMB01-DEG2-DEG2-TTP-TXRXtoROADMC01-DEG1-DEG1-TTP-TXRX']
for i in range(0, nbLink):
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(link_id in R2RLink):
+ if link_id in R2RLink:
find = False
spanLoss = res['network'][0]['ietf-network-topology:link'][i][
'org-openroadm-network-topology:OMS-attributes']['span']["engineered-spanloss"]
length = res['network'][0]['ietf-network-topology:link'][i][
'org-openroadm-network-topology:OMS-attributes']['span']['link-concatenation'][0]['SRLG-length']
- if((spanLoss != None) & (length != None)):
+ if (spanLoss != None) & (length != None):
find = True
self.assertTrue(find)
R2RLink.remove(link_id)
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
# Tests related to XPDRA nodes
- if(nodeId == 'XPDRA01-XPDR1'):
+ if nodeId == 'XPDRA01-XPDR1':
nbTp = len(res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
for j in range(0, nbTp):
tpid = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
- if (tpid == 'XPDR1-CLIENT1'):
+ if tpid == 'XPDR1-CLIENT1':
self.assertEqual(res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'], 'XPONDER-CLIENT')
- if (tpid == 'XPDR1-NETWORK1'):
+ if tpid == 'XPDR1-NETWORK1':
self.assertEqual(res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'], 'XPONDER-NETWORK')
self.assertEqual(res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'XPDRA01'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-SRG1'):
+ elif nodeId == 'ROADMA01-SRG1':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-SRG3'):
+ elif nodeId == 'ROADMA01-SRG3':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG1'):
+ elif nodeId == 'ROADMA01-DEG1':
# Test related to DEG1
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG2'):
+ elif nodeId == 'ROADMA01-DEG2':
# Test related to DEG2
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['supporting-node'])
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'ROADMA01-SRG1'):
+ if nodeId == 'ROADMA01-SRG1':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'tp-id': 'SRG1-PP1-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-SRG3'):
+ elif nodeId == 'ROADMA01-SRG3':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 17)
self.assertIn({'tp-id': 'SRG3-PP1-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG1'):
+ elif nodeId == 'ROADMA01-DEG1':
# Test related to DEG1
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertIn({'tp-id': 'DEG1-CTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-CTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADMA01-DEG2'):
+ elif nodeId == 'ROADMA01-DEG2':
# Test related to DEG2
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
for ele in liste_tp:
if ele[u'org-openroadm-common-network:tp-type'] == 'XPONDER-CLIENT':
self.assertNotIn('org-openroadm-network-topology:xpdr-client-attributes', dict.keys(ele))
- elif (ele[u'org-openroadm-common-network:tp-type'] == 'XPONDER-NETWORK'):
+ elif ele[u'org-openroadm-common-network:tp-type'] == 'XPONDER-NETWORK':
self.assertIn(u'tail-equipment-id',
dict.keys(ele[u'org-openroadm-network-topology:xpdr-network-attributes']))
self.assertNotIn('wavelength', dict.keys(
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 'SPDR-SC1-XPDR1':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
- if (tp['tp-id'] == 'XPDR1-NETWORK1'):
+ if tp['tp-id'] == 'XPDR1-NETWORK1':
xpdrTpPortConAt = tp['org-openroadm-otn-network-topology:xpdr-tp-port-connection-attributes']
self.assertEqual(len(xpdrTpPortConAt['ts-pool']), 80)
self.assertEqual(len(xpdrTpPortConAt['odtu-tpn-pool'][0]['tpn-pool']), 80)
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 'SPDR-SC1-XPDR1':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
- if (tp['tp-id'] == 'XPDR1-NETWORK1'):
+ if tp['tp-id'] == 'XPDR1-NETWORK1':
xpdrTpPortConAt = tp['org-openroadm-otn-network-topology:xpdr-tp-port-connection-attributes']
self.assertEqual(len(xpdrTpPortConAt['ts-pool']), 72)
tsPoolList = [i for i in range(1, 9)]
if (node['node-id'] == 'SPDR-SA1-XPDR1' or 'SPDR-SC1-XPDR1'):
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
- if (tp['tp-id'] == 'XPDR1-NETWORK1'):
+ if tp['tp-id'] == 'XPDR1-NETWORK1':
xpdrTpPortConAt = tp['org-openroadm-otn-network-topology:xpdr-tp-port-connection-attributes']
self.assertEqual(len(xpdrTpPortConAt['ts-pool']), 80)
self.assertEqual(len(xpdrTpPortConAt['odtu-tpn-pool'][0]['tpn-pool']), 80)
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 'SPDR-SC1-XPDR1':
tpList = node['ietf-network-topology:termination-point']
for tp in tpList:
- if (tp['tp-id'] == 'XPDR1-NETWORK1'):
+ if tp['tp-id'] == 'XPDR1-NETWORK1':
xpdrTpPortConAt = tp['org-openroadm-otn-network-topology:xpdr-tp-port-connection-attributes']
self.assertNotIn('ts-pool', dict.keys(xpdrTpPortConAt))
self.assertNotIn('odtu-tpn-pool', dict.keys(xpdrTpPortConAt))
# Tests related to nodes
self.assertEqual(response.status_code, requests.codes.ok)
self.assertIn('node', res['network'][0])
- if ('node' in res['network'][0]):
+ if 'node' in res['network'][0]:
nbNode = len(res['network'][0]['node'])
self.assertEqual(nbNode, 2)
listNode = ['SPDR-SA1-XPDR1', 'SPDR-SA1-XPDR2']
for i in range(0, nbNode):
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
- if (nodeId == 'SPDR-SA1-XPDR1'):
+ if nodeId == 'SPDR-SA1-XPDR1':
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'SPDR-SA1'},
res['network'][0]['node'][i]['supporting-node'])
self.assertIn({'network-ref': 'clli-network', 'node-ref': 'NodeSA'},
for j in range(0, nbTps):
tpType = (res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'])
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
self.assertTrue(client == 0)
self.assertTrue(network == 1)
listNode.remove(nodeId)
- elif (nodeId == 'SPDR-SA1-XPDR2'):
+ elif nodeId == 'SPDR-SA1-XPDR2':
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'SPDR-SA1'},
res['network'][0]['node'][i]['supporting-node'])
self.assertIn({'network-ref': 'clli-network', 'node-ref': 'NodeSA'},
for j in range(0, nbTps):
tpType = (res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'])
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
self.assertTrue(client == 0)
self.assertTrue(network == 4)
listNode = ['SPDR-SA1-XPDR1', 'SPDR-SA1-XPDR2']
for i in range(0, nbNode):
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'SPDR-SA1-XPDR1'):
+ if nodeId == 'SPDR-SA1-XPDR1':
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
self.assertEqual(nodeType, 'MUXPDR')
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'SPDR-SA1'},
tpType = (res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'])
tpId = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
self.assertEqual((res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-otn-network-topology:tp-supported-interfaces']
['org-openroadm-otn-network-topology:xpdr-tp-port-connection-attributes']
['rate']),
'org-openroadm-otn-common-types:ODU2e')
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
self.assertEqual((res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-otn-network-topology:tp-supported-interfaces']
for k in range(0, nbNbl):
nbl = (res['network'][0]['node'][i]['org-openroadm-otn-network-topology:switching-pools']
['odu-switching-pools'][0]['non-blocking-list'][k])
- if (nbl['nbl-number'] == 1):
+ if nbl['nbl-number'] == 1:
self.assertEqual(nbl['available-interconnect-bandwidth'], 10)
self.assertEqual(nbl['interconnect-bandwidth-unit'], 1000000000)
self.assertIn('XPDR1-NETWORK1', nbl['tp-list'])
self.assertIn('XPDR1-CLIENT1', nbl['tp-list'])
self.assertNotIn('XPDR1-CLIENT2', nbl['tp-list'])
- elif(nodeId == 'SPDR-SA1-XPDR2'):
+ elif nodeId == 'SPDR-SA1-XPDR2':
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
self.assertEqual(nodeType, 'SWITCH')
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'SPDR-SA1'},
tpType = (res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'])
tpId = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
self.assertEqual((res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-otn-network-topology:tp-supported-interfaces']
['org-openroadm-otn-network-topology:xpdr-tp-port-connection-attributes']
['rate']),
'org-openroadm-otn-common-types:ODU4')
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
self.assertEqual((res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-otn-network-topology:tp-supported-interfaces']
nbMapCurrent = 0
for j in range(0, nbTp):
tpId = resTopo['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
- if((not "CP" in tpId) and (not "CTP" in tpId)):
+ if (not "CP" in tpId) and (not "CTP" in tpId):
responseMap = test_utils.portmapping_request(nodeMapId+"/mapping/"+tpId)
self.assertEqual(responseMap.status_code, requests.codes.ok)
- if(responseMap.status_code == requests.codes.ok):
+ if responseMap.status_code == requests.codes.ok:
nbMapCurrent += 1
nbMapCumul += nbMapCurrent
nbMappings -= nbMapCurrent
res['network'][0]['node'][i]['supporting-node'])
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'ROADM-A1-SRG1'):
+ if nodeId == 'ROADM-A1-SRG1':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG3'):
+ elif nodeId == 'ROADM-A1-SRG3':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG1'):
+ elif nodeId == 'ROADM-A1-DEG1':
# Test related to DEG1
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG2'):
+ elif nodeId == 'ROADM-A1-DEG2':
# Test related to DEG2
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['network-ref'], 'clli-network')
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeA')
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'XPDR-A1'):
+ if nodeId == 'XPDR-A1':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'XPONDER')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], 'model2')
- elif(nodeId == 'ROADM-A1'):
+ elif nodeId == 'ROADM-A1':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'ROADM')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], 'model2')
else:
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
# Tests related to XPDRA nodes
- if(nodeId == 'XPDR-A1-XPDR1'):
+ if nodeId == 'XPDR-A1-XPDR1':
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'XPDR-A1'},
res['network'][0]['node'][i]['supporting-node'])
self.assertIn({'network-ref': 'clli-network', 'node-ref': 'NodeA'},
tpType = (res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'])
tpId = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
- if (tpId == 'XPDR1-NETWORK2'):
+ if tpId == 'XPDR1-NETWORK2':
self.assertEqual(res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['transportpce-topology:associated-connection-map-port'], 'XPDR1-CLIENT2')
- if (tpId == 'XPDR1-CLIENT2'):
+ if tpId == 'XPDR1-CLIENT2':
self.assertEqual(res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['transportpce-topology:associated-connection-map-port'], 'XPDR1-NETWORK2')
self.assertTrue(client == 2)
self.assertTrue(network == 2)
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG1'):
+ elif nodeId == 'ROADM-A1-SRG1':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG3'):
+ elif nodeId == 'ROADM-A1-SRG3':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG1'):
+ elif nodeId == 'ROADM-A1-DEG1':
# Test related to DEG1
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG2'):
+ elif nodeId == 'ROADM-A1-DEG2':
# Test related to DEG2
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
for i in range(0, nbLink):
nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
linkId = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(nodeType == 'EXPRESS-LINK'):
+ if nodeType == 'EXPRESS-LINK':
find = linkId in expressLink
self.assertEqual(find, True)
expressLink.remove(linkId)
- elif(nodeType == 'ADD-LINK'):
+ elif nodeType == 'ADD-LINK':
find = linkId in addLink
self.assertEqual(find, True)
addLink.remove(linkId)
- elif(nodeType == 'DROP-LINK'):
+ elif nodeType == 'DROP-LINK':
find = linkId in dropLink
self.assertEqual(find, True)
dropLink.remove(linkId)
- elif(nodeType == 'XPONDER-INPUT'):
+ elif nodeType == 'XPONDER-INPUT':
find = linkId in XPDR_IN
self.assertEqual(find, True)
XPDR_IN.remove(linkId)
- elif(nodeType == 'XPONDER-OUTPUT'):
+ elif nodeType == 'XPONDER-OUTPUT':
find = linkId in XPDR_OUT
self.assertEqual(find, True)
XPDR_OUT.remove(linkId)
nodeId = res['network'][0]['node'][i]['node-id']
find = nodeId in listNode
self.assertEqual(find, True)
- if(nodeId == 'NodeA'):
+ if nodeId == 'NodeA':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeA')
else:
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeC')
for i in range(0, nbNode):
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['network-ref'], 'clli-network')
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'XPDR-A1'):
+ if nodeId == 'XPDR-A1':
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeA')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'XPONDER')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], 'model2')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1'):
+ elif nodeId == 'ROADM-A1':
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeA')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'ROADM')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], 'model2')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-C1'):
+ elif nodeId == 'ROADM-C1':
self.assertEqual(res['network'][0]['node'][i]['supporting-node'][0]['node-ref'], 'NodeC')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'ROADM')
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-network:model'], 'model2')
for i in range(0, nbLink):
nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
linkId = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(nodeType == 'EXPRESS-LINK'):
+ if nodeType == 'EXPRESS-LINK':
find = linkId in expressLink
self.assertEqual(find, True)
expressLink.remove(linkId)
- elif(nodeType == 'ADD-LINK'):
+ elif nodeType == 'ADD-LINK':
find = linkId in addLink
self.assertEqual(find, True)
addLink.remove(linkId)
- elif(nodeType == 'DROP-LINK'):
+ elif nodeType == 'DROP-LINK':
find = linkId in dropLink
self.assertEqual(find, True)
dropLink.remove(linkId)
- elif(nodeType == 'ROADM-TO-ROADM'):
+ elif nodeType == 'ROADM-TO-ROADM':
find = linkId in R2RLink
self.assertEqual(find, True)
R2RLink.remove(linkId)
- elif(nodeType == 'XPONDER-INPUT'):
+ elif nodeType == 'XPONDER-INPUT':
find = linkId in XPDR_IN
self.assertEqual(find, True)
XPDR_IN.remove(linkId)
- elif(nodeType == 'XPONDER-OUTPUT'):
+ elif nodeType == 'XPONDER-OUTPUT':
find = linkId in XPDR_OUT
self.assertEqual(find, True)
XPDR_OUT.remove(linkId)
'ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX']
for i in range(0, nbLink):
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(link_id in R2RLink):
+ if link_id in R2RLink:
find = False
spanLoss = res['network'][0]['ietf-network-topology:link'][i][
'org-openroadm-network-topology:OMS-attributes']['span']["engineered-spanloss"]
length = res['network'][0]['ietf-network-topology:link'][i][
'org-openroadm-network-topology:OMS-attributes']['span']['link-concatenation'][0]['SRLG-length']
- if((spanLoss != None) & (length != None)):
+ if (spanLoss != None) & (length != None):
find = True
self.assertTrue(find)
R2RLink.remove(link_id)
for i in range(0, nbNode):
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'XPDR-A1-XPDR1'):
+ if nodeId == 'XPDR-A1-XPDR1':
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'XPDR-A1'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(nodeType, 'XPONDER')
for j in range(0, nbTps):
tpType = (res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type'])
- if (tpType == 'XPONDER-CLIENT'):
+ if tpType == 'XPONDER-CLIENT':
client += 1
- elif (tpType == 'XPONDER-NETWORK'):
+ elif tpType == 'XPONDER-NETWORK':
network += 1
self.assertTrue(client == 2)
self.assertTrue(network == 2)
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG1'):
+ elif nodeId == 'ROADM-A1-SRG1':
# Test related to SRG1
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'tp-id': 'SRG1-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'SRG')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG3'):
+ elif nodeId == 'ROADM-A1-SRG3':
# Test related to SRG1
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'tp-id': 'SRG3-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'SRG')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG1'):
+ elif nodeId == 'ROADM-A1-DEG1':
# Test related to DEG1
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'DEGREE')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG2'):
+ elif nodeId == 'ROADM-A1-DEG2':
# Test related to DEG2
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'DEGREE')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-C1-SRG1'):
+ elif nodeId == 'ROADM-C1-SRG1':
# Test related to SRG1
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'tp-id': 'SRG1-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP'},
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'SRG')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-C1-DEG1'):
+ elif nodeId == 'ROADM-C1-DEG1':
# Test related to DEG1
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
res['network'][0]['node'][i]['supporting-node'])
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-common-network:node-type'], 'DEGREE')
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-C1-DEG2'):
+ elif nodeId == 'ROADM-C1-DEG2':
# Test related to DEG1
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
nodeId = res['network'][0]['node'][i]['node-id']
find = nodeId in listNode
self.assertEqual(find, True)
- if(nodeId == 'NodeA'):
+ if nodeId == 'NodeA':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeA')
- elif(nodeId == 'NodeB'):
+ elif nodeId == 'NodeB':
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeB')
else:
self.assertEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeC')
'ROADM-B1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG2-DEG2-TTP-TXRX']
for i in range(0, nbLink):
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
- if(link_id in R2RLink):
+ if link_id in R2RLink:
find = False
spanLoss = res['network'][0]['ietf-network-topology:link'][i][
'org-openroadm-network-topology:OMS-attributes']['span']["engineered-spanloss"]
length = res['network'][0]['ietf-network-topology:link'][i][
'org-openroadm-network-topology:OMS-attributes']['span']['link-concatenation'][0]['SRLG-length']
- if((spanLoss != None) & (length != None)):
+ if (spanLoss != None) & (length != None):
find = True
self.assertTrue(find)
R2RLink.remove(link_id)
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
# Tests related to XPDRA nodes
- if(nodeId == 'XPDR-A1-XPDR1'):
+ if nodeId == 'XPDR-A1-XPDR1':
nbTp = len(res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
for j in range(0, nbTp):
tpid = res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]['tp-id']
- if (tpid == 'XPDR1-CLIENT1'):
+ if tpid == 'XPDR1-CLIENT1':
self.assertEqual((res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type']), 'XPONDER-CLIENT')
- if (tpid == 'XPDR1-NETWORK1'):
+ if tpid == 'XPDR1-NETWORK1':
self.assertEqual((res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
['org-openroadm-common-network:tp-type']), 'XPONDER-NETWORK')
self.assertEqual((res['network'][0]['node'][i]['ietf-network-topology:termination-point'][j]
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'XPDR-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG1'):
+ elif nodeId == 'ROADM-A1-SRG1':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG3'):
+ elif nodeId == 'ROADM-A1-SRG3':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG1'):
+ elif nodeId == 'ROADM-A1-DEG1':
# Test related to DEG1
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertIn({'network-ref': 'openroadm-network', 'node-ref': 'ROADM-A1'},
res['network'][0]['node'][i]['supporting-node'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG2'):
+ elif nodeId == 'ROADM-A1-DEG2':
# Test related to DEG2
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
res['network'][0]['node'][i]['supporting-node'])
nodeType = res['network'][0]['node'][i]['org-openroadm-common-network:node-type']
nodeId = res['network'][0]['node'][i]['node-id']
- if(nodeId == 'ROADM-A1-SRG1'):
+ if nodeId == 'ROADM-A1-SRG1':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'tp-id': 'SRG1-PP1-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-SRG3'):
+ elif nodeId == 'ROADM-A1-SRG3':
# Test related to SRG1
self.assertEqual(nodeType, 'SRG')
self.assertEqual(len(res['network'][0]['node'][i]['ietf-network-topology:termination-point']), 5)
self.assertIn({'tp-id': 'SRG3-PP1-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG1'):
+ elif nodeId == 'ROADM-A1-DEG1':
# Test related to DEG1
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},
self.assertIn({'tp-id': 'DEG1-CTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-CTP'},
res['network'][0]['node'][i]['ietf-network-topology:termination-point'])
listNode.remove(nodeId)
- elif(nodeId == 'ROADM-A1-DEG2'):
+ elif nodeId == 'ROADM-A1-DEG2':
# Test related to DEG2
self.assertEqual(nodeType, 'DEGREE')
self.assertIn({'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP'},