Update Functional tests for SP1.6
[transportpce.git] / tests / transportpce_tests / test_portmapping.py
index 529a2e346405a73ec63ea058097901e7ab196a9a..f43218f2011d9a0b7d9cc9e127a7995888be7802 100644 (file)
@@ -58,9 +58,9 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
         cls.__start_honeynode1()
-        time.sleep(40)
+        time.sleep(20)
         cls.__start_honeynode2()
-        time.sleep(40)
+        time.sleep(20)
         cls.__start_odl()
         time.sleep(60)
 
@@ -97,7 +97,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
 #                         'connected')
 
     def test_02_restconfAPI(self):
-        url = ("{}/config/portmapping:network/nodes/controller-config".format(self.restconf_baseurl))
+        url = ("{}/config/transportpce-portmapping:network/nodes/controller-config".format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
             "GET", url, headers=headers, auth=('admin', 'admin'))
@@ -142,7 +142,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_05_rdm_portmapping_DEG1_TTP_TXRX(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/ROADMA/mapping/DEG1-TTP-TXRX"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -156,7 +156,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_06_rdm_portmapping_SRG1_PP7_TXRX(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/ROADMA/mapping/SRG1-PP7-TXRX"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -170,7 +170,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_07_rdm_portmapping_SRG3_PP1_TXRX(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/ROADMA/mapping/SRG3-PP1-TXRX"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -217,7 +217,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_10_xpdr_portmapping_NETWORK1(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-NETWORK1"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -231,8 +231,8 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_11_xpdr_portmapping_NETWORK2(self):
-        url = ("{}/config/portmapping:network/"
-               "nodes/XPDRA/mapping/XPDR0-NETWORK2"
+        url = ("{}/config/transportpce-portmapping:network/"
+               "nodes/XPDRA/mapping/XPDR1-NETWORK2"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
@@ -241,11 +241,11 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         res = response.json()
         self.assertIn(
             {'supporting-port': '2', 'supporting-circuit-pack-name': '1/0/2-PLUG-NET',
-             'logical-connection-point': 'XPDR0-NETWORK2'},
+             'logical-connection-point': 'XPDR1-NETWORK2'},
             res['mapping'])
 
     def test_12_xpdr_portmapping_CLIENT1(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-CLIENT1"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
@@ -260,22 +260,23 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_13_xpdr_portmapping_CLIENT2(self):
-        url = ("{}/config/portmapping:network/"
+        url = ("{}/config/transportpce-portmapping:network/"
                "nodes/XPDRA/mapping/XPDR1-CLIENT2"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
             "GET", url, headers=headers, auth=('admin', 'admin'))
-        self.assertEqual(response.status_code, requests.codes.not_found)
+        self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn(
-            {"error-type":"application","error-tag":"data-missing",
-             "error-message":"Request could not be completed because the relevant data model content does not exist "},
-            res['errors']['error'])
+            {'supporting-port': 'C2',
+                 'supporting-circuit-pack-name': '1/0/C2-PLUG-CLIENT',
+                 'logical-connection-point': 'XPDR1-CLIENT2'},
+            res['mapping'])
 
     def test_14_xpdr_portmapping_CLIENT4(self):
-        url = ("{}/config/portmapping:network/"
-               "nodes/XPDRA/mapping/XPDR0-CLIENT4"
+        url = ("{}/config/transportpce-portmapping:network/"
+               "nodes/XPDRA/mapping/XPDR1-CLIENT4"
                .format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
@@ -285,7 +286,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         self.assertIn(
             {'supporting-port': 'C4',
              'supporting-circuit-pack-name': '1/0/C4-PLUG-CLIENT',
-             'logical-connection-point': 'XPDR0-CLIENT4'},
+             'logical-connection-point': 'XPDR1-CLIENT4'},
             res['mapping'])
 
     def test_15_xpdr_device_disconnected(self):
@@ -313,7 +314,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['errors']['error'])
 
     def test_17_xpdr_device_disconnected(self):
-        url = ("{}/config/portmapping:network/nodes/XPDRA".format(self.restconf_baseurl))
+        url = ("{}/config/transportpce-portmapping:network/nodes/XPDRA".format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
             "GET", url, headers=headers, auth=('admin', 'admin'))
@@ -348,7 +349,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['errors']['error'])
 
     def test_20_rdm_device_disconnected(self):
-        url = ("{}/config/portmapping:network/nodes/ROADMA".format(self.restconf_baseurl))
+        url = ("{}/config/transportpce-portmapping:network/nodes/ROADMA".format(self.restconf_baseurl))
         headers = {'content-type': 'application/json'}
         response = requests.request(
             "GET", url, headers=headers, auth=('admin', 'admin'))