import unittest
import time
import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
class TransportPCEtesting(unittest.TestCase):
processes = None
+ NETWORK1_CHECK_DICT = {"logical-connection-point": "XPDR1-NETWORK1",
+ "supporting-port": "CP1-CFP0-P1",
+ "supported-interface-capability": [
+ "org-openroadm-port-types:if-OCH-OTU4-ODU4"
+ ],
+ "port-direction": "bidirectional",
+ "port-qual": "xpdr-network",
+ "supporting-circuit-pack-name": "CP1-CFP0",
+ "xponder-type": "mpdr",
+ 'lcp-hash-val': 'Swfw02qXGyI=',
+ 'port-admin-state': 'InService',
+ 'port-oper-state': 'InService'}
+ NODE_VERSION = '2.2.1'
@classmethod
def setUpClass(cls):
cls.processes = test_utils.start_tpce()
- cls.processes = test_utils.start_sims(['spdra'])
+ cls.processes = test_utils.start_sims([('spdra', cls.NODE_VERSION)])
@classmethod
def tearDownClass(cls):
time.sleep(5)
def test_01_connect_SPDR_SA1(self):
- response = test_utils.mount_device("SPDR-SA1", 'spdra')
+ response = test_utils.mount_device("SPDR-SA1", ('spdra', self.NODE_VERSION))
self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
time.sleep(10)
self.assertEqual('bidirectional', res_mapping['port-direction'])
self.assertEqual('xpdr-client', res_mapping['port-qual'])
self.assertEqual('FqlcrxV7p3g=', res_mapping['lcp-hash-val'])
+ self.assertEqual('InService', res_mapping['port-admin-state'])
+ self.assertEqual('InService', res_mapping['port-oper-state'])
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'])
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn(
- {"logical-connection-point": "XPDR1-NETWORK1",
- "supporting-port": "CP1-CFP0-P1",
- "supported-interface-capability": [
- "org-openroadm-port-types:if-OCH-OTU4-ODU4"
- ],
- "port-direction": "bidirectional",
- "port-qual": "xpdr-network",
- "supporting-circuit-pack-name": "CP1-CFP0",
- "xponder-type": "mpdr",
- 'lcp-hash-val': 'Swfw02qXGyI='},
+ self.NETWORK1_CHECK_DICT,
res['mapping'])
def test_04_service_path_create_OCH_OTU4(self):
response = test_utils.service_path_request("create", "service_OCH_OTU4", "1",
- [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}])
+ [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}],
+ 196.1, 40, 196.075, 196.125, 761,
+ 768)
time.sleep(3)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn(
{'node-id': 'SPDR-SA1',
'otu-interface-id': ['XPDR1-NETWORK1-OTU'],
- 'och-interface-id': ['XPDR1-NETWORK1-1']}, res["output"]['node-interface'])
+ 'och-interface-id': ['XPDR1-NETWORK1-761:768']}, res["output"]['node-interface'])
def test_05_get_portmapping_NETWORK1(self):
response = test_utils.portmapping_request("SPDR-SA1/mapping/XPDR1-NETWORK1")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn(
- {"logical-connection-point": "XPDR1-NETWORK1",
- "supporting-port": "CP1-CFP0-P1",
- "supported-interface-capability": [
- "org-openroadm-port-types:if-OCH-OTU4-ODU4"
- ],
- "port-direction": "bidirectional",
- "port-qual": "xpdr-network",
- "supporting-circuit-pack-name": "CP1-CFP0",
- "xponder-type": "mpdr",
- "lcp-hash-val": "Swfw02qXGyI="},
+ self.NETWORK1_CHECK_DICT,
res['mapping'])
def test_06_check_interface_och(self):
- response = test_utils.check_netconf_node_request("SPDR-SA1", "interface/XPDR1-NETWORK1-1")
+ response = test_utils.check_netconf_node_request("SPDR-SA1", "interface/XPDR1-NETWORK1-761:768")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
- self.assertDictEqual(dict(res['interface'][0], **{'name': 'XPDR1-NETWORK1-1',
+ self.assertDictEqual(dict(res['interface'][0], **{'name': 'XPDR1-NETWORK1-761:768',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP1-CFP0',
'type': 'org-openroadm-interfaces:opticalChannel',
input_dict_1 = {'name': 'XPDR1-NETWORK1-OTU',
'administrative-state': 'inService',
'supporting-circuit-pack-name': 'CP1-CFP0',
- 'supporting-interface': 'XPDR1-NETWORK1-1',
+ 'supporting-interface': 'XPDR1-NETWORK1-761:768',
'type': 'org-openroadm-interfaces:otnOtu',
'supporting-port': 'CP1-CFP0-P1'
}
response = test_utils.portmapping_request("SPDR-SA1/mapping/XPDR1-NETWORK1")
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
+ self.NETWORK1_CHECK_DICT["supporting-odu4"] = "XPDR1-NETWORK1-ODU4"
self.assertIn(
- {"logical-connection-point": "XPDR1-NETWORK1",
- "supporting-port": "CP1-CFP0-P1",
- "supported-interface-capability": [
- "org-openroadm-port-types:if-OCH-OTU4-ODU4"
- ],
- "port-direction": "bidirectional",
- "port-qual": "xpdr-network",
- "supporting-circuit-pack-name": "CP1-CFP0",
- "xponder-type": "mpdr",
- "supporting-odu4": "XPDR1-NETWORK1-ODU4",
- "lcp-hash-val": "Swfw02qXGyI="
- },
+ self.NETWORK1_CHECK_DICT,
res['mapping'])
def test_10_check_interface_ODU4(self):
def test_23_service_path_delete_OCH_OTU4(self):
response = test_utils.service_path_request("delete", "service_OCH_OTU4", "1",
- [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}])
+ [{"node-id": "SPDR-SA1", "dest-tp": "XPDR1-NETWORK1"}],
+ 196.1, 40, 196.075, 196.125, 761,
+ 768)
time.sleep(3)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()