# pylint: disable=no-member
# pylint: disable=too-many-public-methods
-import json
import time
import unittest
# pylint: disable=too-many-public-methods
import unittest
-import json
import os
import sys
import time
class TransportGNPYtesting(unittest.TestCase):
- @classmethod
- def __init_logfile(cls):
- GNPY_LOGFILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- "..", "..", "transportpce_tests", "gnpy.log")
- if os.path.isfile(GNPY_LOFGILE):
- os.remove(GNPY_LOFGILE)
-
topo_cllinet_data = None
topo_ordnet_data = None
topo_ordtopo_data = None
import unittest
import time
-import json
import requests
from common import test_utils
# pylint: disable=too-many-public-methods
import unittest
-import json
import os
import sys
import time
# pylint: disable=too-many-public-methods
import unittest
-import json
import time
import requests
from common import test_utils
responseTopo = test_utils.get_ordm_topo_request("")
resTopo = responseTopo.json()
nbNode = len(resTopo['network'][0]['node'])
- nbMapCumul = 0
- nbMappings = 0
for i in range(0, nbNode):
nodeId = resTopo['network'][0]['node'][i]['node-id']
nodeMapId = nodeId.split("-")[0]
- responseMapList = test_utils.portmapping_request(nodeMapId)
- resMapList = responseMapList.json()
- nbMappings = len(resMapList['nodes'][0]['mapping']) - nbMapCumul
+ test_utils.portmapping_request(nodeMapId)
nbTp = len(resTopo['network'][0]['node'][i]['ietf-network-topology:termination-point'])
- 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)):
- responseMap = test_utils.portmapping_request(nodeMapId+"/mapping/"+tpId)
+ test_utils.portmapping_request(nodeMapId+"/mapping/"+tpId)
# Disconnect the ROADMA
def test_03_disconnect_rdm(self):
# pylint: disable=no-member
# pylint: disable=too-many-public-methods
-import json
import time
import unittest
import requests
R2RLink = ['ROADMA01-DEG1-DEG1-TTP-TXRXtoROADMC01-DEG2-DEG2-TTP-TXRX',
'ROADMC01-DEG2-DEG2-TTP-TXRXtoROADMA01-DEG1-DEG1-TTP-TXRX']
for i in range(0, nbLink):
- nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
if(link_id in R2RLink):
find = False
'ROADMB01-DEG1-DEG1-TTP-TXRXtoROADMA01-DEG2-DEG2-TTP-TXRX',
'ROADMB01-DEG2-DEG2-TTP-TXRXtoROADMC01-DEG1-DEG1-TTP-TXRX']
for i in range(0, nbLink):
- nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
if(link_id in R2RLink):
find = False
nbNode = len(res['network'][0]['node'])
self.assertEqual(nbNode, 1)
for i in range(0, nbNode-1):
- self.assertNotEqual(res['network'][0]['node'][1]['org-openroadm-clli-network:clli'], 'NodeC')
+ self.assertNotEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeC')
def test_35_disconnect_XPDRA(self):
response = test_utils.unmount_device("XPDRA01")
# pylint: disable=too-many-public-methods
import unittest
-import json
import time
import requests
from common import test_utils
import unittest
import time
-import json
import requests
from common import test_utils
# pylint: disable=too-many-public-methods
import unittest
-import json
import time
import requests
from common import test_utils
def test_02_get_portmapping_CLIENT4(self):
response = test_utils.portmapping_request("SPDR-SA1/mapping/XPDR1-CLIENT4")
self.assertEqual(response.status_code, requests.codes.ok)
- res = response.json()
- self.assertEqual('CP1-SFP4-P1', res['mapping'][0]['supporting-port'])
- self.assertEqual('CP1-SFP4', res['mapping'][0]['supporting-circuit-pack-name'])
- self.assertEqual('XPDR1-CLIENT4', res['mapping'][0]['logical-connection-point'])
- self.assertEqual('bidirectional', res['mapping'][0]['port-direction'])
- self.assertEqual('xpdr-client', res['mapping'][0]['port-qual'])
- self.assertEqual('FqlcrxV7p3g=', res['mapping'][0]['lcp-hash-val'])
- self.assertIn('org-openroadm-port-types:if-10GE-ODU2e', res['mapping'][0]['supported-interface-capability'])
- self.assertIn('org-openroadm-port-types:if-10GE-ODU2', res['mapping'][0]['supported-interface-capability'])
- self.assertIn('org-openroadm-port-types:if-10GE', res['mapping'][0]['supported-interface-capability'])
+ res_mapping = (response.json())['mapping'][0]
+ self.assertEqual('CP1-SFP4-P1', res_mapping['supporting-port'])
+ self.assertEqual('CP1-SFP4', res_mapping['supporting-circuit-pack-name'])
+ self.assertEqual('XPDR1-CLIENT4', res_mapping['logical-connection-point'])
+ self.assertEqual('bidirectional', res_mapping['port-direction'])
+ self.assertEqual('xpdr-client', res_mapping['port-qual'])
+ self.assertEqual('FqlcrxV7p3g=', res_mapping['lcp-hash-val'])
+ self.assertIn('org-openroadm-port-types:if-10GE-ODU2e', res_mapping['supported-interface-capability'])
+ self.assertIn('org-openroadm-port-types:if-10GE-ODU2', res_mapping['supported-interface-capability'])
+ self.assertIn('org-openroadm-port-types:if-10GE', res_mapping['supported-interface-capability'])
def test_03_get_portmapping_NETWORK1(self):
response = test_utils.portmapping_request("SPDR-SA1/mapping/XPDR1-NETWORK1")
network = 0
for j in range(0, nbTps):
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'):
client += 1
elif (tpType == 'XPONDER-NETWORK'):
network = 0
for j in range(0, nbTps):
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'):
client += 1
elif (tpType == 'XPONDER-NETWORK'):
# pylint: disable=too-many-public-methods
import unittest
-import json
#from unittest.result import failfast
import requests
from common import test_utils
# pylint: disable=too-many-public-methods
import unittest
-import json
import time
import requests
from common import test_utils
import unittest
import time
-import json
import logging
import requests
from common import test_utils
R2RLink = ['ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX',
'ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX']
for i in range(0, nbLink):
- nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
if(link_id in R2RLink):
find = False
'ROADM-B1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG1-DEG1-TTP-TXRX',
'ROADM-B1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG2-DEG2-TTP-TXRX']
for i in range(0, nbLink):
- nodeType = res['network'][0]['ietf-network-topology:link'][i]['org-openroadm-common-network:link-type']
link_id = res['network'][0]['ietf-network-topology:link'][i]['link-id']
if(link_id in R2RLink):
find = False
nbNode = len(res['network'][0]['node'])
self.assertEqual(nbNode, 1)
for i in range(0, nbNode-1):
- self.assertNotEqual(res['network'][0]['node'][1]['org-openroadm-clli-network:clli'], 'NodeC')
+ self.assertNotEqual(res['network'][0]['node'][i]['org-openroadm-clli-network:clli'], 'NodeC')
def test_35_disconnect_XPDRA(self):
response = test_utils.unmount_device("XPDR-A1")