review sims/tpce start-up sequence in 2.2.1 tests
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test_olm.py
index c04830db2283c7a86fefc20c7db228defd6e2714..ab4100dc4718f098f44178bc19aed17aa41cdef3 100644 (file)
@@ -19,78 +19,27 @@ import os
 import psutil
 import shutil
 from unittest.result import failfast
+import test_utils
 
 
 class TransportOlmTesting(unittest.TestCase):
 
-    honeynode_process1 = None
-    honeynode_process2 = None
-    honeynode_process3 = None
-    honeynode_process4 = None
+    sim_process1 = None
+    sim_process2 = None
+    sim_process3 = None
+    sim_process4 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
-#START_IGNORE_XTESTING
-
-    @classmethod
-    def __start_honeynode1(cls):
-        executable = ("./honeynode/2.2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode1.log', 'w') as outfile:
-                cls.honeynode_process1 = subprocess.Popen(
-                    [executable, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"],
-                    stdout=outfile)
-
-    @classmethod
-    def __start_honeynode2(cls):
-        executable = ("./honeynode/2.2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode2.log', 'w') as outfile:
-                cls.honeynode_process2 = subprocess.Popen(
-                    [executable, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"],
-                    stdout=outfile)
-
-    @classmethod
-    def __start_honeynode3(cls):
-        executable = ("./honeynode/2.2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode3.log', 'w') as outfile:
-                cls.honeynode_process3 = subprocess.Popen(
-                    [executable, "17843", "sample_configs/openroadm/2.2.1/oper-ROADMC.xml"],
-                    stdout=outfile)
-    @classmethod
-    def __start_honeynode4(cls):
-        executable = ("./honeynode/2.2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode4.log', 'w') as outfile:
-                cls.honeynode_process4 = subprocess.Popen(
-                    [executable, "17844", "sample_configs/openroadm/2.2.1/oper-XPDRC.xml"],
-                    stdout=outfile)
-
-    @classmethod
-    def __start_odl(cls):
-        executable = "../karaf/target/assembly/bin/karaf"
-        with open('odl.log', 'w') as outfile:
-            cls.odl_process = subprocess.Popen(
-                ["bash", executable, "server"], stdout=outfile,
-                stdin=open(os.devnull))
+# START_IGNORE_XTESTING
 
     @classmethod
     def setUpClass(cls):
-        cls.__start_honeynode1()
-        time.sleep(30)
-        cls.__start_honeynode2()
-        time.sleep(30)
-        cls.__start_honeynode3()
-        time.sleep(30)
-        cls.__start_honeynode4()
-        time.sleep(30)
-        cls.__start_odl()
-        time.sleep(60)
+        cls.odl_process = test_utils.start_tpce()
+        cls.sim_process1 = test_utils.start_sim('xpdra')
+        cls.sim_process2 = test_utils.start_sim('roadma')
+        cls.sim_process3 = test_utils.start_sim('roadmc')
+        cls.sim_process4 = test_utils.start_sim('xpdrc')
 
     @classmethod
     def tearDownClass(cls):
@@ -99,43 +48,43 @@ class TransportOlmTesting(unittest.TestCase):
             child.wait()
         cls.odl_process.send_signal(signal.SIGINT)
         cls.odl_process.wait()
-        for child in psutil.Process(cls.honeynode_process1.pid).children():
+        for child in psutil.Process(cls.sim_process1.pid).children():
             child.send_signal(signal.SIGINT)
             child.wait()
-        cls.honeynode_process1.send_signal(signal.SIGINT)
-        cls.honeynode_process1.wait()
-        for child in psutil.Process(cls.honeynode_process2.pid).children():
+        cls.sim_process1.send_signal(signal.SIGINT)
+        cls.sim_process1.wait()
+        for child in psutil.Process(cls.sim_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():
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
+        for child in psutil.Process(cls.sim_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():
+        cls.sim_process3.send_signal(signal.SIGINT)
+        cls.sim_process3.wait()
+        for child in psutil.Process(cls.sim_process4.pid).children():
             child.send_signal(signal.SIGINT)
             child.wait()
-        cls.honeynode_process4.send_signal(signal.SIGINT)
-        cls.honeynode_process4.wait()
+        cls.sim_process4.send_signal(signal.SIGINT)
+        cls.sim_process4.wait()
 
     def setUp(self):
-        print ("execution of {}".format(self.id().split(".")[-1]))
+        print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(1)
 
-#END_IGNORE_XTESTING
+# END_IGNORE_XTESTING
 
     def test_01_xpdrA_device_connected(self):
         url = ("{}/config/network-topology:"
                "network-topology/topology/topology-netconf/node/XPDR-A1"
-              .format(self.restconf_baseurl))
+               .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:port": test_utils.sims['xpdra']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -148,13 +97,13 @@ class TransportOlmTesting(unittest.TestCase):
     def test_02_xpdrC_device_connected(self):
         url = ("{}/config/network-topology:"
                "network-topology/topology/topology-netconf/node/XPDR-C1"
-              .format(self.restconf_baseurl))
+               .format(self.restconf_baseurl))
         data = {"node": [{
             "node-id": "XPDR-C1",
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17844",
+            "netconf-node-topology:port": test_utils.sims['xpdrc']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -169,17 +118,17 @@ class TransportOlmTesting(unittest.TestCase):
                "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": {}}]}
+            "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": test_utils.sims['roadma']['port'],
+            "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'))
+            "PUT", url, data=json.dumps(data), headers=headers,
+            auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.created)
         time.sleep(20)
 
@@ -188,17 +137,17 @@ class TransportOlmTesting(unittest.TestCase):
                "network-topology/topology/topology-netconf/node/ROADM-C1"
                .format(self.restconf_baseurl))
         data = {"node": [{
-             "node-id": "ROADM-C1",
-             "netconf-node-topology:username": "admin",
-             "netconf-node-topology:password": "admin",
-             "netconf-node-topology:host": "127.0.0.1",
-             "netconf-node-topology:port": "17843",
-             "netconf-node-topology:tcp-only": "false",
-             "netconf-node-topology:pass-through": {}}]}
+            "node-id": "ROADM-C1",
+            "netconf-node-topology:username": "admin",
+            "netconf-node-topology:password": "admin",
+            "netconf-node-topology:host": "127.0.0.1",
+            "netconf-node-topology:port": test_utils.sims['roadmc']['port'],
+            "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'))
+            "PUT", url, data=json.dumps(data), headers=headers,
+            auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.created)
         time.sleep(20)
 
@@ -218,8 +167,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
@@ -240,8 +189,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
@@ -262,8 +211,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
@@ -284,8 +233,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
@@ -293,15 +242,15 @@ class TransportOlmTesting(unittest.TestCase):
     def test_09_create_OTS_ROADMA(self):
         url = "{}/operations/transportpce-device-renderer:create-ots-oms".format(self.restconf_baseurl)
         data = {
-            "input" : {
-                "node-id" : "ROADM-A1",
-                "logical-connection-point" : "DEG1-TTP-TXRX"
+            "input": {
+                "node-id": "ROADM-A1",
+                "logical-connection-point": "DEG1-TTP-TXRX"
             }
         }
         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=headers, auth=('admin', 'admin'))
         time.sleep(10)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
@@ -311,15 +260,15 @@ class TransportOlmTesting(unittest.TestCase):
     def test_10_create_OTS_ROADMC(self):
         url = "{}/operations/transportpce-device-renderer:create-ots-oms".format(self.restconf_baseurl)
         data = {
-            "input" : {
-                "node-id" : "ROADM-C1",
-                "logical-connection-point" : "DEG2-TTP-TXRX"
+            "input": {
+                "node-id": "ROADM-C1",
+                "logical-connection-point": "DEG2-TTP-TXRX"
             }
         }
         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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Interfaces OTS-DEG2-TTP-TXRX - OMS-DEG2-TTP-TXRX successfully created on node ROADM-C1',
@@ -333,28 +282,28 @@ class TransportOlmTesting(unittest.TestCase):
                 "resource-type": "interface",
                 "granularity": "15min",
                 "resource-identifier": {
-                    "resource-name" : "OTS-DEG2-TTP-TXRX"
+                    "resource-name": "OTS-DEG2-TTP-TXRX"
                 }
             }
         }
         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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn({
-                "pmparameter-name": "OpticalPowerOutput",
-                "pmparameter-value": "2.5"
-            }, res["output"]["measurements"])
+            "pmparameter-name": "OpticalPowerOutput",
+            "pmparameter-value": "2.5"
+        }, res["output"]["measurements"])
         self.assertIn({
-                "pmparameter-name": "OpticalReturnLoss",
-                "pmparameter-value": "40"
-            }, res["output"]["measurements"])
+            "pmparameter-name": "OpticalReturnLoss",
+            "pmparameter-value": "40"
+        }, res["output"]["measurements"])
         self.assertIn({
-                "pmparameter-name": "OpticalPowerInput",
-                "pmparameter-value": "-21.1"
-            }, res["output"]["measurements"])
+            "pmparameter-name": "OpticalPowerInput",
+            "pmparameter-value": "-21.1"
+        }, res["output"]["measurements"])
 
     def test_12_get_PM_ROADMC(self):
         url = "{}/operations/transportpce-olm:get-pm".format(self.restconf_baseurl)
@@ -364,28 +313,28 @@ class TransportOlmTesting(unittest.TestCase):
                 "resource-type": "interface",
                 "granularity": "15min",
                 "resource-identifier": {
-                    "resource-name" : "OTS-DEG1-TTP-TXRX"
+                    "resource-name": "OTS-DEG1-TTP-TXRX"
                 }
             }
         }
         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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn({
-                "pmparameter-name": "OpticalPowerOutput",
-                "pmparameter-value": "4.6"
-            }, res["output"]["measurements"])
+            "pmparameter-name": "OpticalPowerOutput",
+            "pmparameter-value": "4.6"
+        }, res["output"]["measurements"])
         self.assertIn({
-                "pmparameter-name": "OpticalReturnLoss",
-                "pmparameter-value": "49.1"
-            }, res["output"]["measurements"])
+            "pmparameter-name": "OpticalReturnLoss",
+            "pmparameter-value": "49.1"
+        }, res["output"]["measurements"])
         self.assertIn({
-                "pmparameter-name": "OpticalPowerInput",
-                "pmparameter-value": "-15.1"
-            }, res["output"]["measurements"])
+            "pmparameter-name": "OpticalPowerInput",
+            "pmparameter-value": "-15.1"
+        }, res["output"]["measurements"])
 
     def test_13_calculate_span_loss_base_ROADMA_ROADMC(self):
         url = "{}/operations/transportpce-olm:calculate-spanloss-base".format(self.restconf_baseurl)
@@ -397,16 +346,16 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Success',
                       res["output"]["result"])
         self.assertIn({
-            "spanloss": "18",
-                "link-id": "ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX"
-            }, res["output"]["spans"])
+            "spanloss": "17.6",
+            "link-id": "ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX"
+        }, res["output"]["spans"])
         time.sleep(5)
 
     def test_14_calculate_span_loss_base_all(self):
@@ -418,20 +367,20 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Success',
                       res["output"]["result"])
         self.assertIn({
-                "spanloss": "26",
-                "link-id": "ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX"
-            }, res["output"]["spans"])
+            "spanloss": "25.7",
+            "link-id": "ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX"
+        }, res["output"]["spans"])
         self.assertIn({
-                "spanloss": "18",
-                "link-id": "ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX"
-            }, res["output"]["spans"])
+            "spanloss": "17.6",
+            "link-id": "ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX"
+        }, res["output"]["spans"])
         time.sleep(5)
 
     def test_15_get_OTS_DEG2_TTP_TXRX_ROADMA(self):
@@ -443,8 +392,8 @@ class TransportOlmTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertEqual(18, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-transmit'])
-        self.assertEqual(26, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-receive'])
+        self.assertEqual(17.6, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-transmit'])
+        self.assertEqual(25.7, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-receive'])
 
     def test_16_get_OTS_DEG1_TTP_TXRX_ROADMC(self):
         url = ("{}/config/network-topology:network-topology/topology/topology-netconf/"
@@ -455,8 +404,8 @@ class TransportOlmTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertEqual(26, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-transmit'])
-        self.assertEqual(18, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-receive'])
+        self.assertEqual(25.7, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-transmit'])
+        self.assertEqual(17.6, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-receive'])
 
     def test_17_servicePath_create_AToZ(self):
         url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
@@ -492,12 +441,12 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm-connection successfully created for nodes', res["output"]["result"])
-        #time.sleep(40)
+        # time.sleep(40)
         time.sleep(10)
 
     def test_18_servicePath_create_ZToA(self):
@@ -534,12 +483,12 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm-connection successfully created for nodes', res["output"]["result"])
-        #time.sleep(40)
+        # time.sleep(40)
         time.sleep(10)
 
     def test_19_service_power_setup_XPDRA_XPDRC(self):
@@ -574,8 +523,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Success', res["output"]["result"])
@@ -647,8 +596,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Success', res["output"]["result"])
@@ -662,7 +611,7 @@ class TransportOlmTesting(unittest.TestCase):
             "GET", url, headers=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
-        self.assertEqual(-5  , res['org-openroadm-optical-channel-interfaces:och']['transmit-power'])
+        self.assertEqual(-5, res['org-openroadm-optical-channel-interfaces:och']['transmit-power'])
         self.assertEqual(196.1, res['org-openroadm-optical-channel-interfaces:och']['frequency'])
 
     def test_25_get_roadmconnection_ROADMC(self):
@@ -709,8 +658,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Success', res["output"]["result"])
@@ -772,8 +721,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Request processed', res["output"]["result"])
@@ -813,8 +762,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Request processed', res["output"]["result"])
@@ -838,8 +787,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
@@ -860,8 +809,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
@@ -890,12 +839,12 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm-connection successfully created for nodes', res["output"]["result"])
-        #time.sleep(40)
+        # time.sleep(40)
         time.sleep(10)
 
     def test_34_get_interface_XPDRA_XPDR1_NETWORK2(self):
@@ -934,8 +883,8 @@ class TransportOlmTesting(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=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Request processed', res["output"]["result"])
@@ -943,23 +892,23 @@ class TransportOlmTesting(unittest.TestCase):
 
     def test_36_xpdrA_device_disconnected(self):
         url = ("{}/config/network-topology:"
-                "network-topology/topology/topology-netconf/node/XPDR-A1"
+               "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'))
+            "DELETE", url, headers=headers,
+            auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(10)
 
     def test_37_xpdrC_device_disconnected(self):
         url = ("{}/config/network-topology:"
-                "network-topology/topology/topology-netconf/node/XPDR-C1"
+               "network-topology/topology/topology-netconf/node/XPDR-C1"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
-             "DELETE", url, headers=headers,
-             auth=('admin', 'admin'))
+            "DELETE", url, headers=headers,
+            auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(10)
 
@@ -967,7 +916,7 @@ class TransportOlmTesting(unittest.TestCase):
         url = "{}/operations/transportpce-olm:calculate-spanloss-current".format(self.restconf_baseurl)
         headers = {'content-type': 'application/json'}
         response = requests.request(
-             "POST", url, headers=headers, auth=('admin', 'admin'))
+            "POST", url, headers=headers, auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Success',
@@ -976,25 +925,26 @@ class TransportOlmTesting(unittest.TestCase):
 
     def test_39_rdmA_device_disconnected(self):
         url = ("{}/config/network-topology:"
-                "network-topology/topology/topology-netconf/node/ROADM-A1"
+               "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'))
+            "DELETE", url, headers=headers,
+            auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(10)
 
     def test_40_rdmC_device_disconnected(self):
         url = ("{}/config/network-topology:"
-                "network-topology/topology/topology-netconf/node/ROADM-C1"
+               "network-topology/topology/topology-netconf/node/ROADM-C1"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
-             "DELETE", url, headers=headers,
-             auth=('admin', 'admin'))
+            "DELETE", url, headers=headers,
+            auth=('admin', 'admin'))
         self.assertEqual(response.status_code, requests.codes.ok)
         time.sleep(10)
 
+
 if __name__ == "__main__":
     unittest.main(verbosity=2)