rationalize functional tests sims starters 52/90452/6
authorguillaume.lambert <guillaume.lambert@orange.com>
Mon, 15 Jun 2020 11:05:16 +0000 (13:05 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Wed, 17 Jun 2020 07:34:33 +0000 (09:34 +0200)
in test_utils.py:
- centralize sims ports and config/log files in one associative array
- based on this, use one method start_sim(sim) for every sims
- remove obsolete dedicated-per-sim methods
- centralize messages printed at sims and tpce start-up

in tests files
- replace harcoded port values by the corresponding array value
- replace the term "honeynode" by "sim" which is more generic
- remove obsolete sims timers in 2.2.1 tests

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I99c29be7cfcccbce28748cf79ddcf40d148641ef

19 files changed:
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_topoPortMapping.py
tests/transportpce_tests/1.2.1/test_topology.py
tests/transportpce_tests/1.2.1/test_utils.py
tests/transportpce_tests/2.2.1/test_end2end.py
tests/transportpce_tests/2.2.1/test_olm.py
tests/transportpce_tests/2.2.1/test_otn_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_topoPortMapping.py
tests/transportpce_tests/2.2.1/test_topology.py
tests/transportpce_tests/2.2.1/test_utils.py

index cacde43860ef9b8f7a3b0e9ed9a82e6efbf94003..3fad3d284b05c931c8cd5a0e18381c083212fa1f 100644 (file)
@@ -22,10 +22,10 @@ import test_utils
 class TransportPCEFulltesting(unittest.TestCase):
     headers = {'content-type': 'application/json'}
     odl_process = None
-    honeynode_process1 = None
-    honeynode_process2 = None
-    honeynode_process3 = None
-    honeynode_process4 = None
+    sim_process1 = None
+    sim_process2 = None
+    sim_process3 = None
+    sim_process4 = None
     restconf_baseurl = "http://localhost:8181/restconf"
     WAITING = 20  # nominal value is 300
 
@@ -33,24 +33,19 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+        cls.sim_process1 = test_utils.start_sim('xpdra')
         time.sleep(20)
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_full_honeynode()
+        cls.sim_process2 = test_utils.start_sim('roadma-full')
         time.sleep(20)
 
-        print("starting honeynode3...")
-        cls.honeynode_process3 = test_utils.start_roadmc_full_honeynode()
+        cls.sim_process3 = test_utils.start_sim('roadmc-full')
         time.sleep(20)
 
-        print("starting honeynode4...")
-        cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
+        cls.sim_process4 = test_utils.start_sim('xpdrc')
         time.sleep(20)
-        print("all honeynodes started")
+        print("all sims started")
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(80)
         print("opendaylight started")
@@ -62,26 +57,26 @@ class TransportPCEFulltesting(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()
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
@@ -99,7 +94,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17830",
+            "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'}
@@ -118,7 +113,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17834",
+            "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'}
@@ -137,7 +132,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17821",
+            "netconf-node-topology:port": test_utils.sims['roadma-full']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -156,7 +151,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17823",
+            "netconf-node-topology:port": test_utils.sims['roadmc-full']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index 6fbe52ffd284a4dae226ce3bb0c94999e8411647..64a88194a9a9dc471a66f302e38ca1e8fe0db7d3 100644 (file)
@@ -32,7 +32,6 @@ class TransportGNPYtesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(30)
         print("opendaylight started")
index a6059ecb3891e0602007f7ace924d0d83f178480..956305635bd953d20100334508fe4c2be2a75353 100644 (file)
@@ -24,10 +24,10 @@ 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"
 
@@ -35,24 +35,19 @@ class TransportOlmTesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+        cls.sim_process1 = test_utils.start_sim('xpdra')
         time.sleep(20)
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_full_honeynode()
+        cls.sim_process2 = test_utils.start_sim('roadma-full')
         time.sleep(20)
 
-        print("starting honeynode3...")
-        cls.honeynode_process3 = test_utils.start_roadmc_full_honeynode()
+        cls.sim_process3 = test_utils.start_sim('roadmc-full')
         time.sleep(20)
 
-        print("starting honeynode4...")
-        cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
+        cls.sim_process4 = test_utils.start_sim('xpdrc')
         time.sleep(20)
-        print("all honeynodes started")
+        print("all sims started")
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -64,26 +59,26 @@ 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]))
@@ -100,7 +95,7 @@ class TransportOlmTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17830",
+            "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'}
@@ -119,7 +114,7 @@ class TransportOlmTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17834",
+            "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'}
@@ -138,7 +133,7 @@ class TransportOlmTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17821",
+            "netconf-node-topology:port": test_utils.sims['roadma-full']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -157,7 +152,7 @@ class TransportOlmTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17823",
+            "netconf-node-topology:port": test_utils.sims['roadmc-full']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index f97dda23adb6159908643770b7da8f828808a17a..5375dabc7e75c216f305ef20e29e6b7808627842 100644 (file)
@@ -46,7 +46,6 @@ class TransportPCEtesting(unittest.TestCase):
     @classmethod
     def setUpClass(cls):  # a class method called before tests in an individual class run.
         cls._get_file()
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(90)
         print("opendaylight started")
index 301d745580541369f8c41242f6cfd5a6e97951a5..bf42eb9d509ee41eed8b4353538cf000b20d25eb 100644 (file)
@@ -20,8 +20,8 @@ import test_utils
 
 class TransportPCEPortMappingTesting(unittest.TestCase):
 
-    honeynode_process1 = None
-    honeynode_process2 = None
+    sim_process1 = None
+    sim_process2 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
@@ -29,15 +29,12 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+        cls.sim_process1 = test_utils.start_sim('xpdra')
         time.sleep(20)
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
+        cls.sim_process2 = test_utils.start_sim('roadma')
         time.sleep(20)
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -49,16 +46,16 @@ class TransportPCEPortMappingTesting(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()
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
 
     def setUp(self):
         print("execution of {}".format(self.id().split(".")[-1]))
@@ -97,7 +94,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17831",
+            "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'}
@@ -190,7 +187,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17830",
+            "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'}
index 1cee5f143640e635295cc40c7e2a6c13551924b2..796de915cd76935701cec8b3ba9ed0255fa76a39 100644 (file)
@@ -24,8 +24,8 @@ import test_utils
 
 class TransportPCERendererTesting(unittest.TestCase):
 
-    honeynode_process1 = None
-    honeynode_process2 = None
+    sim_process1 = None
+    sim_process2 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
@@ -33,15 +33,12 @@ class TransportPCERendererTesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+        cls.sim_process1 = test_utils.start_sim('xpdra')
         time.sleep(20)
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
+        cls.sim_process2 = test_utils.start_sim('roadma')
         time.sleep(20)
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -53,16 +50,16 @@ class TransportPCERendererTesting(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()
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
 
     def setUp(self):
         print("execution of {}".format(self.id().split(".")[-1]))
@@ -79,7 +76,7 @@ class TransportPCERendererTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17831",
+            "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'}
@@ -98,7 +95,7 @@ class TransportPCERendererTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17830",
+            "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'}
index b9b4bccd7bce25e6cd070f9c1b69574eefbe4e09..ab46c0df96422ef4916b648b322a8d0414a0fdfc 100644 (file)
@@ -20,8 +20,8 @@ import test_utils
 
 class TransportPCEtesting(unittest.TestCase):
 
-    honeynode_process1 = None
-    honeynode_process2 = None
+    sim_process1 = None
+    sim_process2 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
@@ -29,15 +29,12 @@ class TransportPCEtesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+        cls.sim_process1 = test_utils.start_sim('xpdra')
         time.sleep(20)
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
+        cls.sim_process2 = test_utils.start_sim('roadma')
         time.sleep(20)
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -49,16 +46,16 @@ class TransportPCEtesting(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()
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
 
     def setUp(self):
         time.sleep(10)
@@ -76,7 +73,7 @@ class TransportPCEtesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17831",
+            "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'}
@@ -143,7 +140,7 @@ class TransportPCEtesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17830",
+            "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'}
index b017b40f8c60fa62eb5c569f81cc7c443d6499b0..bade42ccf1bbe56d2663a21d7d2cdb010011cf74 100644 (file)
@@ -20,10 +20,10 @@ import test_utils
 
 class TransportPCETopologyTesting(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"
 
@@ -31,24 +31,19 @@ class TransportPCETopologyTesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+        cls.sim_process1 = test_utils.start_sim('xpdra')
         time.sleep(20)
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
+        cls.sim_process2 = test_utils.start_sim('roadma')
         time.sleep(20)
 
-        print("starting honeynode3...")
-        cls.honeynode_process3 = test_utils.start_roadmb_honeynode()
+        cls.sim_process3 = test_utils.start_sim('roadmb')
         time.sleep(20)
 
-        print("starting honeynode4...")
-        cls.honeynode_process4 = test_utils.start_roadmc_honeynode()
+        cls.sim_process4 = test_utils.start_sim('roadmc')
         time.sleep(20)
-        print("all honeynodes started")
+        print("all sims started")
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -60,28 +55,28 @@ class TransportPCETopologyTesting(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()
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
 
-        for child in psutil.Process(cls.honeynode_process3.pid).children():
+        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()
+        cls.sim_process3.send_signal(signal.SIGINT)
+        cls.sim_process3.wait()
 
-        for child in psutil.Process(cls.honeynode_process4.pid).children():
+        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):
         time.sleep(5)
@@ -98,7 +93,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17831",
+            "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'}
@@ -249,7 +244,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17830",
+            "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'}
@@ -482,7 +477,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17833",
+            "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'}
@@ -795,7 +790,7 @@ class TransportPCETopologyTesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17832",
+            "netconf-node-topology:port": test_utils.sims['roadmb']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index d6310951699607f9ed0ec694bd3964cb5de7db15..99a51023d51599317870934fb0e2055677301e6b 100644 (file)
@@ -1,6 +1,25 @@
+#!/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
 import subprocess
 
+sims = {
+    'xpdra': {'port': '17830', 'configfile': 'oper-XPDRA.xml'},
+    'roadma': {'port': '17831', 'configfile': 'oper-ROADMA.xml'},
+    'roadmb': {'port': '17832', 'configfile': 'oper-ROADMB.xml'},
+    'roadmc': {'port': '17833', 'configfile': 'oper-ROADMC.xml'},
+    'xpdrc': {'port': '17834', 'configfile': 'oper-XPDRC.xml'},
+    'roadma-full': {'port': '17821', 'configfile': 'oper-ROADMA-full.xml'},
+    'roadmc-full': {'port': '17823', 'configfile': 'oper-ROADMC-full.xml'}
+}
+
 honeynode_executable = os.path.join(
     os.path.dirname(os.path.realpath(__file__)),
     "..", "..", "honeynode", "1.2.1", "honeynode-simulator", "honeycomb-tpce")
@@ -9,63 +28,17 @@ samples_directory = os.path.join(
     "..", "..", "sample_configs", "openroadm", "1.2.1")
 
 
-def start_xpdra_honeynode():
-    if os.path.isfile(honeynode_executable):
-        with open('honeynode1.log', 'w') as outfile:
-            return subprocess.Popen(
-                [honeynode_executable, "17830", os.path.join(samples_directory, "oper-XPDRA.xml")],
-                stdout=outfile, stderr=outfile)
-
-
-def start_roadma_full_honeynode():
-    if os.path.isfile(honeynode_executable):
-        with open('honeynode2.log', 'w') as outfile:
-            return subprocess.Popen(
-                [honeynode_executable, "17821", os.path.join(samples_directory, "oper-ROADMA-full.xml")],
-                stdout=outfile, stderr=outfile)
-
-
-def start_roadma_honeynode():
-    if os.path.isfile(honeynode_executable):
-        with open('honeynode2.log', 'w') as outfile:
-            return subprocess.Popen(
-                [honeynode_executable, "17831", os.path.join(samples_directory, "oper-ROADMA.xml")],
-                stdout=outfile, stderr=outfile)
-
-
-def start_roadmb_honeynode():
-    if os.path.isfile(honeynode_executable):
-        with open('honeynode3.log', 'w') as outfile:
-            return subprocess.Popen(
-                [honeynode_executable, "17832", os.path.join(samples_directory, "oper-ROADMB.xml")],
-                stdout=outfile, stderr=outfile)
-
-
-def start_roadmc_full_honeynode():
-    if os.path.isfile(honeynode_executable):
-        with open('honeynode3.log', 'w') as outfile:
-            return subprocess.Popen(
-                [honeynode_executable, "17823", os.path.join(samples_directory, "oper-ROADMC-full.xml")],
-                stdout=outfile, stderr=outfile)
-
-
-def start_roadmc_honeynode():
-    if os.path.isfile(honeynode_executable):
-        with open('honeynode4.log', 'w') as outfile:
-            return subprocess.Popen(
-                [honeynode_executable, "17833", os.path.join(samples_directory, "oper-ROADMC.xml")],
-                stdout=outfile, stderr=outfile)
-
-
-def start_xpdrc_honeynode():
+def start_sim(sim):
+    print("starting simulator for " + sim + "...")
     if os.path.isfile(honeynode_executable):
-        with open('honeynode4.log', 'w') as outfile:
+        with open(sim+'.log', 'w') as outfile:
             return subprocess.Popen(
-                [honeynode_executable, "17834", os.path.join(samples_directory, "oper-XPDRC.xml")],
+                [honeynode_executable, sims[sim]['port'], os.path.join(samples_directory, sims[sim]['configfile'])],
                 stdout=outfile, stderr=outfile)
 
 
 def start_tpce():
+    print("starting opendaylight...")
     if "USE_LIGHTY" in os.environ and os.environ['USE_LIGHTY'] == 'True':
         print("starting LIGHTY.IO TransportPCE build...")
         executable = os.path.join(
@@ -74,8 +47,7 @@ def start_tpce():
             "clean-start-controller.sh")
         with open('odl.log', 'w') as outfile:
             return subprocess.Popen(
-                ["sh", executable], stdout=outfile, stderr=outfile,
-                stdin=open(os.devnull))
+                ["sh", executable], stdout=outfile, stderr=outfile, stdin=None)
     else:
         print("starting KARAF TransportPCE build...")
         executable = os.path.join(
@@ -83,5 +55,4 @@ def start_tpce():
             "..", "..", "..", "karaf", "target", "assembly", "bin", "karaf")
         with open('odl.log', 'w') as outfile:
             return subprocess.Popen(
-                ["sh", executable, "server"], stdout=outfile, stderr=outfile,
-                stdin=open(os.devnull))
+                ["sh", executable, "server"], stdout=outfile, stderr=outfile, stdin=None)
index 83d938e8b62b72111e7e09cf5021c7fc64ead7e2..1b1aab3dbc29b74ba8f3dee1616fa1c99159ba10 100644 (file)
@@ -24,10 +24,10 @@ import test_utils
 class TransportPCEFulltesting(unittest.TestCase):
 
     odl_process = None
-    honeynode_process1 = None
-    honeynode_process2 = None
-    honeynode_process3 = None
-    honeynode_process4 = None
+    sim_process1 = None
+    sim_process2 = None
+    sim_process3 = None
+    sim_process4 = None
     restconf_baseurl = "http://localhost:8181/restconf"
     WAITING = 20  # nominal value is 300
 
@@ -35,24 +35,15 @@ class TransportPCEFulltesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
-        time.sleep(20)
+        cls.sim_process1 = test_utils.start_sim('xpdra')
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
-        time.sleep(20)
+        cls.sim_process2 = test_utils.start_sim('roadma')
 
-        print("starting honeynode3...")
-        cls.honeynode_process3 = test_utils.start_roadmc_honeynode()
-        time.sleep(20)
+        cls.sim_process3 = test_utils.start_sim('roadmc')
 
-        print("starting honeynode4...")
-        cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
-        time.sleep(20)
-        print("all honeynodes started")
+        cls.sim_process4 = test_utils.start_sim('xpdrc')
+        print("all sims started")
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(80)
         print("opendaylight started")
@@ -64,26 +55,26 @@ class TransportPCEFulltesting(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()
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
@@ -101,7 +92,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "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'}
@@ -120,7 +111,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "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'}
@@ -139,7 +130,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "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:port": test_utils.sims['roadma']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -158,7 +149,7 @@ class TransportPCEFulltesting(unittest.TestCase):
             "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:port": test_utils.sims['roadmc']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index 8a006833591a8ee1656786087753b199dc32faa2..edca444cae34ce259c0813ca92c99cb403455863 100644 (file)
@@ -24,10 +24,10 @@ 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"
 
@@ -35,25 +35,16 @@ class TransportOlmTesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
-        time.sleep(20)
+        cls.sim_process1 = test_utils.start_sim('xpdra')
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
-        time.sleep(20)
+        cls.sim_process2 = test_utils.start_sim('roadma')
 
-        print("starting honeynode3...")
-        cls.honeynode_process3 = test_utils.start_roadmc_honeynode()
-        time.sleep(20)
+        cls.sim_process3 = test_utils.start_sim('roadmc')
 
-        print("starting honeynode4...")
-        cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
-        time.sleep(20)
+        cls.sim_process4 = test_utils.start_sim('xpdrc')
 
-        print("all honeynodes started")
+        print("all sims started")
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -65,26 +56,26 @@ 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]))
@@ -101,7 +92,7 @@ class TransportOlmTesting(unittest.TestCase):
             "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'}
@@ -120,7 +111,7 @@ class TransportOlmTesting(unittest.TestCase):
             "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'}
@@ -139,7 +130,7 @@ class TransportOlmTesting(unittest.TestCase):
             "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:port": test_utils.sims['roadma']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -158,7 +149,7 @@ class TransportOlmTesting(unittest.TestCase):
             "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:port": test_utils.sims['roadmc']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index 27f09cd006740c47ae6f109c9b3e2a45d65b47d7..97a6983daab3e84843ea1865a8272a5bd0041bae 100644 (file)
@@ -28,17 +28,14 @@ def extract_a_from_b(a, b):
 
 class TransportPCEtesting(unittest.TestCase):
 
-    honeynode_process1 = None
+    sim_process1 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_spdra_honeynode()
-        time.sleep(30)
+        cls.sim_process1 = test_utils.start_sim('spdrav2')
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -50,11 +47,11 @@ class TransportPCEtesting(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()
+        cls.sim_process1.send_signal(signal.SIGINT)
+        cls.sim_process1.wait()
 
     def setUp(self):
         time.sleep(5)
@@ -68,7 +65,7 @@ class TransportPCEtesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17845",
+            "netconf-node-topology:port": test_utils.sims['spdrav2']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index 0e0390fa241c032b0284714fe107655ac94c2ac3..062c0d9c4e817b03e6006c8d1aec29c3591b9c5e 100644 (file)
@@ -24,17 +24,14 @@ import test_utils
 
 class TransportPCEtesting(unittest.TestCase):
 
-    honeynode_process1 = None
+    sim_process1 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_spdra_honeynode()
-        time.sleep(20)
+        cls.sim_process1 = test_utils.start_sim('spdrav2')
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -46,11 +43,11 @@ class TransportPCEtesting(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()
+        cls.sim_process1.send_signal(signal.SIGINT)
+        cls.sim_process1.wait()
 
     def setUp(self):
         time.sleep(5)
@@ -64,7 +61,7 @@ class TransportPCEtesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17845",
+            "netconf-node-topology:port": test_utils.sims['spdrav2']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index 99ed92574ecc6a1dc06df1b772904f70d18df0f4..5bed24b53feaebc46cc6d78b36f7f43439683c66 100644 (file)
@@ -23,23 +23,18 @@ import test_utils
 
 class TransportPCEPortMappingTesting(unittest.TestCase):
 
-    honeynode_process1 = None
-    honeynode_process2 = None
+    sim_process1 = None
+    sim_process2 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
-        time.sleep(20)
+        cls.sim_process1 = test_utils.start_sim('xpdra')
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
-        time.sleep(20)
-        print("all honeynodes started")
+        cls.sim_process2 = test_utils.start_sim('roadma')
+        print("all sims started")
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -51,16 +46,16 @@ class TransportPCEPortMappingTesting(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()
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
 
     def setUp(self):
         print("execution of {}".format(self.id().split(".")[-1]))
@@ -75,7 +70,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             "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:port": test_utils.sims['roadma']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -184,7 +179,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase):
             "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'}
index 57b90df4d854564b2a4b30990f5af5f9dc5ed83a..df0cc32de23a07e4a9b811a19bd7f75256b6325c 100644 (file)
@@ -24,8 +24,8 @@ import test_utils
 
 class TransportPCERendererTesting(unittest.TestCase):
 
-    honeynode_process1 = None
-    honeynode_process2 = None
+    sim_process1 = None
+    sim_process2 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
@@ -33,14 +33,10 @@ class TransportPCERendererTesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
-        time.sleep(20)
+        cls.sim_process1 = test_utils.start_sim('xpdra')
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
-        time.sleep(20)
-        print("all honeynodes started")
+        cls.sim_process2 = test_utils.start_sim('roadma')
+        print("all sims started")
 
         print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
@@ -54,16 +50,16 @@ class TransportPCERendererTesting(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()
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
 
     def setUp(self):
         print("execution of {}".format(self.id().split(".")[-1]))
@@ -80,7 +76,7 @@ class TransportPCERendererTesting(unittest.TestCase):
             "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:port": test_utils.sims['roadma']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -101,7 +97,7 @@ class TransportPCERendererTesting(unittest.TestCase):
             "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'}
index ed2ec846f05c237b66ec11f40af0d126a78d9ac2..4594085e84081dcec6fec23a3e298004acf4714e 100644 (file)
@@ -27,11 +27,11 @@ CREATED_SUCCESSFULLY = 'Result message should contain Xponder Roadm Link created
 
 class TransportTapitesting(unittest.TestCase):
     odl_process = None
-    honeynode_process1 = None
-    honeynode_process2 = None
-    honeynode_process3 = None
-    honeynode_process4 = None
-    honeynode_process5 = None
+    sim_process1 = None
+    sim_process2 = None
+    sim_process3 = None
+    sim_process4 = None
+    sim_process5 = None
 
     # START_IGNORE_XTESTING
 
@@ -39,7 +39,6 @@ class TransportTapitesting(unittest.TestCase):
     def setUpClass(cls):
         cls.init_failed = False
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
             karaf_log = os.path.join(
@@ -61,30 +60,25 @@ class TransportTapitesting(unittest.TestCase):
                 found = test_utils.wait_until_log_contains(karaf_log, searched_expr, time_to_wait=60)
                 cls.init_failed = not found
         if not cls.init_failed:
-            print("starting XPDRA...")
-            cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+            cls.sim_process1 = test_utils.start_sim('xpdra')
 
-            print("starting ROADMA...")
-            cls.honeynode_process2 = test_utils.start_roadma_honeynode()
+            cls.sim_process2 = test_utils.start_sim('roadma')
 
-            print("starting ROADMC...")
-            cls.honeynode_process3 = test_utils.start_roadmc_honeynode()
+            cls.sim_process3 = test_utils.start_sim('roadmc')
 
-            print("starting XPDRC...")
-            cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
+            cls.sim_process4 = test_utils.start_sim('xpdrc')
 
-            print("starting SPDRA...")
-            cls.honeynode_process5 = test_utils.start_spdra_honeynode()
-            print("all honeynodes started")
+            cls.sim_process5 = test_utils.start_sim('spdrav2')
+            print("all sims started")
 
     @classmethod
     def tearDownClass(cls):
         test_utils.shutdown_process(cls.odl_process)
-        test_utils.shutdown_process(cls.honeynode_process1)
-        test_utils.shutdown_process(cls.honeynode_process2)
-        test_utils.shutdown_process(cls.honeynode_process3)
-        test_utils.shutdown_process(cls.honeynode_process4)
-        test_utils.shutdown_process(cls.honeynode_process5)
+        test_utils.shutdown_process(cls.sim_process1)
+        test_utils.shutdown_process(cls.sim_process2)
+        test_utils.shutdown_process(cls.sim_process3)
+        test_utils.shutdown_process(cls.sim_process4)
+        test_utils.shutdown_process(cls.sim_process5)
         print("all processes killed")
 
     def setUp(self):  # instruction executed before each test method
@@ -99,7 +93,7 @@ class TransportTapitesting(unittest.TestCase):
         url = ("{}/config/network-topology:"
                "network-topology/topology/topology-netconf/node/SPDR-SA1"
                .format(RESTCONF_BASE_URL))
-        data = test_utils.generate_connect_data("SPDR-SA1", "17845")
+        data = test_utils.generate_connect_data("SPDR-SA1", test_utils.sims['spdrav2']['port'])
         response = test_utils.put_request(url, data, 'admin', 'admin')
         self.assertEqual(response.status_code, requests.codes.created, CODE_SHOULD_BE_201)  # pylint: disable=no-member
         time.sleep(10)
@@ -108,7 +102,7 @@ class TransportTapitesting(unittest.TestCase):
         url = ("{}/config/network-topology:"
                "network-topology/topology/topology-netconf/node/XPDR-A1"
                .format(RESTCONF_BASE_URL))
-        data = test_utils.generate_connect_data("XPDR-A1", "17840")
+        data = test_utils.generate_connect_data("XPDR-A1", test_utils.sims['xpdra']['port'])
         response = test_utils.put_request(url, data, 'admin', 'admin')
         self.assertEqual(response.status_code, requests.codes.created, CODE_SHOULD_BE_201)  # pylint: disable=no-member
         time.sleep(10)
@@ -117,7 +111,7 @@ class TransportTapitesting(unittest.TestCase):
         url = ("{}/config/network-topology:"
                "network-topology/topology/topology-netconf/node/XPDR-C1"
                .format(RESTCONF_BASE_URL))
-        data = test_utils.generate_connect_data("XPDR-C1", "17844")
+        data = test_utils.generate_connect_data("XPDR-C1", test_utils.sims['xpdrc']['port'])
         response = test_utils.put_request(url, data, 'admin', 'admin')
         self.assertEqual(response.status_code, requests.codes.created, CODE_SHOULD_BE_201)  # pylint: disable=no-member
         time.sleep(10)
@@ -126,7 +120,7 @@ class TransportTapitesting(unittest.TestCase):
         url = ("{}/config/network-topology:"
                "network-topology/topology/topology-netconf/node/ROADM-A1"
                .format(RESTCONF_BASE_URL))
-        data = test_utils.generate_connect_data("ROADM-A1", "17841")
+        data = test_utils.generate_connect_data("ROADM-A1", test_utils.sims['roadma']['port'])
         response = test_utils.put_request(url, data, 'admin', 'admin')
         self.assertEqual(response.status_code, requests.codes.created, CODE_SHOULD_BE_201)  # pylint: disable=no-member
         time.sleep(20)
@@ -135,7 +129,7 @@ class TransportTapitesting(unittest.TestCase):
         url = ("{}/config/network-topology:"
                "network-topology/topology/topology-netconf/node/ROADM-C1"
                .format(RESTCONF_BASE_URL))
-        data = test_utils.generate_connect_data("ROADM-C1", "17843")
+        data = test_utils.generate_connect_data("ROADM-C1", test_utils.sims['roadmc']['port'])
         response = test_utils.put_request(url, data, 'admin', 'admin')
         self.assertEqual(response.status_code, requests.codes.created, CODE_SHOULD_BE_201)  # pylint: disable=no-member
         time.sleep(20)
index 58c0b9dc6405de281aa75728631042042cbff710..7f23aee7974fd0abab94bcd871bbe1135098335e 100644 (file)
@@ -24,8 +24,8 @@ import test_utils
 
 class TransportPCEtesting(unittest.TestCase):
 
-    honeynode_process1 = None
-    honeynode_process2 = None
+    sim_process1 = None
+    sim_process2 = None
     odl_process = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
@@ -33,16 +33,11 @@ class TransportPCEtesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
-        time.sleep(20)
+        cls.sim_process1 = test_utils.start_sim('xpdra')
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
-        time.sleep(20)
-        print("all honeynodes started")
+        cls.sim_process2 = test_utils.start_sim('roadma')
+        print("all sims started")
 
-        print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
         print("opendaylight started")
@@ -54,16 +49,16 @@ class TransportPCEtesting(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()
+        cls.sim_process2.send_signal(signal.SIGINT)
+        cls.sim_process2.wait()
 
     def setUp(self):
         time.sleep(10)
@@ -81,7 +76,7 @@ class TransportPCEtesting(unittest.TestCase):
             "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:port": test_utils.sims['roadma']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -153,7 +148,7 @@ class TransportPCEtesting(unittest.TestCase):
             "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'}
index 54762d24852bc059d3ad07e39d05ef37c1f2df01..a00733479351754263240a1e269beae9d5d40d0c 100644 (file)
@@ -24,10 +24,10 @@ import test_utils
 
 class TransportPCEtesting(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"
 
@@ -35,22 +35,14 @@ class TransportPCEtesting(unittest.TestCase):
 
     @classmethod
     def setUpClass(cls):
-        print("starting honeynode1...")
-        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
-        time.sleep(20)
+        cls.sim_process1 = test_utils.start_sim('xpdra')
 
-        print("starting honeynode2...")
-        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
-        time.sleep(20)
+        cls.sim_process2 = test_utils.start_sim('roadma')
 
-        print("starting honeynode3...")
-        cls.honeynode_process3 = test_utils.start_roadmb_honeynode()
-        time.sleep(20)
+        cls.sim_process3 = test_utils.start_sim('roadmb')
 
-        print("starting honeynode4...")
-        cls.honeynode_process4 = test_utils.start_roadmc_honeynode()
-        time.sleep(20)
-        print("all honeynodes started")
+        cls.sim_process4 = test_utils.start_sim('roadmc')
+        print("all sims started")
 
         print("starting opendaylight...")
         cls.odl_process = test_utils.start_tpce()
@@ -64,26 +56,26 @@ class TransportPCEtesting(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):
         time.sleep(5)
@@ -100,7 +92,7 @@ class TransportPCEtesting(unittest.TestCase):
             "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:port": test_utils.sims['roadma']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -257,7 +249,7 @@ class TransportPCEtesting(unittest.TestCase):
             "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'}
@@ -492,7 +484,7 @@ class TransportPCEtesting(unittest.TestCase):
             "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:port": test_utils.sims['roadmc']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
@@ -805,7 +797,7 @@ class TransportPCEtesting(unittest.TestCase):
             "netconf-node-topology:username": "admin",
             "netconf-node-topology:password": "admin",
             "netconf-node-topology:host": "127.0.0.1",
-            "netconf-node-topology:port": "17842",
+            "netconf-node-topology:port": test_utils.sims['roadmb']['port'],
             "netconf-node-topology:tcp-only": "false",
             "netconf-node-topology:pass-through": {}}]}
         headers = {'content-type': 'application/json'}
index 0275d05d42368e723c98e2b5c2e5edf887052984..e6b6f92093e177fd9e3f2181f22ac7c0fca00a7f 100644 (file)
@@ -16,6 +16,16 @@ import subprocess
 import psutil
 import requests
 
+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'},
+    'xpdrc': {'port': '17844', 'configfile': 'oper-XPDRC.xml', 'logfile': 'oper-XPDRC.log'},
+    'spdrav2': {'port': '17845', 'configfile': 'oper-SPDRAv2.xml', 'logfile': 'oper-SPDRAv2.log'},
+    'spdrav1': {'port': '17846', 'configfile': 'oper-SPDRAv1.xml', 'logfile': 'oper-SPDRAv1.log'}
+}
+
 HONEYNODE_OK_START_MSG = re.escape("Netconf SSH endpoint started successfully at 0.0.0.0")
 
 TYPE_APPLICATION_JSON = {'content-type': 'application/json'}
@@ -30,49 +40,19 @@ samples_directory = os.path.join(
 log_directory = os.path.dirname(os.path.realpath(__file__))
 
 
-def start_xpdra_honeynode():
-    log_file = os.path.join(log_directory, "oper-XPDRA.log")
-    process = start_node(log_file, "17840", "oper-XPDRA.xml")
-    wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 5000)
-    return process
-
-
-def start_roadma_honeynode():
-    log_file = os.path.join(log_directory, "oper-ROADMA.log")
-    process = start_node(log_file, "17841", "oper-ROADMA.xml")
-    wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 5000)
-    return process
-
-
-def start_roadmb_honeynode():
-    log_file = os.path.join(log_directory, "oper-ROADMB.log")
-    process = start_node(log_file, "17842", "oper-ROADMB.xml")
-    wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 5000)
-    return process
-
-
-def start_roadmc_honeynode():
-    log_file = os.path.join(log_directory, "oper-ROADMC.log")
-    process = start_node(log_file, "17843", "oper-ROADMC.xml")
-    wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 5000)
-    return process
-
-
-def start_xpdrc_honeynode():
-    log_file = os.path.join(log_directory, "oper-XPDRC.log")
-    process = start_node(log_file, "17844", "oper-XPDRC.xml")
-    wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 5000)
-    return process
-
-
-def start_spdra_honeynode():
-    log_file = os.path.join(log_directory, "oper-SPDRAv2.log")
-    process = start_node(log_file, "17845", "oper-SPDRAv2.xml")
-    wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 5000)
+def start_sim(sim):
+    print("starting simulator for " + sim + "...")
+    log_file = os.path.join(log_directory, sims[sim]['logfile'])
+    process = start_node(log_file, sims[sim]['port'], sims[sim]['configfile'])
+    if wait_until_log_contains(log_file, HONEYNODE_OK_START_MSG, 5000):
+        print("simulator for " + sim + " started")
+    else:
+        print("simulator for " + sim + "failed to start")
     return process
 
 
 def start_tpce():
+    print("starting opendaylight...")
     if "USE_LIGHTY" in os.environ and os.environ['USE_LIGHTY'] == 'True':
         print("starting LIGHTY.IO TransportPCE build...")
         executable = os.path.join(
@@ -81,8 +61,7 @@ def start_tpce():
             "clean-start-controller.sh")
         with open('odl.log', 'w') as outfile:
             return subprocess.Popen(
-                ["sh", executable], stdout=outfile, stderr=outfile,
-                stdin=open(os.devnull))
+                ["sh", executable], stdout=outfile, stderr=outfile, stdin=None)
     else:
         print("starting KARAF TransportPCE build...")
         executable = os.path.join(
@@ -90,8 +69,7 @@ def start_tpce():
             "..", "..", "..", "karaf", "target", "assembly", "bin", "karaf")
         with open('odl.log', 'w') as outfile:
             return subprocess.Popen(
-                ["sh", executable, "server"], stdout=outfile, stderr=outfile,
-                stdin=open(os.devnull))
+                ["sh", executable, "server"], stdout=outfile, stderr=outfile, stdin=None)
 
 
 def install_karaf_feature(feature_name: str):