disable failfast in rspn tests
[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         self.assertDictEqual(dict(res['interface'][0], **{'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                              res['interface'][0])
156
157         self.assertDictEqual(
158             {u'frequency': 196.1, u'rate': u'org-openroadm-common-types:R100G',
159              u'transmit-power': -5},
160             res['interface'][0]['org-openroadm-optical-channel-interfaces:och'])
161
162     def test_07_check_interface_OTU(self):
163         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
164                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
165                "interface/XPDR1-NETWORK1-OTU"
166                .format(test_utils.RESTCONF_BASE_URL))
167         response = requests.request(
168             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
169         self.assertEqual(response.status_code, requests.codes.ok)
170         res = response.json()
171         input_dict_1 = {'name': 'XPDR1-NETWORK1-OTU',
172                         'administrative-state': 'inService',
173                         'supporting-circuit-pack-name': 'CP1-CFP0',
174                         'supporting-interface': 'XPDR1-NETWORK1-1',
175                         'type': 'org-openroadm-interfaces:otnOtu',
176                         'supporting-port': 'CP1-CFP0-P1'
177                         }
178
179         input_dict_2 = {'tx-dapi': 'Swfw02qXGyI=',
180                         'expected-sapi': 'Swfw02qXGyI=',
181                         'tx-sapi': 'Swfw02qXGyI=',
182                         'expected-dapi': 'Swfw02qXGyI=',
183                         'rate': 'org-openroadm-otn-common-types:OTU4',
184                         'fec': 'scfec'
185                         }
186
187         self.assertDictEqual(dict(res['interface'][0], **input_dict_1),
188                              res['interface'][0])
189
190         self.assertDictEqual(input_dict_2,
191                              res['interface'][0]['org-openroadm-otn-otu-interfaces:otu'])
192
193     def test_08_otn_service_path_create_ODU4(self):
194         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
195         data = {"renderer:input": {
196             "service-name": "service_ODU4",
197             "operation": "create",
198             "service-rate": "100G",
199             "service-type": "ODU",
200             "nodes": [
201                 {"node-id": "SPDR-SA1",
202                  "network-tp": "XPDR1-NETWORK1"}]}}
203         response = requests.request(
204             "POST", url, data=json.dumps(data),
205             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
206         time.sleep(3)
207         self.assertEqual(response.status_code, requests.codes.ok)
208         res = response.json()
209         self.assertIn('Otn Service path was set up successfully for node :SPDR-SA1', res["output"]["result"])
210         self.assertTrue(res["output"]["success"])
211         self.assertIn(
212             {'node-id': 'SPDR-SA1',
213              'odu-interface-id': ['XPDR1-NETWORK1-ODU4']}, res["output"]['node-interface'])
214
215     def test_09_get_portmapping_NETWORK1(self):
216         url = ("{}/config/transportpce-portmapping:network/"
217                "nodes/SPDR-SA1/mapping/XPDR1-NETWORK1"
218                .format(test_utils.RESTCONF_BASE_URL))
219         response = requests.request(
220             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
221         self.assertEqual(response.status_code, requests.codes.ok)
222         res = response.json()
223         self.assertIn(
224             {"logical-connection-point": "XPDR1-NETWORK1",
225              "supporting-port": "CP1-CFP0-P1",
226              "supported-interface-capability": [
227                  "org-openroadm-port-types:if-OCH-OTU4-ODU4"
228              ],
229                 "port-direction": "bidirectional",
230                 "port-qual": "xpdr-network",
231                 "supporting-circuit-pack-name": "CP1-CFP0",
232                 "xponder-type": "mpdr",
233                 "supporting-odu4": "XPDR1-NETWORK1-ODU4",
234                 "lcp-hash-val": "Swfw02qXGyI="
235              },
236             res['mapping'])
237
238     def test_10_check_interface_ODU4(self):
239         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
240                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
241                "interface/XPDR1-NETWORK1-ODU4"
242                .format(test_utils.RESTCONF_BASE_URL))
243         response = requests.request(
244             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
245         self.assertEqual(response.status_code, requests.codes.ok)
246         res = response.json()
247         input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU4', 'administrative-state': 'inService',
248                         'supporting-circuit-pack-name': 'CP1-CFP0', 'supporting-interface': 'XPDR1-NETWORK1-OTU',
249                         'type': 'org-openroadm-interfaces:otnOdu',
250                         'supporting-port': 'CP1-CFP0-P1'}
251         input_dict_2 = {'odu-function': 'org-openroadm-otn-common-types:ODU-TTP',
252                         'rate': 'org-openroadm-otn-common-types:ODU4',
253                         'expected-dapi': 'Swfw02qXGyI=',
254                         'expected-sapi': 'Swfw02qXGyI=',
255                         'tx-dapi': 'Swfw02qXGyI=',
256                         'tx-sapi': 'Swfw02qXGyI='}
257
258         self.assertDictEqual(dict(res['interface'][0], **input_dict_1),
259                              res['interface'][0])
260         self.assertDictEqual(dict(res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'],
261                                   **input_dict_2
262                                   ),
263                              res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']
264                              )
265         self.assertDictEqual(
266             {u'payload-type': u'21', u'exp-payload-type': u'21'},
267             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
268
269     def test_11_otn_service_path_create_10GE(self):
270         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
271         data = {"renderer:input": {
272             "service-name": "service1",
273             "operation": "create",
274             "service-rate": "10G",
275             "service-type": "Ethernet",
276             "ethernet-encoding": "eth encode",
277             "trib-slot": ["1"],
278             "trib-port-number": "1",
279             "nodes": [
280                 {"node-id": "SPDR-SA1",
281                  "client-tp": "XPDR1-CLIENT1",
282                  "network-tp": "XPDR1-NETWORK1"}]}}
283         response = requests.request(
284             "POST", url, data=json.dumps(data),
285             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
286         time.sleep(3)
287         self.assertEqual(response.status_code, requests.codes.ok)
288         res = response.json()
289         self.assertIn('Otn Service path was set up successfully for node :SPDR-SA1', res["output"]["result"])
290         self.assertTrue(res["output"]["success"])
291         self.assertIn(
292             {'node-id': 'SPDR-SA1',
293              'connection-id': ['XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1'],
294              'odu-interface-id': ['XPDR1-NETWORK1-ODU2e-service1', 'XPDR1-CLIENT1-ODU2e-service1'],
295              'eth-interface-id': ['XPDR1-CLIENT1-ETHERNET10G']}, res["output"]['node-interface'])
296
297     def test_12_check_interface_10GE_CLIENT(self):
298         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
299                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
300                "interface/XPDR1-CLIENT1-ETHERNET10G"
301                .format(test_utils.RESTCONF_BASE_URL))
302         response = requests.request(
303             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
304         self.assertEqual(response.status_code, requests.codes.ok)
305         res = response.json()
306         input_dict = {'name': 'XPDR1-CLIENT1-ETHERNET10G',
307                       'administrative-state': 'inService',
308                       'supporting-circuit-pack-name': 'CP1-SFP4',
309                       'type': 'org-openroadm-interfaces:ethernetCsmacd',
310                       'supporting-port': 'CP1-SFP4-P1'
311                       }
312         self.assertDictEqual(dict(res['interface'][0], **input_dict),
313                              res['interface'][0])
314         self.assertDictEqual(
315             {u'speed': 10000},
316             res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
317
318     def test_13_check_interface_ODU2E_CLIENT(self):
319         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
320                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
321                "interface/XPDR1-CLIENT1-ODU2e-service1"
322                .format(test_utils.RESTCONF_BASE_URL))
323         response = requests.request(
324             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
325         self.assertEqual(response.status_code, requests.codes.ok)
326         res = response.json()
327
328         input_dict_1 = {'name': 'XPDR1-CLIENT1-ODU2e-service1',
329                         'administrative-state': 'inService',
330                         'supporting-circuit-pack-name': 'CP1-SFP4',
331                         'supporting-interface': 'XPDR1-CLIENT1-ETHERNET10G',
332                         'type': 'org-openroadm-interfaces:otnOdu',
333                         'supporting-port': 'CP1-SFP4-P1'}
334         input_dict_2 = {
335             'odu-function': 'org-openroadm-otn-common-types:ODU-TTP-CTP',
336             'rate': 'org-openroadm-otn-common-types:ODU2e',
337             'monitoring-mode': 'terminated'}
338
339         self.assertDictEqual(dict(res['interface'][0], **input_dict_1),
340                              res['interface'][0])
341         self.assertDictEqual(dict(res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'],
342                                   **input_dict_2),
343                              res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
344         self.assertDictEqual(
345             {u'payload-type': u'03', u'exp-payload-type': u'03'},
346             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
347
348     def test_14_check_interface_ODU2E_NETWORK(self):
349         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
350                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
351                "interface/XPDR1-NETWORK1-ODU2e-service1"
352                .format(test_utils.RESTCONF_BASE_URL))
353         response = requests.request(
354             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
355         self.assertEqual(response.status_code, requests.codes.ok)
356         res = response.json()
357         input_dict_1 = {'name': 'XPDR1-NETWORK1-ODU2e-service1', 'administrative-state': 'inService',
358                         'supporting-circuit-pack-name': 'CP1-CFP0',
359                         'supporting-interface': 'XPDR1-NETWORK1-ODU4',
360                         'type': 'org-openroadm-interfaces:otnOdu',
361                         'supporting-port': 'CP1-CFP0-P1'}
362         input_dict_2 = {
363             'odu-function': 'org-openroadm-otn-common-types:ODU-CTP',
364             'rate': 'org-openroadm-otn-common-types:ODU2e',
365             'monitoring-mode': 'monitored'}
366
367         input_dict_3 = {'trib-port-number': 1}
368
369         self.assertDictEqual(dict(res['interface'][0], **input_dict_1),
370                              res['interface'][0])
371         self.assertDictEqual(dict(res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'],
372                                   **input_dict_2),
373                              res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'])
374         self.assertDictEqual(dict(res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'][
375             'parent-odu-allocation'], **input_dict_3
376         ),
377             res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'][
378             'parent-odu-allocation'])
379         self.assertIn(1,
380                       res['interface'][0][
381                           'org-openroadm-otn-odu-interfaces:odu'][
382                           'parent-odu-allocation']['trib-slots'])
383
384     def test_15_check_ODU2E_connection(self):
385         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
386                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
387                "odu-connection/XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1"
388                .format(test_utils.RESTCONF_BASE_URL))
389         response = requests.request(
390             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
391         self.assertEqual(response.status_code, requests.codes.ok)
392         res = response.json()
393         input_dict_1 = {
394             'connection-name':
395             'XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1',
396             'direction': 'bidirectional'
397         }
398
399         self.assertDictEqual(dict(res['odu-connection'][0], **input_dict_1),
400                              res['odu-connection'][0])
401         self.assertDictEqual({u'dst-if': u'XPDR1-NETWORK1-ODU2e-service1'},
402                              res['odu-connection'][0]['destination'])
403         self.assertDictEqual({u'src-if': u'XPDR1-CLIENT1-ODU2e-service1'},
404                              res['odu-connection'][0]['source'])
405
406     def test_16_otn_service_path_delete_10GE(self):
407         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
408         data = {"renderer:input": {
409             "service-name": "service1",
410             "operation": "delete",
411             "service-rate": "10G",
412             "service-type": "Ethernet",
413             "ethernet-encoding": "eth encode",
414             "trib-slot": ["1"],
415             "trib-port-number": "1",
416             "nodes": [
417                 {"node-id": "SPDR-SA1",
418                  "client-tp": "XPDR1-CLIENT1",
419                  "network-tp": "XPDR1-NETWORK1"}]}}
420         response = requests.request(
421             "POST", url, data=json.dumps(data),
422             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
423         time.sleep(3)
424         self.assertEqual(response.status_code, requests.codes.ok)
425         res = response.json()
426         self.assertIn('Request processed', res["output"]["result"])
427         self.assertTrue(res["output"]["success"])
428
429     def test_17_check_no_ODU2E_connection(self):
430         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
431                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
432                "odu-connection/XPDR1-CLIENT1-ODU2e-service1-x-XPDR1-NETWORK1-ODU2e-service1"
433                .format(test_utils.RESTCONF_BASE_URL))
434         response = requests.request(
435             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
436         self.assertEqual(response.status_code, requests.codes.not_found)
437
438     def test_18_check_no_interface_ODU2E_NETWORK(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                "interface/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_19_check_no_interface_ODU2E_CLIENT(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-CLIENT1-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_20_check_no_interface_10GE_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-ETHERNET10G"
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_21_otn_service_path_delete_ODU4(self):
466         url = "{}/operations/transportpce-device-renderer:otn-service-path".format(test_utils.RESTCONF_BASE_URL)
467         data = {"renderer:input": {
468             "service-name": "service_ODU4",
469             "operation": "delete",
470             "service-rate": "100G",
471             "service-type": "ODU",
472             "nodes": [
473                 {"node-id": "SPDR-SA1",
474                  "network-tp": "XPDR1-NETWORK1"}]}}
475         response = requests.request(
476             "POST", url, data=json.dumps(data),
477             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
478         time.sleep(3)
479         self.assertEqual(response.status_code, requests.codes.ok)
480         res = response.json()
481         self.assertIn('Request processed', res["output"]["result"])
482         self.assertTrue(res["output"]["success"])
483
484     def test_22_check_no_interface_ODU4(self):
485         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
486                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
487                "interface/XPDR1-NETWORK1-ODU4"
488                .format(test_utils.RESTCONF_BASE_URL))
489         response = requests.request(
490             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
491         self.assertEqual(response.status_code, requests.codes.not_found)
492
493     def test_23_service_path_delete_OCH_OTU4(self):
494         url = "{}/operations/transportpce-device-renderer:service-path".format(test_utils.RESTCONF_BASE_URL)
495         data = {"renderer:input": {
496             "service-name": "service_OTU4",
497             "wave-number": "1",
498             "modulation-format": "qpsk",
499             "operation": "delete",
500             "nodes": [
501                 {"node-id": "SPDR-SA1",
502                  "dest-tp": "XPDR1-NETWORK1"}]}}
503         response = requests.request(
504             "POST", url, data=json.dumps(data),
505             headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
506         time.sleep(3)
507         self.assertEqual(response.status_code, requests.codes.ok)
508         res = response.json()
509         self.assertIn('Request processed', res["output"]["result"])
510         self.assertTrue(res["output"]["success"])
511
512     def test_24_check_no_interface_OTU4(self):
513         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
514                "node/SPDR-SA1/yang-ext:mount/org-openroadm-device:org-openroadm-device/"
515                "interface/XPDR1-NETWORK1-OTU"
516                .format(test_utils.RESTCONF_BASE_URL))
517         response = requests.request(
518             "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
519         self.assertEqual(response.status_code, requests.codes.not_found)
520
521     def test_25_check_no_interface_OCH(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-1"
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_26_disconnect_SPDR_SA1(self):
531         response = test_utils.unmount_device("SPDR-SA1")
532         self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
533
534
535 if __name__ == "__main__":
536     unittest.main(verbosity=2)