fix some pylint issues
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_end2end.py
index b5c7711fae5df4f066d2850db850a9e4887a88b5..f23790b3ba0aafcccd32950d7dd5b7b7820da76a 100644 (file)
 
 
 import json
-import signal
 import time
 import unittest
 
-import psutil
 import requests
-import test_utils
+from common import test_utils
 
 
 class TransportPCEFulltesting(unittest.TestCase):
-    headers = {'content-type': 'application/json'}
-    odl_process = None
-    honeynode_process1 = None
-    honeynode_process2 = None
-    honeynode_process3 = None
-    honeynode_process4 = None
-    restconf_baseurl = "http://localhost:8181/restconf"
+
     WAITING = 20  # nominal value is 300
 
-    #  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_full_honeynode()
-        time.sleep(20)
-
-        print("starting honeynode3...")
-        cls.honeynode_process3 = test_utils.start_roadmc_full_honeynode()
-        time.sleep(20)
-
-        print("starting honeynode4...")
-        cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
-        time.sleep(20)
-        print("all honeynodes started")
-
-        print("starting opendaylight...")
-        cls.odl_process = test_utils.start_tpce()
-        time.sleep(80)
-        print("opendaylight started")
+        cls.processes = test_utils.start_tpce()
+        cls.processes = test_utils.start_sims(['xpdra', 'roadma-full', 'roadmc-full', 'xpdrc'])
 
     @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()
-        for child in psutil.Process(cls.honeynode_process3.pid).children():
-            child.send_signal(signal.SIGINT)
-            child.wait()
-        cls.honeynode_process3.send_signal(signal.SIGINT)
-        cls.honeynode_process3.wait()
-        for child in psutil.Process(cls.honeynode_process4.pid).children():
-            child.send_signal(signal.SIGINT)
-            child.wait()
-        cls.honeynode_process4.send_signal(signal.SIGINT)
-        cls.honeynode_process4.wait()
+        for process in cls.processes:
+            test_utils.shutdown_process(process)
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
         print("execution of {}".format(self.id().split(".")[-1]))
 
-    # END_IGNORE_XTESTING
-
     #  connect netconf devices
     def test_01_connect_xpdrA(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/XPDRA01"
-               .format(self.restconf_baseurl))
-        data = {"node": [{
-          "node-id": "XPDRA01",
-          "netconf-node-topology:username": "admin",
-          "netconf-node-topology:password": "admin",
-          "netconf-node-topology:host": "127.0.0.1",
-          "netconf-node-topology:port": "17830",
-          "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)
-        time.sleep(20)
+        response = test_utils.mount_device("XPDRA01", 'xpdra')
+        self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_connect_xpdrC(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/XPDRC01"
-               .format(self.restconf_baseurl))
-        data = {"node": [{
-          "node-id": "XPDRC01",
-          "netconf-node-topology:username": "admin",
-          "netconf-node-topology:password": "admin",
-          "netconf-node-topology:host": "127.0.0.1",
-          "netconf-node-topology:port": "17834",
-          "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)
-        time.sleep(20)
+        response = test_utils.mount_device("XPDRC01", 'xpdrc')
+        self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_connect_rdmA(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/ROADMA01"
-               .format(self.restconf_baseurl))
-        data = {"node": [{
-          "node-id": "ROADMA01",
-          "netconf-node-topology:username": "admin",
-          "netconf-node-topology:password": "admin",
-          "netconf-node-topology:host": "127.0.0.1",
-          "netconf-node-topology:port": "17821",
-          "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)
-        time.sleep(20)
+        response = test_utils.mount_device("ROADMA01", 'roadma-full')
+        self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_04_connect_rdmC(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/ROADMC01"
-               .format(self.restconf_baseurl))
-        data = {"node": [{
-          "node-id": "ROADMC01",
-          "netconf-node-topology:username": "admin",
-          "netconf-node-topology:password": "admin",
-          "netconf-node-topology:host": "127.0.0.1",
-          "netconf-node-topology:port": "17823",
-          "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)
-        time.sleep(20)
+        response = test_utils.mount_device("ROADMC01", 'roadmc-full')
+        self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_05_connect_xprdA_N1_to_roadmA_PP1(self):
         url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
-          "networkutils:input": {
-            "networkutils:links-input": {
-              "networkutils:xpdr-node": "XPDRA01",
-              "networkutils:xpdr-num": "1",
-              "networkutils:network-num": "1",
-              "networkutils:rdm-node": "ROADMA01",
-              "networkutils:srg-num": "1",
-              "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+            "networkutils:input": {
+                "networkutils:links-input": {
+                    "networkutils:xpdr-node": "XPDRA01",
+                    "networkutils:xpdr-num": "1",
+                    "networkutils:network-num": "1",
+                    "networkutils:rdm-node": "ROADMA01",
+                    "networkutils:srg-num": "1",
+                    "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+                }
             }
-          }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Xponder Roadm Link created successfully',
@@ -193,23 +80,22 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_06_connect_roadmA_PP1_to_xpdrA_N1(self):
         url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
-          "networkutils:input": {
-            "networkutils:links-input": {
-              "networkutils:xpdr-node": "XPDRA01",
-              "networkutils:xpdr-num": "1",
-              "networkutils:network-num": "1",
-              "networkutils:rdm-node": "ROADMA01",
-              "networkutils:srg-num": "1",
-              "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+            "networkutils:input": {
+                "networkutils:links-input": {
+                    "networkutils:xpdr-node": "XPDRA01",
+                    "networkutils:xpdr-num": "1",
+                    "networkutils:network-num": "1",
+                    "networkutils:rdm-node": "ROADMA01",
+                    "networkutils:srg-num": "1",
+                    "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+                }
             }
-          }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm Xponder links created successfully',
@@ -218,23 +104,22 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_07_connect_xprdC_N1_to_roadmC_PP1(self):
         url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
-          "networkutils:input": {
-            "networkutils:links-input": {
-              "networkutils:xpdr-node": "XPDRC01",
-              "networkutils:xpdr-num": "1",
-              "networkutils:network-num": "1",
-              "networkutils:rdm-node": "ROADMC01",
-              "networkutils:srg-num": "1",
-              "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+            "networkutils:input": {
+                "networkutils:links-input": {
+                    "networkutils:xpdr-node": "XPDRC01",
+                    "networkutils:xpdr-num": "1",
+                    "networkutils:network-num": "1",
+                    "networkutils:rdm-node": "ROADMC01",
+                    "networkutils:srg-num": "1",
+                    "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+                }
             }
-          }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Xponder Roadm Link created successfully',
@@ -243,23 +128,22 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_08_connect_roadmC_PP1_to_xpdrC_N1(self):
         url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
-          "networkutils:input": {
-            "networkutils:links-input": {
-              "networkutils:xpdr-node": "XPDRC01",
-              "networkutils:xpdr-num": "1",
-              "networkutils:network-num": "1",
-              "networkutils:rdm-node": "ROADMC01",
-              "networkutils:srg-num": "1",
-              "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+            "networkutils:input": {
+                "networkutils:links-input": {
+                    "networkutils:xpdr-node": "XPDRC01",
+                    "networkutils:xpdr-num": "1",
+                    "networkutils:network-num": "1",
+                    "networkutils:rdm-node": "ROADMC01",
+                    "networkutils:srg-num": "1",
+                    "networkutils:termination-point-num": "SRG1-PP1-TXRX"
+                }
             }
-          }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm Xponder links created successfully',
@@ -269,12 +153,12 @@ class TransportPCEFulltesting(unittest.TestCase):
     def test_09_add_omsAttributes_ROADMA_ROADMC(self):
         # Config ROADMA-ROADMC oms-attributes
         url = (
-          "{}/config/ietf-network:"
-          "networks/network/openroadm-topology/ietf-network-topology:"
-          "link/ROADMA01-DEG1-DEG1-TTP-TXRXtoROADMC01-DEG2-DEG2-TTP-TXRX/"
-          "org-openroadm-network-topology:"
-          "OMS-attributes/span"
-          .format(self.restconf_baseurl))
+            "{}/config/ietf-network:"
+            "networks/network/openroadm-topology/ietf-network-topology:"
+            "link/ROADMA01-DEG1-DEG1-TTP-TXRXtoROADMC01-DEG2-DEG2-TTP-TXRX/"
+            "org-openroadm-network-topology:"
+            "OMS-attributes/span"
+            .format(test_utils.RESTCONF_BASE_URL))
         data = {"span": {
             "clfi": "fiber1",
             "auto-spanloss": "true",
@@ -286,42 +170,40 @@ class TransportPCEFulltesting(unittest.TestCase):
                 "fiber-type": "smf",
                 "SRLG-length": 100000,
                 "pmd": 0.5}]}}
-        headers = {'content-type': 'application/json'}
         response = requests.request(
-            "PUT", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "PUT", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.created)
 
     def test_10_add_omsAttributes_ROADMC_ROADMA(self):
         # Config ROADMC-ROADMA oms-attributes
         url = (
-          "{}/config/ietf-network:"
-          "networks/network/openroadm-topology/ietf-network-topology:"
-          "link/ROADMC01-DEG2-DEG2-TTP-TXRXtoROADMA01-DEG1-DEG1-TTP-TXRX/"
-          "org-openroadm-network-topology:"
-          "OMS-attributes/span"
-          .format(self.restconf_baseurl))
+            "{}/config/ietf-network:"
+            "networks/network/openroadm-topology/ietf-network-topology:"
+            "link/ROADMC01-DEG2-DEG2-TTP-TXRXtoROADMA01-DEG1-DEG1-TTP-TXRX/"
+            "org-openroadm-network-topology:"
+            "OMS-attributes/span"
+            .format(test_utils.RESTCONF_BASE_URL))
         data = {"span": {
-          "clfi": "fiber1",
-          "auto-spanloss": "true",
-          "spanloss-base": 11.4,
-          "spanloss-current": 12,
-          "engineered-spanloss": 12.2,
-          "link-concatenation": [{
-            "SRLG-Id": 0,
-            "fiber-type": "smf",
-            "SRLG-length": 100000,
-            "pmd": 0.5}]}}
-        headers = {'content-type': 'application/json'}
+            "clfi": "fiber1",
+            "auto-spanloss": "true",
+            "spanloss-base": 11.4,
+            "spanloss-current": 12,
+            "engineered-spanloss": 12.2,
+            "link-concatenation": [{
+                "SRLG-Id": 0,
+                "fiber-type": "smf",
+                "SRLG-length": 100000,
+                "pmd": 0.5}]}}
         response = requests.request(
-            "PUT", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "PUT", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.created)
 
     # test service-create for Eth service from xpdr to xpdr
     def test_11_create_eth_service1(self):
         url = ("{}/operations/org-openroadm-service:service-create"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {
             "input": {
                 "sdnc-request-header": {
@@ -420,25 +302,21 @@ class TransportPCEFulltesting(unittest.TestCase):
                 "operator-contact": "pw1234"
             }
         }
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
                       res['output']['configuration-response-common'][
-                        'response-message'])
+                          'response-message'])
         time.sleep(self.WAITING)
 
     def test_12_get_eth_service1(self):
         url = ("{}/operational/org-openroadm-service:service-list/services/"
-               "service1".format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
+               "service1".format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(
@@ -459,18 +337,21 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node/ROADMA01/yang-ext:"
             "mount/org-openroadm-device:org-openroadm-device/"
             "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-1"
-            .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json'}
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertDictContainsSubset(
-            {'connection-number': 'SRG1-PP1-TXRX-DEG1-TTP-TXRX-1',
-             'wavelength-number': 1,
-             'opticalControlMode': 'gainLoss',
-             'target-output-power': -3.0},
-            res['roadm-connections'][0])
+        # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2
+        self.assertDictEqual(
+            dict({
+                'connection-number': 'SRG1-PP1-TXRX-DEG1-TTP-TXRX-1',
+                'wavelength-number': 1,
+                'opticalControlMode': 'gainLoss',
+                'target-output-power': -3.0
+            }, **res['roadm-connections'][0]),
+            res['roadm-connections'][0]
+        )
         self.assertDictEqual(
             {'src-if': 'SRG1-PP1-TXRX-1'},
             res['roadm-connections'][0]['source'])
@@ -486,18 +367,21 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node/ROADMC01/yang-ext:mount/org-openroadm-device:"
             "org-openroadm-device/"
             "roadm-connections/SRG1-PP1-TXRX-DEG2-TTP-TXRX-1"
-            .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json'}
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertDictContainsSubset(
-            {'connection-number': 'SRG1-PP1-TXRX-DEG2-TTP-TXRX-1',
-             'wavelength-number': 1,
-             'opticalControlMode': 'gainLoss',
-             'target-output-power': 2.0},
-            res['roadm-connections'][0])
+        # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2
+        self.assertDictEqual(
+            dict({
+                'connection-number': 'SRG1-PP1-TXRX-DEG2-TTP-TXRX-1',
+                'wavelength-number': 1,
+                'opticalControlMode': 'gainLoss',
+                'target-output-power': 2.0
+            }, **res['roadm-connections'][0]),
+            res['roadm-connections'][0]
+        )
         self.assertDictEqual(
             {'src-if': 'SRG1-PP1-TXRX-1'},
             res['roadm-connections'][0]['source'])
@@ -510,21 +394,17 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/XPDRA01-XPDR1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         liste_tp = res['node'][0]['ietf-network-topology:termination-point']
         for ele in liste_tp:
             if ele['tp-id'] == 'XPDR1-NETWORK1':
                 self.assertEqual({u'frequency': 196.1, u'width': 40},
-                                 ele[
-                                     'org-openroadm-network-topology:'
-                                     'xpdr-network-attributes'][
-                                     'wavelength'])
-            if ele['tp-id'] == 'XPDR1-CLIENT1' or \
-               ele['tp-id'] == 'XPDR1-CLIENT3':
+                                 ele['org-openroadm-network-topology:xpdr-network-attributes']['wavelength'])
+            if ele['tp-id'] == 'XPDR1-CLIENT1' or ele['tp-id'] == 'XPDR1-CLIENT3':
                 self.assertNotIn(
                     'org-openroadm-network-topology:xpdr-client-attributes',
                     dict.keys(ele))
@@ -538,9 +418,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/ROADMA01-SRG1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertNotIn({u'index': 1},
@@ -562,9 +442,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/ROADMA01-DEG1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertNotIn({u'index': 1},
@@ -588,7 +468,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_18_connect_xprdA_N2_to_roadmA_PP2(self):
         url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -601,10 +481,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 }
             }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Xponder Roadm Link created successfully',
@@ -613,7 +492,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_19_connect_roadmA_PP2_to_xpdrA_N2(self):
         url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -626,10 +505,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 }
             }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm Xponder links created successfully',
@@ -638,7 +516,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_20_connect_xprdC_N2_to_roadmC_PP2(self):
         url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -651,10 +529,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 }
             }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Xponder Roadm Link created successfully',
@@ -663,7 +540,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_21_connect_roadmC_PP2_to_xpdrC_N2(self):
         url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".\
-            format(self.restconf_baseurl)
+            format(test_utils.RESTCONF_BASE_URL)
         data = {
             "networkutils:input": {
                 "networkutils:links-input": {
@@ -676,10 +553,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 }
             }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
             "POST", url, data=json.dumps(data),
-            headers=headers, auth=('admin', 'admin'))
+            headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm Xponder links created successfully',
@@ -688,7 +564,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_22_create_eth_service2(self):
         url = ("{}/operations/org-openroadm-service:service-create"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {
             "input": {
                 "sdnc-request-header": {
@@ -787,11 +663,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 "operator-contact": "pw1234"
             }
         }
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -802,11 +676,9 @@ class TransportPCEFulltesting(unittest.TestCase):
     def test_23_get_eth_service2(self):
         url = ("{}/operational/org-openroadm-service:"
                "service-list/services/service2"
-               .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
+               .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(
@@ -827,17 +699,20 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node/ROADMA01/yang-ext:"
             "mount/org-openroadm-device:org-openroadm-device/"
             "roadm-connections/DEG1-TTP-TXRX-SRG1-PP2-TXRX-2"
-            .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json'}
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertDictContainsSubset(
-            {'connection-number': 'DEG1-TTP-TXRX-SRG1-PP2-TXRX-2',
-             'wavelength-number': 2,
-             'opticalControlMode': 'power'},
-            res['roadm-connections'][0])
+        # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2
+        self.assertDictEqual(
+            dict({
+                 'connection-number': 'DEG1-TTP-TXRX-SRG1-PP2-TXRX-2',
+                 'wavelength-number': 2,
+                 'opticalControlMode': 'power'
+                 }, **res['roadm-connections'][0]),
+            res['roadm-connections'][0]
+        )
         self.assertDictEqual(
             {'src-if': 'DEG1-TTP-TXRX-2'},
             res['roadm-connections'][0]['source'])
@@ -849,9 +724,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/XPDRA01-XPDR1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         liste_tp = res['node'][0]['ietf-network-topology:termination-point']
@@ -877,9 +752,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/ROADMA01-SRG1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertNotIn({u'index': 1}, res['node'][0][
@@ -915,9 +790,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/ROADMA01-DEG1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertNotIn({u'index': 1}, res['node'][0][
@@ -947,7 +822,7 @@ class TransportPCEFulltesting(unittest.TestCase):
     #     creation service test on a non-available resource
     def test_28_create_eth_service3(self):
         url = ("{}/operations/org-openroadm-service:service-create"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {
             "input": {
                 "sdnc-request-header": {
@@ -1046,11 +921,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 "operator-contact": "pw1234"
             }
         }
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -1065,7 +938,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_29_delete_eth_service3(self):
         url = ("{}/operations/org-openroadm-service:service-delete"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {"input": {
             "sdnc-request-header": {
                 "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
@@ -1080,10 +953,9 @@ class TransportPCEFulltesting(unittest.TestCase):
             }
         }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Service \'service3\' does not exist in datastore',
@@ -1095,7 +967,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_30_delete_eth_service1(self):
         url = ("{}/operations/org-openroadm-service:service-delete"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {"input": {
             "sdnc-request-header": {
                 "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
@@ -1110,10 +982,9 @@ class TransportPCEFulltesting(unittest.TestCase):
             }
         }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Renderer service delete in progress',
@@ -1123,7 +994,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_31_delete_eth_service2(self):
         url = ("{}/operations/org-openroadm-service:service-delete"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {"input": {
             "sdnc-request-header": {
                 "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
@@ -1138,10 +1009,9 @@ class TransportPCEFulltesting(unittest.TestCase):
             }
         }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Renderer service delete in progress',
@@ -1155,9 +1025,9 @@ class TransportPCEFulltesting(unittest.TestCase):
             "network-topology/topology/topology-netconf/"
             "node/ROADMA01/yang-ext:"
             "mount/org-openroadm-device:org-openroadm-device/"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, auth=('admin', 'admin'))
+            "GET", url, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         res = response.json()
         self.assertEqual(response.status_code, requests.codes.ok)
         self.assertNotIn('roadm-connections',
@@ -1168,9 +1038,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/XPDRA01-XPDR1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         liste_tp = res['node'][0]['ietf-network-topology:termination-point']
@@ -1196,9 +1066,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/ROADMA01-SRG1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn({u'index': 1}, res['node'][0][
@@ -1222,9 +1092,9 @@ class TransportPCEFulltesting(unittest.TestCase):
         url1 = (
             "{}/config/ietf-network:"
             "networks/network/openroadm-topology/node/ROADMA01-DEG1"
-            .format(self.restconf_baseurl))
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url1, auth=('admin', 'admin'))
+            "GET", url1, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn({u'index': 1}, res['node'][0][
@@ -1246,7 +1116,7 @@ class TransportPCEFulltesting(unittest.TestCase):
     # test service-create for Optical Channel (OC) service from srg-pp to srg-pp
     def test_36_create_oc_service1(self):
         url = ("{}/operations/org-openroadm-service:service-create"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {
             "input": {
                 "sdnc-request-header": {
@@ -1345,11 +1215,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 "operator-contact": "pw1234"
             }
         }
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -1360,11 +1228,9 @@ class TransportPCEFulltesting(unittest.TestCase):
     def test_37_get_oc_service1(self):
         url = ("{}/operational/org-openroadm-service:"
                "service-list/services/service1"
-               .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
+               .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(
@@ -1385,18 +1251,21 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node/ROADMA01/yang-ext:"
             "mount/org-openroadm-device:org-openroadm-device/"
             "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-1"
-            .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json'}
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertDictContainsSubset(
-            {'connection-number': 'SRG1-PP1-TXRX-DEG1-TTP-TXRX-1',
-             'wavelength-number': 1,
-             'opticalControlMode': 'gainLoss',
-             'target-output-power': -3.0},
-            res['roadm-connections'][0])
+        # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2
+        self.assertDictEqual(
+            dict({
+                'connection-number': 'SRG1-PP1-TXRX-DEG1-TTP-TXRX-1',
+                'wavelength-number': 1,
+                'opticalControlMode': 'gainLoss',
+                'target-output-power': -3.0
+            }, **res['roadm-connections'][0]),
+            res['roadm-connections'][0]
+        )
         self.assertDictEqual(
             {'src-if': 'SRG1-PP1-TXRX-1'},
             res['roadm-connections'][0]['source'])
@@ -1412,18 +1281,21 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node/ROADMC01/yang-ext:mount/org-openroadm-device:"
             "org-openroadm-device/"
             "roadm-connections/SRG1-PP1-TXRX-DEG2-TTP-TXRX-1"
-            .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json'}
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertDictContainsSubset(
-            {'connection-number': 'SRG1-PP1-TXRX-DEG2-TTP-TXRX-1',
-             'wavelength-number': 1,
-             'opticalControlMode': 'gainLoss',
-             'target-output-power': 2.0},
-            res['roadm-connections'][0])
+        # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2
+        self.assertDictEqual(
+            dict({
+                'connection-number': 'SRG1-PP1-TXRX-DEG2-TTP-TXRX-1',
+                'wavelength-number': 1,
+                'opticalControlMode': 'gainLoss',
+                'target-output-power': 2.0
+            }, **res['roadm-connections'][0]),
+            res['roadm-connections'][0]
+        )
         self.assertDictEqual(
             {'src-if': 'SRG1-PP1-TXRX-1'},
             res['roadm-connections'][0]['source'])
@@ -1434,7 +1306,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_40_create_oc_service2(self):
         url = ("{}/operations/org-openroadm-service:service-create"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {
             "input": {
                 "sdnc-request-header": {
@@ -1533,11 +1405,9 @@ class TransportPCEFulltesting(unittest.TestCase):
                 "operator-contact": "pw1234"
             }
         }
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('PCE calculation in progress',
@@ -1548,11 +1418,9 @@ class TransportPCEFulltesting(unittest.TestCase):
     def test_41_get_oc_service2(self):
         url = ("{}/operational/org-openroadm-service:"
                "service-list/services/service2"
-               .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
+               .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual(
@@ -1573,18 +1441,21 @@ class TransportPCEFulltesting(unittest.TestCase):
             "node/ROADMA01/yang-ext:mount/org-openroadm-device:"
             "org-openroadm-device/"
             "roadm-connections/SRG1-PP2-TXRX-DEG1-TTP-TXRX-2"
-            .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json'}
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertDictContainsSubset(
-            {'connection-number': 'SRG1-PP2-TXRX-DEG1-TTP-TXRX-2',
-             'wavelength-number': 2,
-             'opticalControlMode': 'gainLoss',
-             'target-output-power': -3.0},
-            res['roadm-connections'][0])
+        # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2
+        self.assertDictEqual(
+            dict({
+                'connection-number': 'SRG1-PP2-TXRX-DEG1-TTP-TXRX-2',
+                'wavelength-number': 2,
+                'opticalControlMode': 'gainLoss',
+                'target-output-power': -3.0
+            }, **res['roadm-connections'][0]),
+            res['roadm-connections'][0]
+        )
         self.assertDictEqual(
             {'src-if': 'SRG1-PP2-TXRX-2'},
             res['roadm-connections'][0]['source'])
@@ -1600,7 +1471,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_44_delete_oc_service1(self):
         url = ("{}/operations/org-openroadm-service:service-delete"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {"input": {
             "sdnc-request-header": {
                 "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
@@ -1615,10 +1486,9 @@ class TransportPCEFulltesting(unittest.TestCase):
             }
         }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Renderer service delete in progress',
@@ -1628,7 +1498,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_45_delete_oc_service2(self):
         url = ("{}/operations/org-openroadm-service:service-delete"
-               .format(self.restconf_baseurl))
+               .format(test_utils.RESTCONF_BASE_URL))
         data = {"input": {
             "sdnc-request-header": {
                 "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
@@ -1643,10 +1513,9 @@ class TransportPCEFulltesting(unittest.TestCase):
             }
         }
         }
-        headers = {'content-type': 'application/json'}
         response = requests.request(
-            "POST", url, data=json.dumps(data), headers=headers,
-            auth=('admin', 'admin'))
+            "POST", url, data=json.dumps(data), headers=test_utils.TYPE_APPLICATION_JSON,
+            auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Renderer service delete in progress',
@@ -1657,11 +1526,9 @@ class TransportPCEFulltesting(unittest.TestCase):
     def test_46_get_no_oc_services(self):
         print("start test")
         url = ("{}/operational/org-openroadm-service:service-list"
-               .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
+               .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.not_found)
         res = response.json()
         self.assertIn(
@@ -1681,11 +1548,9 @@ class TransportPCEFulltesting(unittest.TestCase):
             "network-topology/topology/topology-netconf"
             "/node/ROADMA01/yang-ext:mount/org-openroadm-device:"
             "org-openroadm-device/"
-            .format(self.restconf_baseurl))
-        headers = {'content-type': 'application/json',
-                   "Accept": "application/json"}
+            .format(test_utils.RESTCONF_BASE_URL))
         response = requests.request(
-            "GET", url, headers=headers, auth=('admin', 'admin'))
+            "GET", url, headers=test_utils.TYPE_APPLICATION_JSON, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertNotIn(['roadm-connections'][0], res['org-openroadm-device'])
@@ -1697,7 +1562,7 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     def test_49_loop_create_eth_service(self):
         for i in range(1, 6):
-            print("trial number {}".format(i))
+            print("iteration number {}".format(i))
             print("eth service creation")
             self.test_11_create_eth_service1()
             print("check xc in ROADMA01")
@@ -1710,11 +1575,11 @@ class TransportPCEFulltesting(unittest.TestCase):
     def test_50_loop_create_oc_service(self):
         url = ("{}/operational/org-openroadm-service:"
                "service-list/services/service1"
-               .format(self.restconf_baseurl))
-        response = requests.request("GET", url, auth=('admin', 'admin'))
+               .format(test_utils.RESTCONF_BASE_URL))
+        response = requests.request("GET", url, auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD))
         if response.status_code != 404:
             url = ("{}/operations/org-openroadm-service:service-delete"
-                   .format(self.restconf_baseurl))
+                   .format(test_utils.RESTCONF_BASE_URL))
             data = {"input": {
                 "sdnc-request-header": {
                     "request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58",
@@ -1729,15 +1594,14 @@ class TransportPCEFulltesting(unittest.TestCase):
                 }
             }
             }
-            headers = {'content-type': 'application/json'}
             requests.request("POST", url, data=json.dumps(data),
-                             headers=headers,
-                             auth=('admin', 'admin')
+                             headers=test_utils.TYPE_APPLICATION_JSON,
+                             auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD)
                              )
             time.sleep(5)
 
         for i in range(1, 6):
-            print("trial number {}".format(i))
+            print("iteration number {}".format(i))
             print("oc service creation")
             self.test_36_create_oc_service1()
             print("check xc in ROADMA01")
@@ -1748,48 +1612,20 @@ class TransportPCEFulltesting(unittest.TestCase):
             self.test_44_delete_oc_service1()
 
     def test_51_disconnect_XPDRA(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/XPDRA01"
-               .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(10)
+        response = test_utils.unmount_device("XPDRA01")
+        self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
 
     def test_52_disconnect_XPDRC(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/XPDRC01"
-               .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(10)
+        response = test_utils.unmount_device("XPDRC01")
+        self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
 
     def test_53_disconnect_ROADMA(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/ROADMA01"
-               .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(10)
+        response = test_utils.unmount_device("ROADMA01")
+        self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
 
     def test_54_disconnect_ROADMC(self):
-        url = ("{}/config/network-topology:"
-               "network-topology/topology/topology-netconf/node/ROADMC01"
-               .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(10)
+        response = test_utils.unmount_device("ROADMC01")
+        self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
 
 
 if __name__ == "__main__":