SH-Renderer API code to handle OTN Step 1
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test_otn_renderer.py
1 #!/usr/bin/env python
2
3 ##############################################################################
4 # Copyright (c) 2020 Orange, Inc. and others.  All rights reserved.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 import unittest
13 import json
14 import time
15 import requests
16 from common import test_utils
17
18
19 class TransportPCEtesting(unittest.TestCase):
20
21     processes = None
22
23     @classmethod
24     def setUpClass(cls):
25         cls.processes = test_utils.start_tpce()
26         cls.processes = test_utils.start_sims(['spdrav2'])
27
28     @classmethod
29     def tearDownClass(cls):
30         for process in cls.processes:
31             test_utils.shutdown_process(process)
32         print("all processes killed")
33
34     def setUp(self):
35         time.sleep(5)
36
37     def test_01_connect_SPDR_SA1(self):
38         response = test_utils.mount_device("SPDR-SA1", 'spdrav2')
39         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
40         time.sleep(10)
41
42         url = ("{}/operational/network-topology:"
43                "network-topology/topology/topology-netconf/node/SPDR-SA1"
44                .format(test_utils.RESTCONF_BASE_URL))
45         response = requests.request(
46             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
47         self.assertEqual(response.status_code, requests.codes.ok)
48         res = response.json()
49         self.assertEqual(
50             res['node'][0]['netconf-node-topology:connection-status'],
51             'connected')
52
53     def test_02_get_portmapping_CLIENT1(self):
54         url = ("{}/config/transportpce-portmapping:network/"
55                "nodes/SPDR-SA1/mapping/XPDR1-CLIENT1"
56                .format(test_utils.RESTCONF_BASE_URL))
57         response = requests.request(
58             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
59         self.assertEqual(response.status_code, requests.codes.ok)
60         res = response.json()
61         self.assertIn(
62             {'supported-interface-capability': [
63                 'org-openroadm-port-types:if-10GE-ODU2e',
64                 'org-openroadm-port-types:if-10GE-ODU2',
65                 'org-openroadm-port-types:if-10GE'],
66              'supporting-port': 'CP1-SFP4-P1',
67              'supporting-circuit-pack-name': 'CP1-SFP4',
68              'logical-connection-point': 'XPDR1-CLIENT1',
69              'port-direction': 'bidirectional',
70              'port-qual': 'xpdr-client',
71              'lcp-hash-val': 'FqlcrxV7p30='},
72             res['mapping'])
73
74     def test_03_get_portmapping_NETWORK1(self):
75         url = ("{}/config/transportpce-portmapping:network/"
76                "nodes/SPDR-SA1/mapping/XPDR1-NETWORK1"
77                .format(test_utils.RESTCONF_BASE_URL))
78         response = requests.request(
79             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
80         self.assertEqual(response.status_code, requests.codes.ok)
81         res = response.json()
82         self.assertIn(
83             {"logical-connection-point": "XPDR1-NETWORK1",
84              "supporting-port": "CP1-CFP0-P1",
85              "supported-interface-capability": [
86                  "org-openroadm-port-types:if-OCH-OTU4-ODU4"
87              ],
88                 "port-direction": "bidirectional",
89                 "port-qual": "xpdr-network",
90                 "supporting-circuit-pack-name": "CP1-CFP0",
91                 "xponder-type": "mpdr",
92              'lcp-hash-val': 'Swfw02qXGyI='},
93             res['mapping'])
94
95     def test_04_service_path_create_OCH_OTU4(self):
96         url = "{}/operations/transportpce-device-renderer:service-path".format(test_utils.RESTCONF_BASE_URL)
97         data = {"renderer:input": {
98             "service-name": "service_ODU4",
99             "wave-number": "1",
100             "modulation-format": "qpsk",
101             "operation": "create",
102             "nodes": [
103                 {"node-id": "SPDR-SA1",
104                  "dest-tp": "XPDR1-NETWORK1"}]}}
105         response = requests.request(
106             "POST", url, data=json.dumps(data),
107             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
108         time.sleep(3)
109         self.assertEqual(response.status_code, requests.codes.ok)
110         res = response.json()
111         self.assertIn('Roadm-connection successfully created for nodes: ', res["output"]["result"])
112         self.assertTrue(res["output"]["success"])
113         self.assertIn(
114             {'node-id': 'SPDR-SA1',
115              'otu-interface-id': ['XPDR1-NETWORK1-OTU'],
116              'och-interface-id': ['XPDR1-NETWORK1-1']}, res["output"]['node-interface'])
117
118     def test_05_get_portmapping_NETWORK1(self):
119         url = ("{}/config/transportpce-portmapping:network/"
120                "nodes/SPDR-SA1/mapping/XPDR1-NETWORK1"
121                .format(test_utils.RESTCONF_BASE_URL))
122         response = requests.request(
123             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
124         self.assertEqual(response.status_code, requests.codes.ok)
125         res = response.json()
126         self.assertIn(
127             {"logical-connection-point": "XPDR1-NETWORK1",
128              "supporting-port": "CP1-CFP0-P1",
129              "supported-interface-capability": [
130                  "org-openroadm-port-types:if-OCH-OTU4-ODU4"
131              ],
132                 "port-direction": "bidirectional",
133                 "port-qual": "xpdr-network",
134                 "supporting-circuit-pack-name": "CP1-CFP0",
135                 "xponder-type": "mpdr",
136                 "lcp-hash-val": "Swfw02qXGyI="},
137             res['mapping'])
138
139     def test_06_check_interface_och(self):
140         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
141                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
142                "interface/XPDR1-NETWORK1-1"
143                .format(test_utils.RESTCONF_BASE_URL))
144         response = requests.request(
145             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
146         self.assertEqual(response.status_code, requests.codes.ok)
147         res = response.json()
148
149         input_dict = {'name': 'XPDR1-NETWORK1-1',
150                       'administrative-state': 'inService',
151                       'supporting-circuit-pack-name': 'CP1-CFP0',
152                       'type': 'org-openroadm-interfaces:opticalChannel',
153                       'supporting-port': 'CP1-CFP0-P1'
154                       }
155         # assertDictContainsSubset is deprecated
156         '''
157         self.assertDictContainsSubset({'name': 'XPDR1-NETWORK1-1', 'administrative-state': 'inService',
158                                        'supporting-circuit-pack-name': 'CP1-CFP0',
159                                        'type': 'org-openroadm-interfaces:opticalChannel',
160                                        'supporting-port': 'CP1-CFP0-P1'}, res['interface'][0])
161         '''
162         self.assertDictEqual(dict({'name': 'XPDR1-NETWORK1-1',
163                                    'administrative-state': 'inService',
164                                    'supporting-circuit-pack-name': 'CP1-CFP0',
165                                    'type': 'org-openroadm-interfaces:opticalChannel',
166                                    'supporting-port': 'CP1-CFP0-P1'
167                                    } ,**res['interface'][0]),
168                              res['interface'][0])
169
170         self.assertDictEqual(
171             {u'frequency': 196.1, u'rate': u'org-openroadm-common-types:R100G',
172              u'transmit-power': -5},
173             res['interface'][0]['org-openroadm-optical-channel-interfaces:och'])
174
175     def test_07_check_interface_OTU(self):
176         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
177                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
178                "interface/XPDR1-NETWORK1-OTU"
179                .format(test_utils.RESTCONF_BASE_URL))
180         response = requests.request(
181             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
182         self.assertEqual(response.status_code, requests.codes.ok)
183         res = response.json()
184         input_dict_1 = {'name': 'XPDR1-NETWORK1-OTU',
185                         'administrative-state': 'inService',
186                         'supporting-circuit-pack-name': 'CP1-CFP0',
187                         'supporting-interface': 'XPDR1-NETWORK1-1',
188                         'type': 'org-openroadm-interfaces:otnOtu',
189                         'supporting-port': 'CP1-CFP0-P1'
190                         }
191
192         input_dict_2 = {'tx-dapi': 'Swfw02qXGyI=',
193                         'expected-sapi': 'Swfw02qXGyI=',
194                         'tx-sapi': 'Swfw02qXGyI=',
195                         'expected-dapi': 'Swfw02qXGyI=',
196                         'rate': 'org-openroadm-otn-common-types:OTU4',
197                         'fec': 'scfec'
198                         }
199
200         self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
201                              res['interface'][0])
202
203         self.assertDictEqual(input_dict_2,
204             res['interface'][0]['org-openroadm-otn-otu-interfaces:otu'])
205
206     def test_08_otn_service_path_create_ODU4(self):
207         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
208         data = {"renderer:input": {
209             "service-name": "service_ODU4",
210             "operation": "create",
211             "service-rate": "100G",
212             "service-type": "ODU",
213             "nodes": [
214                 {"node-id": "SPDR-SA1",
215                  "network-tp": "XPDR1-NETWORK1"}]}}
216         response = requests.request(
217             "POST", url, data=json.dumps(data),
218             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
219         time.sleep(3)
220         self.assertEqual(response.status_code, requests.codes.ok)
221         res = response.json()
222         self.assertIn('Otn Service path was set up successfully for node :SPDR-SA1', res["output"]["result"])
223         self.assertTrue(res["output"]["success"])
224         self.assertIn(
225             {'node-id': 'SPDR-SA1',
226              'odu-interface-id': ['XPDR1-NETWORK1-ODU4']}, res["output"]['node-interface'])
227
228     def test_09_get_portmapping_NETWORK1(self):
229         url = ("{}/config/transportpce-portmapping:network/"
230                "nodes/SPDR-SA1/mapping/XPDR1-NETWORK1"
231                .format(test_utils.RESTCONF_BASE_URL))
232         response = requests.request(
233             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
234         self.assertEqual(response.status_code, requests.codes.ok)
235         res = response.json()
236         self.assertIn(
237             {"logical-connection-point": "XPDR1-NETWORK1",
238              "supporting-port": "CP1-CFP0-P1",
239              "supported-interface-capability": [
240                  "org-openroadm-port-types:if-OCH-OTU4-ODU4"
241              ],
242                 "port-direction": "bidirectional",
243                 "port-qual": "xpdr-network",
244                 "supporting-circuit-pack-name": "CP1-CFP0",
245                 "xponder-type": "mpdr",
246                 "supporting-odu4": "XPDR1-NETWORK1-ODU4",
247                 "lcp-hash-val": "Swfw02qXGyI="
248              },
249             res['mapping'])
250
251     def test_10_check_interface_ODU4(self):
252         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
253                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
254                "interface/XPDR1-NETWORK1-ODU4"
255                .format(test_utils.RESTCONF_BASE_URL))
256         response = requests.request(
257             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
258         self.assertEqual(response.status_code, requests.codes.ok)
259         res = response.json()
260         input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU4', 'administrative-state': 'inService',
261                         'supporting-circuit-pack-name': 'CP1-CFP0', 'supporting-interface': 'XPDR1-NETWORK1-OTU',
262                         'type': 'org-openroadm-interfaces:otnOdu',
263                         'supporting-port': 'CP1-CFP0-P1'}
264         input_dict_2 = {'odu-function': 'org-openroadm-otn-common-types:ODU-TTP',
265                         'rate': 'org-openroadm-otn-common-types:ODU4'}
266
267         self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
268                              res['interface'][0])
269         self.assertDictEqual(dict(input_dict_2,
270                                   **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']
271                                   ),
272                                   res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']
273                              )
274         self.assertDictEqual(
275             {u'payload-type': u'21', u'exp-payload-type': u'21'},
276             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
277
278     def test_11_otn_service_path_create_10GE(self):
279         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
280         data = {"renderer:input": {
281             "service-name": "service1",
282             "operation": "create",
283             "service-rate": "10G",
284             "service-type": "Ethernet",
285             "ethernet-encoding": "eth encode",
286             "trib-slot": ["1"],
287             "trib-port-number": "1",
288             "nodes": [
289                 {"node-id": "SPDR-SA1",
290                  "client-tp": "XPDR1-CLIENT1",
291                  "network-tp": "XPDR1-NETWORK1"}]}}
292         response = requests.request(
293             "POST", url, data=json.dumps(data),
294             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
295         time.sleep(3)
296         self.assertEqual(response.status_code, requests.codes.ok)
297         res = response.json()
298         self.assertIn('Otn Service path was set up successfully for node :SPDR-SA1', res["output"]["result"])
299         self.assertTrue(res["output"]["success"])
300         self.assertIn(
301             {'node-id': 'SPDR-SA1',
302              'connection-id': ['XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1'],
303              'odu-interface-id': ['XPDR1-NETWORK1-ODU2e-service1', 'XPDR1-CLIENT1-ODU2e-service1'],
304              'eth-interface-id': ['XPDR1-CLIENT1-ETHERNET10G']}, res["output"]['node-interface'])
305
306     def test_12_check_interface_10GE_CLIENT(self):
307         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
308                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
309                "interface/XPDR1-CLIENT1-ETHERNET10G"
310                .format(test_utils.RESTCONF_BASE_URL))
311         response = requests.request(
312             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
313         self.assertEqual(response.status_code, requests.codes.ok)
314         res = response.json()
315         input_dict = {'name': 'XPDR1-CLIENT1-ETHERNET10G',
316                       'administrative-state': 'inService',
317                       'supporting-circuit-pack-name': 'CP1-SFP4',
318                       'type': 'org-openroadm-interfaces:ethernetCsmacd',
319                       'supporting-port': 'CP1-SFP4-P1'
320                       }
321         self.assertDictEqual(dict(input_dict, **res['interface'][0]),
322                              res['interface'][0])
323         self.assertDictEqual(
324             {u'speed': 10000},
325             res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
326
327     def test_13_check_interface_ODU2E_CLIENT(self):
328         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
329                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
330                "interface/XPDR1-CLIENT1-ODU2e-service1"
331                .format(test_utils.RESTCONF_BASE_URL))
332         response = requests.request(
333             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
334         self.assertEqual(response.status_code, requests.codes.ok)
335         res = response.json()
336
337         input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e-service1',
338                         'administrative-state': 'inService',
339                         'supporting-circuit-pack-name': 'CP1-SFP4',
340                         'supporting-interface': 'XPDR1-CLIENT1-ETHERNET10G',
341                         'type': 'org-openroadm-interfaces:otnOdu',
342                         'supporting-port': 'CP1-SFP4-P1'}
343         input_dict_2 = {
344             'odu-function': 'org-openroadm-otn-common-types:ODU-TTP-CTP',
345             'rate': 'org-openroadm-otn-common-types:ODU2e',
346             'monitoring-mode': 'terminated'}
347
348         self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
349                              res['interface'][0])
350         self.assertDictEqual(dict(input_dict_2,
351                              **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
352                              res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
353         self.assertDictEqual(
354             {u'payload-type': u'03', u'exp-payload-type': u'03'},
355             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
356
357     def test_14_check_interface_ODU2E_NETWORK(self):
358         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
359                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
360                "interface/XPDR1-NETWORK1-ODU2e-service1"
361                .format(test_utils.RESTCONF_BASE_URL))
362         response = requests.request(
363             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
364         self.assertEqual(response.status_code, requests.codes.ok)
365         res = response.json()
366         input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e-service1', 'administrative-state': 'inService',
367                         'supporting-circuit-pack-name': 'CP1-CFP0',
368                         'supporting-interface': 'XPDR1-NETWORK1-ODU4',
369                         'type': 'org-openroadm-interfaces:otnOdu',
370                         'supporting-port': 'CP1-CFP0-P1'}
371         input_dict_2 = {
372             'odu-function': 'org-openroadm-otn-common-types:ODU-CTP',
373             'rate': 'org-openroadm-otn-common-types:ODU2e',
374             'monitoring-mode': 'monitored'}
375
376         input_dict_3 = {'trib-port-number': 1}
377
378         self.assertDictEqual(dict(input_dict_1, **res['interface'][0]),
379                              res['interface'][0])
380         self.assertDictEqual(dict(input_dict_2,
381                              **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']),
382                              res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
383         self.assertDictEqual(dict(input_dict_3,
384                                   **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'][
385                                                   'parent-odu-allocation']),
386                              res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'][
387                                'parent-odu-allocation'])
388         self.assertIn(1,
389                       res['interface'][0][
390                           'org-openroadm-otn-odu-interfaces:odu'][
391                           'parent-odu-allocation']['trib-slots'])
392
393     def test_15_check_ODU2E_connection(self):
394         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
395                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
396                "odu-connection/XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1"
397                .format(test_utils.RESTCONF_BASE_URL))
398         response = requests.request(
399             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
400         self.assertEqual(response.status_code, requests.codes.ok)
401         res = response.json()
402         input_dict_1 = {
403             'connection-name':
404             'XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1',
405             'direction': 'bidirectional'
406         }
407
408         self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]),
409                              res['odu-connection'][0])
410         self.assertDictEqual({u'dst-if': u'XPDR1-NETWORK1-ODU2e-service1'},
411                              res['odu-connection'][0]['destination'])
412         self.assertDictEqual({u'src-if': u'XPDR1-CLIENT1-ODU2e-service1'},
413                              res['odu-connection'][0]['source'])
414
415     def test_16_otn_service_path_delete_10GE(self):
416         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
417         data = {"renderer:input": {
418             "service-name": "service1",
419             "operation": "delete",
420             "service-rate": "10G",
421             "service-type": "Ethernet",
422             "ethernet-encoding": "eth encode",
423             "trib-slot": ["1"],
424             "trib-port-number": "1",
425             "nodes": [
426                 {"node-id": "SPDR-SA1",
427                  "client-tp": "XPDR1-CLIENT1",
428                  "network-tp": "XPDR1-NETWORK1"}]}}
429         response = requests.request(
430             "POST", url, data=json.dumps(data),
431             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
432         time.sleep(3)
433         self.assertEqual(response.status_code, requests.codes.ok)
434         res = response.json()
435         self.assertIn('Request processed', res["output"]["result"])
436         self.assertTrue(res["output"]["success"])
437
438     def test_17_check_no_ODU2E_connection(self):
439         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
440                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
441                "odu-connection/XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1"
442                .format(test_utils.RESTCONF_BASE_URL))
443         response = requests.request(
444             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
445         self.assertEqual(response.status_code, requests.codes.not_found)
446
447     def test_18_check_no_interface_ODU2E_NETWORK(self):
448         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
449                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
450                "interface/XPDR1-NETWORK1-ODU2e-service1"
451                .format(test_utils.RESTCONF_BASE_URL))
452         response = requests.request(
453             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
454         self.assertEqual(response.status_code, requests.codes.not_found)
455
456     def test_19_check_no_interface_ODU2E_CLIENT(self):
457         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
458                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
459                "interface/XPDR1-CLIENT1-ODU2e-service1"
460                .format(test_utils.RESTCONF_BASE_URL))
461         response = requests.request(
462             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
463         self.assertEqual(response.status_code, requests.codes.not_found)
464
465     def test_20_check_no_interface_10GE_CLIENT(self):
466         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
467                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
468                "interface/XPDR1-CLIENT1-ETHERNET10G"
469                .format(test_utils.RESTCONF_BASE_URL))
470         response = requests.request(
471             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
472         self.assertEqual(response.status_code, requests.codes.not_found)
473
474     def test_21_otn_service_path_delete_ODU4(self):
475         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
476         data = {"renderer:input": {
477             "service-name": "service_ODU4",
478             "operation": "delete",
479             "service-rate": "100G",
480             "service-type": "ODU",
481             "nodes": [
482                 {"node-id": "SPDR-SA1",
483                  "network-tp": "XPDR1-NETWORK1"}]}}
484         response = requests.request(
485             "POST", url, data=json.dumps(data),
486             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
487         time.sleep(3)
488         self.assertEqual(response.status_code, requests.codes.ok)
489         res = response.json()
490         self.assertIn('Request processed', res["output"]["result"])
491         self.assertTrue(res["output"]["success"])
492
493     def test_22_check_no_interface_ODU4(self):
494         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
495                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
496                "interface/XPDR1-NETWORK1-ODU4"
497                .format(test_utils.RESTCONF_BASE_URL))
498         response = requests.request(
499             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
500         self.assertEqual(response.status_code, requests.codes.not_found)
501
502     def test_23_service_path_delete_OCH_OTU4(self):
503         url = "{}/operations/transportpce-device-renderer:service-path".format(test_utils.RESTCONF_BASE_URL)
504         data = {"renderer:input": {
505             "service-name": "service_OTU4",
506             "wave-number": "1",
507             "modulation-format": "qpsk",
508             "operation": "delete",
509             "nodes": [
510                 {"node-id": "SPDR-SA1",
511                  "dest-tp": "XPDR1-NETWORK1"}]}}
512         response = requests.request(
513             "POST", url, data=json.dumps(data),
514             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
515         time.sleep(3)
516         self.assertEqual(response.status_code, requests.codes.ok)
517         res = response.json()
518         self.assertIn('Request processed', res["output"]["result"])
519         self.assertTrue(res["output"]["success"])
520
521     def test_24_check_no_interface_OTU4(self):
522         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
523                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
524                "interface/XPDR1-NETWORK1-OTU"
525                .format(test_utils.RESTCONF_BASE_URL))
526         response = requests.request(
527             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
528         self.assertEqual(response.status_code, requests.codes.not_found)
529
530     def test_25_check_no_interface_OCH(self):
531         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
532                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
533                "interface/XPDR1-NETWORK1-1"
534                .format(test_utils.RESTCONF_BASE_URL))
535         response = requests.request(
536             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
537         self.assertEqual(response.status_code, requests.codes.not_found)
538
539     def test_26_disconnect_SPDR_SA1(self):
540         response = test_utils.unmount_device("SPDR-SA1")
541         self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
542
543
544 if __name__ == "__main__":
545     unittest.main(verbosity=2)