class TransportPCEtesting(unittest.TestCase):
- honeynode_process1 = None
+ sim_process1 = None
odl_process = None
restconf_baseurl = "http://localhost:8181/restconf"
@classmethod
def setUpClass(cls):
- print("starting honeynode1...")
- cls.honeynode_process1 = test_utils.start_spdra_honeynode()
- time.sleep(30)
-
- print("starting opendaylight...")
cls.odl_process = test_utils.start_tpce()
- time.sleep(60)
- print("opendaylight started")
+ cls.sim_process1 = test_utils.start_sim('spdrav2')
@classmethod
def tearDownClass(cls):
child.wait()
cls.odl_process.send_signal(signal.SIGINT)
cls.odl_process.wait()
- for child in psutil.Process(cls.honeynode_process1.pid).children():
+ for child in psutil.Process(cls.sim_process1.pid).children():
child.send_signal(signal.SIGINT)
child.wait()
- cls.honeynode_process1.send_signal(signal.SIGINT)
- cls.honeynode_process1.wait()
+ cls.sim_process1.send_signal(signal.SIGINT)
+ cls.sim_process1.wait()
def setUp(self):
time.sleep(5)
"netconf-node-topology:username": "admin",
"netconf-node-topology:password": "admin",
"netconf-node-topology:host": "127.0.0.1",
- "netconf-node-topology:port": "17845",
+ "netconf-node-topology:port": test_utils.sims['spdrav2']['port'],
"netconf-node-topology:tcp-only": "false",
"netconf-node-topology:pass-through": {}}]}
headers = {'content-type': 'application/json'}
'supporting-port': 'CP1-SFP4-P1',
'supporting-circuit-pack-name': 'CP1-SFP4',
'logical-connection-point': 'XPDR1-CLIENT1',
- 'port-direction': 'bidirectional',
+ 'port-direction': 'bidirectional',
'port-qual': 'xpdr-client',
- 'lcp-hash-val': '8b3efff522736722500b5e68fb6e696e'},
+ 'lcp-hash-val': '8b3efff522736722500b5e68fb6e696e'},
res['mapping'])
def test_03_get_portmapping_NETWORK1(self):
'''
self.assertDictEqual(input_dict,
extract_a_from_b(input_dict,
- res['interface'][0])
+ res['interface'][0])
)
self.assertDictEqual(
{u'frequency': 196.1, u'rate': u'org-openroadm-common-types:R100G',
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",
- "supporting-odu4": "XPDR1-NETWORK1-ODU4",
- "lcp-hash-val": "1021db8d2affe7386705c438c67ea21f"
+ "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": "1021db8d2affe7386705c438c67ea21f"
},
res['mapping'])
self.assertDictEqual(input_dict_2,
extract_a_from_b(input_dict_2,
res['interface'][0][
- 'org-openroadm-otn-odu-interfaces:odu'])
+ 'org-openroadm-otn-odu-interfaces:odu'])
)
'''
'type': 'org-openroadm-interfaces:otnOdu',
'supporting-port': 'CP1-SFP4-P1'}
input_dict_2 = {
- 'odu-function': 'org-openroadm-otn-common-types:ODU-TTP-CTP',
- 'rate': 'org-openroadm-otn-common-types:ODU2e',
- 'monitoring-mode': 'terminated'}
+ 'odu-function': 'org-openroadm-otn-common-types:ODU-TTP-CTP',
+ 'rate': 'org-openroadm-otn-common-types:ODU2e',
+ 'monitoring-mode': 'terminated'}
self.assertDictEqual(input_dict_1, extract_a_from_b(input_dict_1,
- res['interface'][0])
+ res['interface'][0])
)
self.assertDictEqual(input_dict_2,
extract_a_from_b(input_dict_2, res['interface'][0][
- 'org-openroadm-otn-odu-interfaces:odu'])
+ 'org-openroadm-otn-odu-interfaces:odu'])
)
'''
'type': 'org-openroadm-interfaces:otnOdu',
'supporting-port': 'CP1-CFP0-P1'}
input_dict_2 = {
- 'odu-function': 'org-openroadm-otn-common-types:ODU-CTP',
- 'rate': 'org-openroadm-otn-common-types:ODU2e',
- 'monitoring-mode': 'monitored'}
+ 'odu-function': 'org-openroadm-otn-common-types:ODU-CTP',
+ 'rate': 'org-openroadm-otn-common-types:ODU2e',
+ 'monitoring-mode': 'monitored'}
input_dict_3 = {'trib-port-number': 1}
self.assertDictEqual(input_dict_2,
extract_a_from_b(input_dict_2,
res['interface'][0][
- 'org-openroadm-otn-odu-interfaces:odu']
+ 'org-openroadm-otn-odu-interfaces:odu']
))
self.assertDictEqual(input_dict_3,
extract_a_from_b(input_dict_3,
res['interface'][0][
- 'org-openroadm-otn-odu-interfaces:odu'][
- 'parent-odu-allocation']))
+ 'org-openroadm-otn-odu-interfaces:odu'][
+ 'parent-odu-allocation']))
'''
self.assertDictContainsSubset({'name': 'XPDR1-NETWORK1-ODU2e-service1', 'administrative-state': 'inService',
'''
self.assertIn(1,
res['interface'][0][
- 'org-openroadm-otn-odu-interfaces:odu'][
- 'parent-odu-allocation']['trib-slots'])
+ 'org-openroadm-otn-odu-interfaces:odu'][
+ 'parent-odu-allocation']['trib-slots'])
def test_15_check_ODU2E_connection(self):
url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
input_dict_1 = {
- 'connection-name':
+ 'connection-name':
'XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1',
- 'direction': 'bidirectional'
+ 'direction': 'bidirectional'
}
self.assertDictEqual(input_dict_1,