Change way to start simulators 95/95795/11
authorGilles Thouenon <gilles.thouenon@orange.com>
Tue, 13 Apr 2021 07:12:17 +0000 (09:12 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Thu, 29 Apr 2021 08:31:40 +0000 (10:31 +0200)
- change way to import modules from common and remove symbolic folder
links
- create a single flat simulators file containing all simulators
configurations in order to be able to launch topology configurations
composed of node devices of different versions
- adapt python test files accordingly
- create specific log directory for simulators in common

JIRA: TRNSPRTPCE-434
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: I094d2dd844b0591b0012fd10395576cca147b54a

34 files changed:
tests/transportpce_tests/1.2.1/__init__.py [new file with mode: 0644]
tests/transportpce_tests/1.2.1/common [deleted symlink]
tests/transportpce_tests/1.2.1/simulators.py [deleted file]
tests/transportpce_tests/1.2.1/test_end2end.py
tests/transportpce_tests/1.2.1/test_gnpy.py
tests/transportpce_tests/1.2.1/test_olm.py
tests/transportpce_tests/1.2.1/test_pce.py
tests/transportpce_tests/1.2.1/test_portmapping.py
tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py
tests/transportpce_tests/1.2.1/test_topo_portmapping.py
tests/transportpce_tests/1.2.1/test_topology.py
tests/transportpce_tests/2.2.1/__init__.py [new file with mode: 0644]
tests/transportpce_tests/2.2.1/common [deleted symlink]
tests/transportpce_tests/2.2.1/simulators.py [deleted file]
tests/transportpce_tests/2.2.1/test_end2end.py
tests/transportpce_tests/2.2.1/test_flex_grid.py
tests/transportpce_tests/2.2.1/test_nbinotifications.py
tests/transportpce_tests/2.2.1/test_olm.py
tests/transportpce_tests/2.2.1/test_otn_end2end.py
tests/transportpce_tests/2.2.1/test_otn_renderer.py
tests/transportpce_tests/2.2.1/test_otn_sh_renderer.py
tests/transportpce_tests/2.2.1/test_otn_topology.py
tests/transportpce_tests/2.2.1/test_portmapping.py
tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py
tests/transportpce_tests/2.2.1/test_tapi.py
tests/transportpce_tests/2.2.1/test_topo_portmapping.py
tests/transportpce_tests/2.2.1/test_topology.py
tests/transportpce_tests/7.1/__init__.py [new file with mode: 0644]
tests/transportpce_tests/7.1/common [deleted symlink]
tests/transportpce_tests/7.1/simulators.py [deleted file]
tests/transportpce_tests/7.1/test_pce_400G.py
tests/transportpce_tests/common/log/.gitkeep [new file with mode: 0644]
tests/transportpce_tests/common/simulators.py [changed from symlink to file mode: 0644]
tests/transportpce_tests/common/test_utils.py

diff --git a/tests/transportpce_tests/1.2.1/__init__.py b/tests/transportpce_tests/1.2.1/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/transportpce_tests/1.2.1/common b/tests/transportpce_tests/1.2.1/common
deleted file mode 120000 (symlink)
index 8332399..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../common/
\ No newline at end of file
diff --git a/tests/transportpce_tests/1.2.1/simulators.py b/tests/transportpce_tests/1.2.1/simulators.py
deleted file mode 100644 (file)
index 79bbcd8..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-##############################################################################
-# Copyright (c) 2020 Orange, Inc. and others.  All rights reserved.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-
-SIMS = {
-    'xpdra': {'port': '17830', 'configfile': 'oper-XPDRA.xml', 'logfile': 'oper-XPDRA.log'},
-    'roadma': {'port': '17831', 'configfile': 'oper-ROADMA.xml', 'logfile': 'oper-ROADMA.log'},
-    'roadmb': {'port': '17832', 'configfile': 'oper-ROADMB.xml', 'logfile': 'oper-ROADMB.log'},
-    'roadmc': {'port': '17833', 'configfile': 'oper-ROADMC.xml', 'logfile': 'oper-ROADMC.log'},
-    'xpdrc': {'port': '17834', 'configfile': 'oper-XPDRC.xml', 'logfile': 'oper-XPDRC.log'},
-    'roadma-full': {'port': '17821', 'configfile': 'oper-ROADMA-full.xml', 'logfile': 'oper-ROADMA.log'},
-    'roadmc-full': {'port': '17823', 'configfile': 'oper-ROADMC-full.xml', 'logfile': 'oper-ROADMC.log'}
-}
-
-HONEYNODE_EXECUTABLE = os.path.join(
-    os.path.dirname(os.path.realpath(__file__)),
-    "..", "..", "honeynode", "1.2.1", "honeynode-simulator", "honeycomb-tpce")
-SAMPLES_DIRECTORY = os.path.join(
-    os.path.dirname(os.path.realpath(__file__)),
-    "..", "..", "sample_configs", "openroadm", "1.2.1")
index 77f2eeac5546591c0ab14ffe9fc8ac17382ae5eb..3f7ca3b52aff45306c1664bf6eba47d95da1c572 100644 (file)
 import base64
 import time
 import unittest
-
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 class TransportPCEFulltesting(unittest.TestCase):
     cr_serv_sample_data = {"input": {
@@ -118,11 +119,15 @@ class TransportPCEFulltesting(unittest.TestCase):
     }
     processes = None
     WAITING = 20
+    NODE_VERSION = '1.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma-full', 'roadmc-full', 'xpdrc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION),
+                                               ('roadma-full', cls.NODE_VERSION),
+                                               ('roadmc-full', cls.NODE_VERSION),
+                                               ('xpdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -136,19 +141,19 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     #  connect netconf devices
     def test_01_connect_xpdrA(self):
-        response = test_utils.mount_device("XPDRA01", 'xpdra')
+        response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_connect_xpdrC(self):
-        response = test_utils.mount_device("XPDRC01", 'xpdrc')
+        response = test_utils.mount_device("XPDRC01", ('xpdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_connect_rdmA(self):
-        response = test_utils.mount_device("ROADMA01", 'roadma-full')
+        response = test_utils.mount_device("ROADMA01", ('roadma-full', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_04_connect_rdmC(self):
-        response = test_utils.mount_device("ROADMC01", 'roadmc-full')
+        response = test_utils.mount_device("ROADMC01", ('roadmc-full', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_05_connect_xprdA_N1_to_roadmA_PP1(self):
index c0752cb7ff9a8ff27902011a27a4b2f2e5cb2454..57d8935bdb62421ac93a161183ab7a8f222bf0cc 100644 (file)
@@ -17,7 +17,8 @@ import os
 import sys
 import time
 import requests
-from common import test_utils
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportGNPYtesting(unittest.TestCase):
index b42c488f3d896a2a8af737330c7b4208090c25e2..96778f5acc2598c88d64bf1a01116954c4458323 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportOlmTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '1.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma-full', 'roadmc-full', 'xpdrc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION),
+                                               ('roadma-full', cls.NODE_VERSION),
+                                               ('roadmc-full', cls.NODE_VERSION),
+                                               ('xpdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -39,19 +45,19 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(1)
 
     def test_01_xpdrA_device_connected(self):
-        response = test_utils.mount_device("XPDRA01", 'xpdra')
+        response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_xpdrC_device_connected(self):
-        response = test_utils.mount_device("XPDRC01", 'xpdrc')
+        response = test_utils.mount_device("XPDRC01", ('xpdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_rdmA_device_connected(self):
-        response = test_utils.mount_device("ROADMA01", 'roadma-full')
+        response = test_utils.mount_device("ROADMA01", ('roadma-full', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_04_rdmC_device_connected(self):
-        response = test_utils.mount_device("ROADMC01", 'roadmc-full')
+        response = test_utils.mount_device("ROADMC01", ('roadmc-full', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_05_connect_xprdA_to_roadmA(self):
index d8447847b087d91ec99082d7f5c0763e3f077c81..bbed914aaa9fd0346ba07fcc8ac9d2732c1b0bdc 100644 (file)
@@ -16,7 +16,8 @@ import os
 import sys
 import time
 import requests
-from common import test_utils
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
index 5cc4c14ddfadb014e57196f720756de55d3eaf23..6a9f9fc47ce60456df272647795f3819906e35be 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEPortMappingTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '1.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -38,24 +41,8 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         print("execution of {}".format(self.id().split(".")[-1]))
         time.sleep(10)
 
-#    def test_01_restconfAPI(self):
-#        response = test_utils.get_netconf_oper_request("controller-config")
-#        self.assertEqual(response.status_code, requests.codes.ok)
-#        res = response.json()
-#        self.assertEqual(res['node'] [0] ['netconf-node-topology:connection-status'],
-#                         'connected')
-
-#     def test_02_restconfAPI(self):
-#         response = test_utils.portmapping_request("controller-config")
-#         self.assertEqual(response.status_code, requests.codes.not_found)
-#         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'])
-
     def test_01_rdm_device_connection(self):
-        response = test_utils.mount_device("ROADMA01", 'roadma')
+        response = test_utils.mount_device("ROADMA01", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_rdm_device_connected(self):
@@ -111,7 +98,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_07_xpdr_device_connection(self):
-        response = test_utils.mount_device("XPDRA01", 'xpdra')
+        response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_08_xpdr_device_connected(self):
index 9787e40710157f3f23a49160fcd426c21c89f4c1..305c2ec89ee83a0b2d8ea96c808bdfcf4abbc00a 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
-
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 class TransportPCERendererTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '1.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -39,11 +41,11 @@ class TransportPCERendererTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_01_rdm_device_connected(self):
-        response = test_utils.mount_device("ROADMA01", 'roadma')
+        response = test_utils.mount_device("ROADMA01", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_xpdr_device_connected(self):
-        response = test_utils.mount_device("XPDRA01", 'xpdra')
+        response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_rdm_portmapping(self):
index 683b04a48649fa5e491d09d3b21f8c05b8a20f41..9390c26a6839384c3ea45d4e1115d47daef962c8 100644 (file)
 import time
 import unittest
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '1.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -41,7 +44,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Connect the ROADMA
     def test_01_connect_rdm(self):
-        response = test_utils.mount_device("ROADMA01", 'roadma')
+        response = test_utils.mount_device("ROADMA01", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     # Verify the termination points of the ROADMA
@@ -66,7 +69,7 @@ class TransportPCEtesting(unittest.TestCase):
 
 #     #Connect the XPDRA
     def test_04_connect_xpdr(self):
-        response = test_utils.mount_device("XPDRA01", 'xpdra')
+        response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
 #     #Verify the termination points related to XPDR
index 83045d50cb6045634e30ec58fe54dbd5ac0d54de..6140f0eca117ee2bd4c9f4ff03f3e8c815a6eafe 100644 (file)
 import time
 import unittest
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCETopologyTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '1.2.1'
     CHECK_DICT1 = {
         'ROADMA01-SRG1': {
             'node_type': 'SRG',
@@ -93,7 +96,8 @@ class TransportPCETopologyTesting(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmb', 'roadmc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION),
+                                               ('roadmb', cls.NODE_VERSION), ('roadmc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -106,7 +110,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
         time.sleep(5)
 
     def test_01_connect_ROADMA(self):
-        response = test_utils.mount_device("ROADMA01", 'roadma')
+        response = test_utils.mount_device("ROADMA01", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_getClliNetwork(self):
@@ -188,7 +192,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
         self.assertEqual(len(listNode), 0)
 
     def test_06_connect_XPDRA(self):
-        response = test_utils.mount_device("XPDRA01", 'xpdra')
+        response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_07_getClliNetwork(self):
@@ -320,7 +324,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
             self.assertEqual(len(check_list[link_type]), 0)
 
     def test_13_connect_ROADMC(self):
-        response = test_utils.mount_device("ROADMC01", 'roadmc')
+        response = test_utils.mount_device("ROADMC01", ('roadmc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_14_omsAttributes_ROADMA_ROADMC(self):
@@ -523,7 +527,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
         self.assertEqual(len(listNode), 0)
 
     def test_21_connect_ROADMB(self):
-        response = test_utils.mount_device("ROADMB01", 'roadmb')
+        response = test_utils.mount_device("ROADMB01", ('roadmb', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_22_omsAttributes_ROADMA_ROADMB(self):
diff --git a/tests/transportpce_tests/2.2.1/__init__.py b/tests/transportpce_tests/2.2.1/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/transportpce_tests/2.2.1/common b/tests/transportpce_tests/2.2.1/common
deleted file mode 120000 (symlink)
index 8332399..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../common/
\ No newline at end of file
diff --git a/tests/transportpce_tests/2.2.1/simulators.py b/tests/transportpce_tests/2.2.1/simulators.py
deleted file mode 100644 (file)
index dd1ac0c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-##############################################################################
-# Copyright (c) 2020 Orange, Inc. and others.  All rights reserved.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import os
-
-SIMS = {
-    'xpdra': {'port': '17840', 'configfile': 'oper-XPDRA.xml', 'logfile': 'oper-XPDRA.log'},
-    'roadma': {'port': '17841', 'configfile': 'oper-ROADMA.xml', 'logfile': 'oper-ROADMA.log'},
-    'roadmb': {'port': '17842', 'configfile': 'oper-ROADMB.xml', 'logfile': 'oper-ROADMB.log'},
-    'roadmc': {'port': '17843', 'configfile': 'oper-ROADMC.xml', 'logfile': 'oper-ROADMC.log'},
-    'roadmd': {'port': '17847', 'configfile': 'oper-ROADMD.xml', 'logfile': 'oper-ROADMD.log'},
-    'xpdrc': {'port': '17844', 'configfile': 'oper-XPDRC.xml', 'logfile': 'oper-XPDRC.log'},
-    'spdra': {'port': '17845', 'configfile': 'oper-SPDRA.xml', 'logfile': 'oper-SPDRA.log'},
-    'spdrc': {'port': '17846', 'configfile': 'oper-SPDRC.xml', 'logfile': 'oper-SPDRC.log'}
-}
-
-HONEYNODE_EXECUTABLE = os.path.join(
-    os.path.dirname(os.path.realpath(__file__)),
-    "..", "..", "honeynode", "2.2.1", "honeynode-simulator", "honeycomb-tpce")
-SAMPLES_DIRECTORY = os.path.join(
-    os.path.dirname(os.path.realpath(__file__)),
-    "..", "..", "sample_configs", "openroadm", "2.2.1")
index 66a75089b17c397d49c882770b612958d92fce67..e68f798472f5fe9632cb8e67f27f35e4866474a6 100644 (file)
@@ -14,7 +14,9 @@ import base64
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEFulltesting(unittest.TestCase):
@@ -110,11 +112,15 @@ class TransportPCEFulltesting(unittest.TestCase):
     }
 
     WAITING = 20  # nominal value is 300
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmc', 'xpdrc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION),
+                                               ('roadma', cls.NODE_VERSION),
+                                               ('roadmc', cls.NODE_VERSION),
+                                               ('xpdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -127,19 +133,19 @@ class TransportPCEFulltesting(unittest.TestCase):
         print("execution of {}".format(self.id().split(".")[-1]))
 
     def test_01_connect_xpdrA(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_connect_xpdrC(self):
-        response = test_utils.mount_device("XPDR-C1", 'xpdrc')
+        response = test_utils.mount_device("XPDR-C1", ('xpdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_connect_rdmA(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_04_connect_rdmC(self):
-        response = test_utils.mount_device("ROADM-C1", 'roadmc')
+        response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_05_connect_xprdA_N1_to_roadmA_PP1(self):
index 21aa9989d22098dcbdf1b75e63bd0dcdae20533c..b48c9aacc05919e6455a09dd427e77f5949652d3 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEPortMappingTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['roadmd'])
+        cls.processes = test_utils.start_sims([('roadmd', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -35,7 +38,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_01_rdm_device_connection(self):
-        response = test_utils.mount_device("ROADM-D1", 'roadmd')
+        response = test_utils.mount_device("ROADM-D1", ('roadmd', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created,
                          test_utils.CODE_SHOULD_BE_201)
 
index b772b36676f5370ceb2d6c6d8a83488e241b9557..628fa8f1085def90355db4a41994dbd4bb6ad457 100644 (file)
@@ -16,7 +16,8 @@ import sys
 import unittest
 import time
 import requests
-from common import test_utils
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportNbiNotificationstesting(unittest.TestCase):
@@ -111,6 +112,7 @@ class TransportNbiNotificationstesting(unittest.TestCase):
     }
 
     WAITING = 20  # nominal value is 300
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
@@ -132,7 +134,10 @@ class TransportNbiNotificationstesting(unittest.TestCase):
             print("NBI notification installation feature failed...")
             test_utils.shutdown_process(cls.processes[0])
             sys.exit(2)
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmc', 'xpdrc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION),
+                                               ('roadma', cls.NODE_VERSION),
+                                               ('roadmc', cls.NODE_VERSION),
+                                               ('xpdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -145,19 +150,19 @@ class TransportNbiNotificationstesting(unittest.TestCase):
         print("execution of {}".format(self.id().split(".")[-1]))
 
     def test_01_connect_xpdrA(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_connect_xpdrC(self):
-        response = test_utils.mount_device("XPDR-C1", 'xpdrc')
+        response = test_utils.mount_device("XPDR-C1", ('xpdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_connect_rdmA(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_04_connect_rdmC(self):
-        response = test_utils.mount_device("ROADM-C1", 'roadmc')
+        response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_05_connect_xprdA_N1_to_roadmA_PP1(self):
index 53823dd75e0d23180c403e7db0e5094ee40a8974..67e609fa775e7c09dc82a2d26b8b2f659636ad13 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportOlmTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmc', 'xpdrc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION),
+                                               ('roadma', cls.NODE_VERSION),
+                                               ('roadmc', cls.NODE_VERSION),
+                                               ('xpdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -39,19 +45,19 @@ class TransportOlmTesting(unittest.TestCase):
         time.sleep(1)
 
     def test_01_xpdrA_device_connected(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_xpdrC_device_connected(self):
-        response = test_utils.mount_device("XPDR-C1", 'xpdrc')
+        response = test_utils.mount_device("XPDR-C1", ('xpdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_rdmA_device_connected(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_04_rdmC_device_connected(self):
-        response = test_utils.mount_device("ROADM-C1", 'roadmc')
+        response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_05_connect_xprdA_to_roadmA(self):
index 1803908f9a6d9c54645af09bb54e5f56cdf7dbf1..6e04ca93e6de6c1cc41ce554a87656da3ec3e35c 100644 (file)
@@ -16,13 +16,16 @@ import base64
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
 
     processes = None
     WAITING = 20  # nominal value is 300
+    NODE_VERSION = '2.2.1'
 
     cr_serv_sample_data = {"input": {
         "sdnc-request-header": {
@@ -129,8 +132,10 @@ class TransportPCEtesting(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(
-            ['spdra', 'roadma', 'roadmc', 'spdrc'])
+        cls.processes = test_utils.start_sims([('spdra', cls.NODE_VERSION),
+                                               ('roadma', cls.NODE_VERSION),
+                                               ('roadmc', cls.NODE_VERSION),
+                                               ('spdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -143,22 +148,22 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(5)
 
     def test_01_connect_spdrA(self):
-        response = test_utils.mount_device("SPDR-SA1", 'spdra')
+        response = test_utils.mount_device("SPDR-SA1", ('spdra', self.NODE_VERSION))
         self.assertEqual(response.status_code,
                          requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_connect_spdrC(self):
-        response = test_utils.mount_device("SPDR-SC1", 'spdrc')
+        response = test_utils.mount_device("SPDR-SC1", ('spdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code,
                          requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_connect_rdmA(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code,
                          requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_04_connect_rdmC(self):
-        response = test_utils.mount_device("ROADM-C1", 'roadmc')
+        response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION))
         self.assertEqual(response.status_code,
                          requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
index a275c2ab4c9aaf7df399a72ad4fef3eac82c4f23..65869f7ff497fd22b0c5437e712c883407ccec8b 100644 (file)
@@ -15,7 +15,9 @@
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
@@ -33,11 +35,12 @@ class TransportPCEtesting(unittest.TestCase):
                            'lcp-hash-val': 'Swfw02qXGyI=',
                            'port-admin-state': 'InService',
                            'port-oper-state': 'InService'}
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['spdra'])
+        cls.processes = test_utils.start_sims([('spdra', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -50,7 +53,7 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(5)
 
     def test_01_connect_SPDR_SA1(self):
-        response = test_utils.mount_device("SPDR-SA1", 'spdra')
+        response = test_utils.mount_device("SPDR-SA1", ('spdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
 
index 4b047e2dafa673c9f4733496e0304746e8e7ef61..4d583c8c5cda90c1d1ee9217df9e912dd37fbfe8 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['spdra', 'spdrc'])
+        cls.processes = test_utils.start_sims([('spdra', cls.NODE_VERSION),
+                                               ('spdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -38,7 +42,7 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(5)
 
     def test_01_connect_SPDR_SA1(self):
-        response = test_utils.mount_device("SPDR-SA1", 'spdra')
+        response = test_utils.mount_device("SPDR-SA1", ('spdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created,
                          test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
@@ -51,7 +55,7 @@ class TransportPCEtesting(unittest.TestCase):
             'connected')
 
     def test_02_connect_SPDR_SC1(self):
-        response = test_utils.mount_device("SPDR-SC1", 'spdrc')
+        response = test_utils.mount_device("SPDR-SC1", ('spdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created,
                          test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
index fd80a5c75fac3c613c23de63201f0c5b6149a164..84e3652c764aca4747e68fa576e8e38168917ecd 100644 (file)
@@ -16,17 +16,20 @@ import unittest
 import time
 import logging
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['spdra'])
+        cls.processes = test_utils.start_sims([('spdra', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -39,7 +42,7 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(5)
 
     def test_01_connect_SPDR_SA1(self):
-        response = test_utils.mount_device("SPDR-SA1", 'spdra')
+        response = test_utils.mount_device("SPDR-SA1", ('spdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
 
index 831cf0d99c514285deee720d23b7b3578025d5cd..9316b20b616f0ecad66f564db5d9ab3de87d2f07 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEPortMappingTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -39,7 +42,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
         time.sleep(10)
 
     def test_01_rdm_device_connection(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_rdm_device_connected(self):
@@ -107,7 +110,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             res['mapping'])
 
     def test_08_xpdr_device_connection(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_09_xpdr_device_connected(self):
index 432ae129413efbe5468af56d0ba2f92288c57f81..0c2ab278ad5a96db4fa8a3c47aa9b7579eda8d65 100644 (file)
 import unittest
 #from unittest.result import failfast
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCERendererTesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -35,11 +38,11 @@ class TransportPCERendererTesting(unittest.TestCase):
         print("all processes killed")
 
     def test_01_rdm_device_connected(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_xpdr_device_connected(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_03_rdm_portmapping(self):
index 7d0d0bd9e6b01ddb8ba22265223a39563c6bf1e5..150a4c1af9a0ad8738c1d62a2b483bb1aff72cfe 100644 (file)
@@ -18,10 +18,9 @@ import os
 import sys
 import time
 import unittest
-
 import requests
-
-from common import test_utils
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 CREATED_SUCCESSFULLY = 'Result message should contain Xponder Roadm Link created successfully'
@@ -30,6 +29,7 @@ class TransportTapitesting(unittest.TestCase):
 
     processes = None
     WAITING = 20
+    NODE_VERSION = '2.2.1'
     cr_serv_sample_data = {"input": {
         "sdnc-request-header": {
             "request-id": "request-1",
@@ -154,7 +154,13 @@ class TransportTapitesting(unittest.TestCase):
             print("tapi installation feature failed...")
             test_utils.shutdown_process(cls.processes[0])
             sys.exit(2)
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmb', 'roadmc', 'xpdrc', 'spdra', 'spdrc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION),
+                                               ('roadma', cls.NODE_VERSION),
+                                               ('roadmb', cls.NODE_VERSION),
+                                               ('roadmc', cls.NODE_VERSION),
+                                               ('xpdrc', cls.NODE_VERSION),
+                                               ('spdra', cls.NODE_VERSION),
+                                               ('spdrc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -203,7 +209,7 @@ class TransportTapitesting(unittest.TestCase):
         self.assertNotIn("link", res["output"]["topology"], 'Topology should contain no link')
 
     def test_03_connect_rdmb(self):
-        response = test_utils.mount_device("ROADM-B1", 'roadmb')
+        response = test_utils.mount_device("ROADM-B1", ('roadmb', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
 
@@ -238,7 +244,7 @@ class TransportTapitesting(unittest.TestCase):
         time.sleep(5)
 
     def test_06_connect_xpdra(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
 
@@ -246,12 +252,12 @@ class TransportTapitesting(unittest.TestCase):
         self.test_04_check_tapi_topos()
 
     def test_08_connect_rdma(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
 
     def test_09_connect_rdmc(self):
-        response = test_utils.mount_device("ROADM-C1", 'roadmc')
+        response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
 
@@ -334,7 +340,7 @@ class TransportTapitesting(unittest.TestCase):
                          'Topology should contain 1 oms link')
 
     def test_15_connect_xpdrc(self):
-        response = test_utils.mount_device("XPDR-C1", 'xpdrc')
+        response = test_utils.mount_device("XPDR-C1", ('xpdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
 
@@ -399,13 +405,13 @@ class TransportTapitesting(unittest.TestCase):
                          'Topology should contain 2 oms links')
 
     def test_20_connect_spdr_sa1(self):
-        response = test_utils.mount_device("SPDR-SA1", 'spdra')
+        response = test_utils.mount_device("SPDR-SA1", ('spdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
         # TODO replace connect and disconnect timers with test_utils.wait_until_log_contains
 
     def test_21_connect_spdr_sc1(self):
-        response = test_utils.mount_device("SPDR-SC1", 'spdrc')
+        response = test_utils.mount_device("SPDR-SC1", ('spdrc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
         time.sleep(10)
         # TODO replace connect and disconnect timers with test_utils.wait_until_log_contains
index 66c0c23d328fb0c271dd87877a6942e735e8472b..d749323b9879ac7b6e1ddfc4315f0e67b982e759 100644 (file)
 import unittest
 import time
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
 
     processes = None
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -39,7 +42,7 @@ class TransportPCEtesting(unittest.TestCase):
 
     # Connect the ROADMA
     def test_01_connect_rdm(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     # Verify the termination points of the ROADMA
@@ -78,7 +81,7 @@ class TransportPCEtesting(unittest.TestCase):
 
 #     #Connect the XPDRA
     def test_04_connect_xpdr(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
 #     #Verify the termination points related to XPDR
index 60df28b48a01ef1e358c34fb8e3a25c54381e770..8ab6386e8ad318f4f0052e40403b7584b4aabee4 100644 (file)
@@ -17,7 +17,9 @@ import unittest
 import time
 import logging
 import requests
-from common import test_utils
+import sys
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCEtesting(unittest.TestCase):
@@ -90,11 +92,13 @@ class TransportPCEtesting(unittest.TestCase):
                             'org-openroadm-common-network:operational-state': 'inService'})]
         }
     }
+    NODE_VERSION = '2.2.1'
 
     @classmethod
     def setUpClass(cls):
         cls.processes = test_utils.start_tpce()
-        cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmb', 'roadmc'])
+        cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION), ('roadma', cls.NODE_VERSION),
+                                               ('roadmb', cls.NODE_VERSION), ('roadmc', cls.NODE_VERSION)])
 
     @classmethod
     def tearDownClass(cls):
@@ -107,7 +111,7 @@ class TransportPCEtesting(unittest.TestCase):
         time.sleep(5)
 
     def test_01_connect_ROADM_A1(self):
-        response = test_utils.mount_device("ROADM-A1", 'roadma')
+        response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_02_getClliNetwork(self):
@@ -189,7 +193,7 @@ class TransportPCEtesting(unittest.TestCase):
         self.assertEqual(len(listNode), 0)
 
     def test_06_connect_XPDRA(self):
-        response = test_utils.mount_device("XPDR-A1", 'xpdra')
+        response = test_utils.mount_device("XPDR-A1", ('xpdra', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_07_getClliNetwork(self):
@@ -320,7 +324,7 @@ class TransportPCEtesting(unittest.TestCase):
             self.assertEqual(len(check_list[link_type]), 0)
 
     def test_13_connect_ROADMC(self):
-        response = test_utils.mount_device("ROADM-C1", 'roadmc')
+        response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_14_omsAttributes_ROADMA_ROADMC(self):
@@ -521,7 +525,7 @@ class TransportPCEtesting(unittest.TestCase):
         self.assertEqual(len(listNode), 0)
 
     def test_21_connect_ROADMB(self):
-        response = test_utils.mount_device("ROADM-B1", 'roadmb')
+        response = test_utils.mount_device("ROADM-B1", ('roadmb', self.NODE_VERSION))
         self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
 
     def test_22_omsAttributes_ROADMA_ROADMB(self):
diff --git a/tests/transportpce_tests/7.1/__init__.py b/tests/transportpce_tests/7.1/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/transportpce_tests/7.1/common b/tests/transportpce_tests/7.1/common
deleted file mode 120000 (symlink)
index 8332399..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../common/
\ No newline at end of file
diff --git a/tests/transportpce_tests/7.1/simulators.py b/tests/transportpce_tests/7.1/simulators.py
deleted file mode 100644 (file)
index 5bdbbb5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-##############################################################################
-# Copyright (c) 2020 Orange, Inc. and others.  All rights reserved.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import os
-
-SIMS = {}
-
-HONEYNODE_EXECUTABLE = os.path.join(
-    os.path.dirname(os.path.realpath(__file__)),
-    "..", "..", "honeynode", "7.1", "honeynode-simulator", "honeycomb-tpce")
-SAMPLES_DIRECTORY = os.path.join(
-    os.path.dirname(os.path.realpath(__file__)),
-    "..", "..", "sample_configs", "openroadm", "7.1")
index 3b19c7c15dd2c5db2ac4638269ccac5179b2bc38..189e9245bfc6362af9ddefa5b9b26439e20552ac 100644 (file)
@@ -16,7 +16,8 @@ import os
 import sys
 import time
 import requests
-from common import test_utils
+sys.path.append('transportpce_tests/common/')
+import test_utils
 
 
 class TransportPCE400Gtesting(unittest.TestCase):
diff --git a/tests/transportpce_tests/common/log/.gitkeep b/tests/transportpce_tests/common/log/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
deleted file mode 120000 (symlink)
index 18d5fb86aab5b13697e9e06f385c702407962278..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../simulators.py
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..95fe8d9da66c7973318de9ff7ad6c8e0e7f2a520
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+##############################################################################
+# Copyright (c) 2020 Orange, Inc. and others.  All rights reserved.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+import os
+
+SIMS = {
+    ('xpdra', '1.2.1'): {'port': '17830', 'configfile': 'oper-XPDRA.xml', 'logfile': 'xpdra-121.log'},
+    ('roadma', '1.2.1'): {'port': '17831', 'configfile': 'oper-ROADMA.xml', 'logfile': 'roadma-121.log'},
+    ('roadmb', '1.2.1'): {'port': '17832', 'configfile': 'oper-ROADMB.xml', 'logfile': 'roadmb-121.log'},
+    ('roadmc', '1.2.1'): {'port': '17833', 'configfile': 'oper-ROADMC.xml', 'logfile': 'roadmc-121.log'},
+    ('xpdrc', '1.2.1'): {'port': '17834', 'configfile': 'oper-XPDRC.xml', 'logfile': 'xpdrc-121.log'},
+    ('roadma-full', '1.2.1'): {'port': '17821', 'configfile': 'oper-ROADMA-full.xml', 'logfile': 'roadma-121.log'},
+    ('roadmc-full', '1.2.1'): {'port': '17823', 'configfile': 'oper-ROADMC-full.xml', 'logfile': 'roadmc-121.log'},
+    ('xpdra', '2.2.1'): {'port': '17840', 'configfile': 'oper-XPDRA.xml', 'logfile': 'xpdra-221.log'},
+    ('roadma', '2.2.1'): {'port': '17841', 'configfile': 'oper-ROADMA.xml', 'logfile': 'roadma-221.log'},
+    ('roadmb', '2.2.1'): {'port': '17842', 'configfile': 'oper-ROADMB.xml', 'logfile': 'roadmb-221.log'},
+    ('roadmc', '2.2.1'): {'port': '17843', 'configfile': 'oper-ROADMC.xml', 'logfile': 'roadmc-221.log'},
+    ('roadmd', '2.2.1'): {'port': '17847', 'configfile': 'oper-ROADMD.xml', 'logfile': 'roadmd-221.log'},
+    ('xpdrc', '2.2.1'): {'port': '17844', 'configfile': 'oper-XPDRC.xml', 'logfile': 'xpdrc-221.log'},
+    ('spdra', '2.2.1'): {'port': '17845', 'configfile': 'oper-SPDRA.xml', 'logfile': 'spdra-221.log'},
+    ('spdrc', '2.2.1'): {'port': '17846', 'configfile': 'oper-SPDRC.xml', 'logfile': 'spdrc-221.log'},
+    ('xpdra', '7.1'): {'port': '17850', 'configfile': 'oper-XPDRA.xml', 'logfile': 'xpdra-71.log'},
+    ('roadma', '7.1'): {'port': '17851', 'configfile': 'oper-ROADMA.xml', 'logfile': 'roadma-71.log'},
+    ('roadmb', '7.1'): {'port': '17852', 'configfile': 'oper-ROADMB.xml', 'logfile': 'roadmb-71.log'},
+    ('roadmc', '7.1'): {'port': '17853', 'configfile': 'oper-ROADMC.xml', 'logfile': 'roadmc-71.log'},
+    ('xpdrc', '7.1'): {'port': '17854', 'configfile': 'oper-XPDRC.xml', 'logfile': 'xpdrc-71.log'},
+    ('xpdra2', '7.1'): {'port': '17857', 'configfile': 'oper-XPDRA2.xml', 'logfile': 'xpdra2-71.log'},
+    ('xpdrc2', '7.1'): {'port': '17858', 'configfile': 'oper-XPDRC2.xml', 'logfile': 'xpdrc2-71.log'}
+}
\ No newline at end of file
index 7ca0d6660d95431e8531abe4c3e389b63608eb4e..dfbd32f72ac1056f2464e874c432e09210fbf190 100644 (file)
@@ -25,8 +25,6 @@ import requests
 import simulators
 
 SIMS = simulators.SIMS
-HONEYNODE_EXECUTABLE = simulators.HONEYNODE_EXECUTABLE
-SAMPLES_DIRECTORY = simulators.SAMPLES_DIRECTORY
 
 HONEYNODE_OK_START_MSG = "Netconf SSH endpoint started successfully at 0.0.0.0"
 KARAF_OK_START_MSG = re.escape(
@@ -60,8 +58,7 @@ TYPE_APPLICATION_XML = {'Content-Type': 'application/xml', 'Accept': 'applicatio
 CODE_SHOULD_BE_200 = 'Http status code should be 200'
 CODE_SHOULD_BE_201 = 'Http status code should be 201'
 
-LOG_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
-
+SIM_LOG_DIRECTORY = os.path.join(os.path.dirname(os.path.realpath(__file__)), "log")
 KARAF_LOG = os.path.join(
     os.path.dirname(os.path.realpath(__file__)),
     "..", "..", "..", "karaf", "target", "assembly", "data", "log", "karaf.log")
@@ -76,13 +73,13 @@ else:
 
 def start_sims(sims_list):
     for sim in sims_list:
-        print("starting simulator for " + sim + "...")
-        log_file = os.path.join(LOG_DIRECTORY, SIMS[sim]['logfile'])
-        process = start_honeynode(log_file, SIMS[sim]['port'], SIMS[sim]['configfile'])
-        if wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 200):
-            print("simulator for " + sim + " started")
+        print("starting simulator " + sim[0] + " in OpenROADM device version " + sim[1] + "...")
+        log_file = os.path.join(SIM_LOG_DIRECTORY, SIMS[sim]['logfile'])
+        process = start_honeynode(log_file, sim)
+        if wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 100):
+            print("simulator for " + sim[0] + " started")
         else:
-            print("simulator for " + sim + " failed to start")
+            print("simulator for " + sim[0] + " failed to start")
             shutdown_process(process)
             for pid in process_list:
                 shutdown_process(pid)
@@ -434,11 +431,15 @@ def shutdown_process(process):
         process.send_signal(signal.SIGINT)
 
 
-def start_honeynode(log_file: str, node_port: str, node_config_file_name: str):
-    if os.path.isfile(HONEYNODE_EXECUTABLE):
+def start_honeynode(log_file: str, sim):
+    executable = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                              "..", "..", "honeynode", sim[1], "honeynode-simulator", "honeycomb-tpce")
+    sample_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                                    "..", "..", "sample_configs", "openroadm", sim[1])
+    if os.path.isfile(executable):
         with open(log_file, 'w') as outfile:
             return subprocess.Popen(
-                [HONEYNODE_EXECUTABLE, node_port, os.path.join(SAMPLES_DIRECTORY, node_config_file_name)],
+                [executable, SIMS[sim]['port'], os.path.join(sample_directory, SIMS[sim]['configfile'])],
                 stdout=outfile, stderr=outfile)
     return None
 
@@ -492,4 +493,3 @@ class TimeOut:
     def __exit__(self, type, value, traceback):
         # pylint: disable=W0622
         signal.alarm(0)
-