Power control support for 87.5GHz spectrum width
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test05_olm.py
index 96778f5acc2598c88d64bf1a01116954c4458323..f9e5d1b6fa610f06f10fe957f8905c9a0d57be20 100644 (file)
 import unittest
 import time
 import requests
+# pylint: disable=wrong-import-order
 import sys
 sys.path.append('transportpce_tests/common/')
-import test_utils
+# pylint: disable=wrong-import-position
+# pylint: disable=import-error
+import test_utils  # nopep8
 
 
 class TransportOlmTesting(unittest.TestCase):
@@ -41,6 +44,7 @@ class TransportOlmTesting(unittest.TestCase):
         print("all processes killed")
 
     def setUp(self):
+        # pylint: disable=consider-using-f-string
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(1)
 
@@ -227,8 +231,8 @@ class TransportOlmTesting(unittest.TestCase):
                                                      "dest-tp": "SRG1-PP1-TXRX", "src-tp": "DEG2-TTP-TXRX"},
                                                     {"node-id": "XPDRC01",
                                                      "dest-tp": "XPDR1-CLIENT1", "src-tp": "XPDR1-NETWORK1"}],
-                                                    196.1, 40, 196.075, 196.125, 761,
-                                                    768)
+                                                   196.1, 40, 196.075, 196.125, 761,
+                                                   768)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm-connection successfully created for nodes', res["output"]["result"])
@@ -245,8 +249,8 @@ class TransportOlmTesting(unittest.TestCase):
                                                      "src-tp": "DEG1-TTP-TXRX", "dest-tp": "SRG1-PP1-TXRX"},
                                                     {"node-id": "XPDRA01",
                                                      "src-tp": "XPDR1-NETWORK1", "dest-tp": "XPDR1-CLIENT1"}],
-                                                    196.1, 40, 196.075, 196.125, 761,
-                                                    768)
+                                                   196.1, 40, 196.075, 196.125, 761,
+                                                   768)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm-connection successfully created for nodes', res["output"]["result"])
@@ -282,7 +286,7 @@ class TransportOlmTesting(unittest.TestCase):
                     }
                 ],
                 "center-freq": 196.1,
-                "width": 40,
+                "nmc-width": 40,
                 "min-freq": 196.075,
                 "max-freq": 196.125,
                 "lower-spectral-slot-number": 761,
@@ -304,14 +308,16 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertEqual(1, res['org-openroadm-optical-channel-interfaces:och']['wavelength-number'])
 
     def test_21_get_roadmconnection_ROADMA(self):
-        response = test_utils.check_netconf_node_request("ROADMA01", "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768")
+        response = test_utils.check_netconf_node_request(
+            "ROADMA01", "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual("gainLoss", res['roadm-connections'][0]['opticalControlMode'])
         self.assertEqual(-3.3, res['roadm-connections'][0]['target-output-power'])
 
     def test_22_get_roadmconnection_ROADMC(self):
-        response = test_utils.check_netconf_node_request("ROADMC01", "roadm-connections/DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768")
+        response = test_utils.check_netconf_node_request(
+            "ROADMC01", "roadm-connections/DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual("power", res['roadm-connections'][0]['opticalControlMode'])
@@ -345,7 +351,7 @@ class TransportOlmTesting(unittest.TestCase):
                     }
                 ],
                 "center-freq": 196.1,
-                "width": 40,
+                "nmc-width": 40,
                 "min-freq": 196.075,
                 "max-freq": 196.125,
                 "lower-spectral-slot-number": 761,
@@ -367,7 +373,8 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertEqual(1, res['org-openroadm-optical-channel-interfaces:och']['wavelength-number'])
 
     def test_25_get_roadmconnection_ROADMC(self):
-        response = test_utils.check_netconf_node_request("ROADMC01", "roadm-connections/SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768")
+        response = test_utils.check_netconf_node_request(
+            "ROADMC01", "roadm-connections/SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual("gainLoss", res['roadm-connections'][0]['opticalControlMode'])
@@ -402,7 +409,7 @@ class TransportOlmTesting(unittest.TestCase):
                     }
                 ],
                 "center-freq": 196.1,
-                "width": 40,
+                "nmc-width": 40,
                 "min-freq": 196.075,
                 "max-freq": 196.125,
                 "lower-spectral-slot-number": 761,
@@ -416,14 +423,16 @@ class TransportOlmTesting(unittest.TestCase):
         self.assertIn('Success', res["output"]["result"])
 
     def test_27_get_roadmconnection_ROADMA(self):
-        response = test_utils.check_netconf_node_request("ROADMA01", "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768")
+        response = test_utils.check_netconf_node_request(
+            "ROADMA01", "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual("off", res['roadm-connections'][0]['opticalControlMode'])
         self.assertEqual(-60, res['roadm-connections'][0]['target-output-power'])
 
     def test_28_get_roadmconnection_ROADMC(self):
-        response = test_utils.check_netconf_node_request("ROADMC01", "roadm-connections/DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768")
+        response = test_utils.check_netconf_node_request(
+            "ROADMC01", "roadm-connections/DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768")
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertEqual("off", res['roadm-connections'][0]['opticalControlMode'])
@@ -438,8 +447,8 @@ class TransportOlmTesting(unittest.TestCase):
                                                      "dest-tp": "SRG1-PP1-TXRX", "src-tp": "DEG2-TTP-TXRX"},
                                                     {"node-id": "XPDRC01",
                                                      "dest-tp": "XPDR1-CLIENT1", "src-tp": "XPDR1-NETWORK1"}],
-                                                    196.1, 40, 196.075, 196.125, 761,
-                                                    768)
+                                                   196.1, 40, 196.075, 196.125, 761,
+                                                   768)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Request processed', res["output"]["result"])
@@ -455,8 +464,8 @@ class TransportOlmTesting(unittest.TestCase):
                                                      "src-tp": "DEG1-TTP-TXRX", "dest-tp": "SRG1-PP1-TXRX"},
                                                     {"node-id": "XPDRA01",
                                                      "src-tp": "XPDR1-NETWORK1", "dest-tp": "XPDR1-CLIENT1"}],
-                                                    196.1, 40, 196.075, 196.125, 761,
-                                                    768)
+                                                   196.1, 40, 196.075, 196.125, 761,
+                                                   768)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Request processed', res["output"]["result"])
@@ -484,8 +493,8 @@ class TransportOlmTesting(unittest.TestCase):
                                                      "dest-tp": "XPDR1-NETWORK2", "src-tp": "XPDR1-CLIENT2"},
                                                     {"node-id": "ROADMA01",
                                                      "dest-tp": "DEG1-TTP-TXRX", "src-tp": "SRG1-PP2-TXRX"}],
-                                                    196.05, 40, 196.025, 196.075, 753,
-                                                    760)
+                                                   196.05, 40, 196.025, 196.075, 753,
+                                                   760)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Roadm-connection successfully created for nodes', res["output"]["result"])
@@ -507,8 +516,8 @@ class TransportOlmTesting(unittest.TestCase):
                                                      "dest-tp": "XPDR1-NETWORK2", "src-tp": "XPDR1-CLIENT2"},
                                                     {"node-id": "ROADMA01",
                                                      "dest-tp": "DEG1-TTP-TXRX", "src-tp": "SRG1-PP2-TXRX"}],
-                                                    196.1, 40, 196.075, 196.125, 761,
-                                                    768)
+                                                   196.1, 40, 196.075, 196.125, 761,
+                                                   768)
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn('Request processed', res["output"]["result"])