X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F2.2.1%2Ftest_renderer_service_path_nominal.py;h=9134fb92d74924550df4592558c10e6c9c345da1;hb=c8bd98e0844257ae2e40e01d54546a40596df26d;hp=57b90df4d854564b2a4b30990f5af5f9dc5ed83a;hpb=8350a4a80380419e6584f06132e27bc32525e15a;p=transportpce.git diff --git a/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py b/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py index 57b90df4d..9134fb92d 100644 --- a/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py +++ b/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py @@ -19,107 +19,39 @@ import os import psutil import shutil from unittest.result import failfast -import test_utils +from common import test_utils class TransportPCERendererTesting(unittest.TestCase): - honeynode_process1 = None - honeynode_process2 = None - odl_process = None - restconf_baseurl = "http://localhost:8181/restconf" - -# START_IGNORE_XTESTING + processes = None @classmethod def setUpClass(cls): - print("starting honeynode1...") - cls.honeynode_process1 = test_utils.start_xpdra_honeynode() - time.sleep(20) - - print("starting honeynode2...") - cls.honeynode_process2 = test_utils.start_roadma_honeynode() - time.sleep(20) - print("all honeynodes started") - - print("starting opendaylight...") - cls.odl_process = test_utils.start_tpce() - time.sleep(60) - print("opendaylight started") + cls.processes = test_utils.start_tpce() + cls.processes = test_utils.start_sims(['xpdra', 'roadma']) @classmethod def tearDownClass(cls): - for child in psutil.Process(cls.odl_process.pid).children(): - child.send_signal(signal.SIGINT) - child.wait() - cls.odl_process.send_signal(signal.SIGINT) - cls.odl_process.wait() - for child in psutil.Process(cls.honeynode_process1.pid).children(): - child.send_signal(signal.SIGINT) - child.wait() - cls.honeynode_process1.send_signal(signal.SIGINT) - cls.honeynode_process1.wait() - for child in psutil.Process(cls.honeynode_process2.pid).children(): - child.send_signal(signal.SIGINT) - child.wait() - cls.honeynode_process2.send_signal(signal.SIGINT) - cls.honeynode_process2.wait() - - def setUp(self): - print("execution of {}".format(self.id().split(".")[-1])) - time.sleep(10) - -# END_IGNORE_XTESTING + for process in cls.processes: + test_utils.shutdown_process(process) + print("all processes killed") def test_01_rdm_device_connected(self): - url = ("{}/config/network-topology:" - "network-topology/topology/topology-netconf/node/ROADM-A1" - .format(self.restconf_baseurl)) - data = {"node": [{ - "node-id": "ROADM-A1", - "netconf-node-topology:username": "admin", - "netconf-node-topology:password": "admin", - "netconf-node-topology:host": "127.0.0.1", - "netconf-node-topology:port": "17841", - "netconf-node-topology:tcp-only": "false", - "netconf-node-topology:pass-through": {}}]} - headers = {'content-type': 'application/json'} - response = requests.request( - "PUT", url, data=json.dumps(data), headers=headers, - auth=('admin', 'admin')) - self.assertIn(response.status_code, [requests.codes.created, - requests.codes.ok]) - # self.assertEqual(response.status_code, requests.codes.created) - time.sleep(20) + response = test_utils.mount_device("ROADM-A1", 'roadma') + self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201) def test_02_xpdr_device_connected(self): - url = ("{}/config/network-topology:" - "network-topology/topology/topology-netconf/node/XPDR-A1" - .format(self.restconf_baseurl)) - data = {"node": [{ - "node-id": "XPDR-A1", - "netconf-node-topology:username": "admin", - "netconf-node-topology:password": "admin", - "netconf-node-topology:host": "127.0.0.1", - "netconf-node-topology:port": "17840", - "netconf-node-topology:tcp-only": "false", - "netconf-node-topology:pass-through": {}}]} - headers = {'content-type': 'application/json'} - response = requests.request( - "PUT", url, data=json.dumps(data), headers=headers, - auth=('admin', 'admin')) - # self.assertEqual(response.status_code, requests.codes.created) - self.assertIn(response.status_code, [requests.codes.created, - requests.codes.ok]) - time.sleep(20) + response = test_utils.mount_device("XPDR-A1", 'xpdra') + self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201) def test_03_rdm_portmapping(self): url = ("{}/config/transportpce-portmapping:network/" "nodes/ROADM-A1" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertIn( @@ -134,10 +66,10 @@ class TransportPCERendererTesting(unittest.TestCase): def test_04_xpdr_portmapping(self): url = ("{}/config/transportpce-portmapping:network/" "nodes/XPDR-A1" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertIn( @@ -157,7 +89,7 @@ class TransportPCERendererTesting(unittest.TestCase): res['nodes'][0]['mapping']) def test_05_service_path_create(self): - url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl) + url = "{}/operations/transportpce-device-renderer:service-path".format(test_utils.RESTCONF_BASE_URL) data = {"renderer:input": { "renderer:service-name": "service_test", "renderer:wave-number": "7", @@ -173,7 +105,7 @@ class TransportPCERendererTesting(unittest.TestCase): headers = {'content-type': 'application/json'} response = requests.request( "POST", url, data=json.dumps(data), - headers=headers, auth=('admin', 'admin')) + headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertIn('Roadm-connection successfully created for nodes: ROADM-A1', res["output"]["result"]) @@ -182,10 +114,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/DEG1-TTP-TXRX-nmc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 @@ -207,10 +139,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/DEG1-TTP-TXRX-mc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 @@ -232,10 +164,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/SRG1-PP3-TXRX-nmc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 @@ -258,10 +190,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/SRG1-PP3-TXRX-mc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -273,10 +205,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "roadm-connections/SRG1-PP3-TXRX-DEG1-TTP-TXRX-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 @@ -298,10 +230,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-NETWORK1-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 @@ -325,10 +257,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-NETWORK1-OTU" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 @@ -352,10 +284,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-NETWORK1-ODU" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the 2 following statements replace self.assertDictContainsSubset deprecated in python 3.2 @@ -384,10 +316,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-CLIENT1-ETHERNET" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 @@ -409,10 +341,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "circuit-packs/1%2F0%2F1-PLUG-NET" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertIn('not-reserved-inuse', res['circuit-packs'][0]["equipment-state"]) @@ -421,16 +353,16 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "circuit-packs/1%2F0%2F1-PLUG-CLIENT" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertIn('not-reserved-inuse', res['circuit-packs'][0]["equipment-state"]) def test_17_service_path_delete(self): - url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl) + url = "{}/operations/transportpce-device-renderer:service-path".format(test_utils.RESTCONF_BASE_URL) data = {"renderer:input": { "renderer:service-name": "service_test", "renderer:wave-number": "7", @@ -445,7 +377,7 @@ class TransportPCERendererTesting(unittest.TestCase): headers = {'content-type': 'application/json'} response = requests.request( "POST", url, data=json.dumps(data), - headers=headers, auth=('admin', 'admin')) + headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) self.assertEqual(response.json(), { 'output': {'result': 'Request processed', 'success': True}}) @@ -454,10 +386,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/DEG1-TTP-TXRX-mc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -469,10 +401,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/DEG1-TTP-TXRX-nmc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -484,10 +416,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/SRG1-PP3-TXRX-mc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -499,10 +431,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/SRG1-PP3-TXRX-nmc-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -514,10 +446,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/ROADM-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "roadm-connections/SRG1-PP3-TXRX-DEG1-TTP-TXRX-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -529,10 +461,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-NETWORK1-7" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -544,10 +476,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-NETWORK1-OTU" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -559,10 +491,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-NETWORK1-ODU" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -574,10 +506,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "interface/XPDR1-CLIENT1-ETHERNET" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( @@ -589,10 +521,10 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "circuit-packs/1%2F0%2F1-PLUG-NET" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertEqual('not-reserved-available', res["circuit-packs"][0]['equipment-state']) @@ -601,35 +533,21 @@ class TransportPCERendererTesting(unittest.TestCase): url = ("{}/config/network-topology:network-topology/topology/topology-netconf/" "node/XPDR-A1/yang-ext:mount/org-openroadm-device:org-openroadm-device/" "circuit-packs/1%2F0%2F1-PLUG-CLIENT" - .format(self.restconf_baseurl)) + .format(test_utils.RESTCONF_BASE_URL)) headers = {'content-type': 'application/json'} response = requests.request( - "GET", url, headers=headers, auth=('admin', 'admin')) + "GET", url, headers=headers, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)) self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertEqual('not-reserved-available', res["circuit-packs"][0]['equipment-state']) def test_29_rdm_device_disconnected(self): - url = ("{}/config/network-topology:" - "network-topology/topology/topology-netconf/node/ROADM-A1" - .format(self.restconf_baseurl)) - headers = {'content-type': 'application/json'} - response = requests.request( - "DELETE", url, headers=headers, - auth=('admin', 'admin')) - self.assertEqual(response.status_code, requests.codes.ok) - time.sleep(20) + response = test_utils.unmount_device("ROADM-A1") + self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200) def test_30_xpdr_device_disconnected(self): - url = ("{}/config/network-topology:" - "network-topology/topology/topology-netconf/node/XPDR-A1" - .format(self.restconf_baseurl)) - headers = {'content-type': 'application/json'} - response = requests.request( - "DELETE", url, headers=headers, - auth=('admin', 'admin')) - self.assertEqual(response.status_code, requests.codes.ok) - time.sleep(20) + response = test_utils.unmount_device("XPDR-A1") + self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200) if __name__ == "__main__":