Move openconfig functional test library to common 38/114938/5
authorGilles Thouenon <gilles.thouenon@orange.com>
Sat, 18 Jan 2025 10:04:31 +0000 (11:04 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Tue, 21 Jan 2025 11:25:16 +0000 (12:25 +0100)
- update existing openconfig portmapping functional tests
- update the node name key in simulators module

JIRA: TRNSPRTPCE-839
Change-Id: I46661190ef1d5ca022969ecb4d9ea8306135586d
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
tests/transportpce_tests/2.2.1/test16_freq_end2end.py
tests/transportpce_tests/common/simulators.py
tests/transportpce_tests/common/test_utils_oc.py [moved from tests/transportpce_tests/oc/test_utils_oc.py with 100% similarity]
tests/transportpce_tests/oc/test01_portmapping.py

index e7c76f28e9fed7bab87da45c0ecdcc1150631752..37ddbcac45bdbaacf5c09094e057496aaa8cfab7 100644 (file)
@@ -510,7 +510,7 @@ class TransportPCEtesting(unittest.TestCase):
                 self.assertNotIn('avail-freq-maps', dict.keys(ele))
 
     def test_26_check_openroadm_topology_links(self):
-        #response = test_utils.get_ietf_network_request('otn-topology', 'config')
+        # response = test_utils.get_ietf_network_request('otn-topology', 'config')
         response = test_utils.get_ietf_network_request('openroadm-topology', 'config')
         self.assertEqual(response['status_code'], requests.codes.ok)
         self.assertEqual(len(response['network'][0]['ietf-network-topology:link']), 22)
@@ -676,7 +676,7 @@ class TransportPCEtesting(unittest.TestCase):
                 self.assertNotIn('avail-freq-maps', dict.keys(ele))
 
     def test_39_getLinks_OtnTopology(self):
-        #response = test_utils.get_ietf_network_request('otn-topology', 'config')
+        # response = test_utils.get_ietf_network_request('otn-topology', 'config')
         response = test_utils.get_ietf_network_request('openroadm-topology', 'config')
         self.assertEqual(response['status_code'], requests.codes.ok)
         self.assertEqual(len(response['network'][0]['node']), 13)
index df78dab29aa952af48e1cdf54301719d9ba1dab4..8e1edbb11b15680c6d1be39251a82b3e7ebaad72 100644 (file)
@@ -33,5 +33,5 @@ SIMS = {
     ('xpdrc', '7.1'): {'port': '17854', 'configfile': 'oper-XPDRC.xml', 'logfile': 'xpdrc-71.log', 'restconf_baseurl': 'http://127.0.0.1:8154/restconf'},
     ('xpdra2', '7.1'): {'port': '17857', 'configfile': 'oper-XPDRA2.xml', 'logfile': 'xpdra2-71.log', 'restconf_baseurl': 'http://127.0.0.1:8157/restconf'},
     ('xpdrc2', '7.1'): {'port': '17858', 'configfile': 'oper-XPDRC2.xml', 'logfile': 'xpdrc2-71.log', 'restconf_baseurl': 'http://127.0.0.1:8158/restconf'},
-    ('sample-openconfig-mpdr', 'oc'): {'port': '19840', 'configfile': 'sample-openconfig-mpdr.xml', 'logfile': 'sample-openconfig-mpdr.log', 'restconf_baseurl': 'http://127.0.0.1:8159/restconf'}
+    ('oc-mpdr', 'oc'): {'port': '19840', 'configfile': 'sample-openconfig-mpdr.xml', 'logfile': 'sample-openconfig-mpdr.log', 'restconf_baseurl': 'http://127.0.0.1:8159/restconf'}
 }
index bed6a863fb5ef6b2daeafa289884c705ccf4a3e3..e43b0f5a9e541711ac10324abeeb3ff7828396d5 100644 (file)
@@ -8,19 +8,16 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-# pylint: disable=no-member
-# pylint: disable=too-many-public-methods
-
 import unittest
 import time
 import requests
 # pylint: disable=wrong-import-order
 import sys
-from . import test_utils_oc
-sys.path.append('transportpce_tests/common')
+sys.path.append('transportpce_tests/common/')
 # pylint: disable=wrong-import-position
 # pylint: disable=import-error
 import test_utils  # nopep8
+import test_utils_oc  # nopep8
 
 
 class TransportpceOCPortMappingTesting(unittest.TestCase):
@@ -30,7 +27,7 @@ class TransportpceOCPortMappingTesting(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims([('sample-openconfig-mpdr', cls.NODE_VERSION)])
+        cls.processes = test_utils.start_sims([('oc-mpdr', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -57,7 +54,7 @@ class TransportpceOCPortMappingTesting(unittest.TestCase):
 
     def test_03_xpdr_device_connection(self):
         response = test_utils.mount_device("XPDR-OC",
-                                           ('sample-openconfig-mpdr', self.NODE_VERSION))
+                                           ('oc-mpdr', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created,
                          test_utils.CODE_SHOULD_BE_201)