fix topology files relative paths in PCE functest
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_olm.py
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'}