Bump lighty.io core and add tests support for it
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_end2end.py
index ae160c57b8498150ae3877cdb0efb824ff293174..610878fd2db0c8987eeb2988bf62cfd954e099b3 100644 (file)
@@ -18,6 +18,7 @@ import shutil
 import subprocess
 import time
 import unittest
+import test_utils
 
 
 class TransportPCEFulltesting(unittest.TestCase):
@@ -33,70 +34,28 @@ class TransportPCEFulltesting(unittest.TestCase):
 #START_IGNORE_XTESTING
 
     @classmethod
-    def __start_honeynode1(cls):
-        executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode1.log', 'w') as outfile:
-                cls.honeynode_process1 = subprocess.Popen(
-                    [executable, "17830", "sample_configs/openroadm/2.1/oper-XPDRA.xml"],
-                    stdout=outfile)
-
-    @classmethod
-    def __start_honeynode2(cls):
-        executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode2.log', 'w') as outfile:
-                cls.honeynode_process2 = subprocess.Popen(
-                    [executable, "17821", "sample_configs/openroadm/2.1/oper-ROADMA-full.xml"],
-                    stdout=outfile)
+    def setUpClass(cls):
+        print ("starting honeynode1...")
+        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+        time.sleep(20)
 
-    @classmethod
-    def __start_honeynode3(cls):
-        executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode3.log', 'w') as outfile:
-                cls.honeynode_process3 = subprocess.Popen(
-                    [executable, "17823", "sample_configs/openroadm/2.1/oper-ROADMC-full.xml"],
-                    stdout=outfile)
+        print ("starting honeynode2...")
+        cls.honeynode_process2 = test_utils.start_roadma_full_honeynode()
+        time.sleep(20)
 
-    @classmethod
-    def __start_honeynode4(cls):
-        executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode4.log', 'w') as outfile:
-                cls.honeynode_process4 = subprocess.Popen(
-                    [executable, "17834", "sample_configs/openroadm/2.1/oper-XPDRC.xml"],
-                    stdout=outfile)
+        print ("starting honeynode3...")
+        cls.honeynode_process3 = test_utils.start_roadmc_full_honeynode()
+        time.sleep(20)
 
-    @classmethod
-    def __start_odl(cls):
-        executable = "../karaf/target/assembly/bin/karaf"
-        with open('odl.log', 'w') as outfile:
-            cls.odl_process = subprocess.Popen(
-                ["bash", executable, "server"], stdout=outfile,
-                stdin=open(os.devnull))
+        print ("starting honeynode4...")
+        cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
+        time.sleep(20)
+        print ("all honeynodes started")
 
-    @classmethod
-    def setUpClass(cls):
-        print ("starting honeynode1")
-        cls.__start_honeynode1()
-        time.sleep(40)
-        print ("starting honeynode2")
-        cls.__start_honeynode2()
-        time.sleep(40)
-        print ("starting honeynode3")
-        cls.__start_honeynode3()
-        time.sleep(40)
-        print ("starting honeynode4")
-        cls.__start_honeynode4()
-        time.sleep(40)
-        print ("starting opendaylight")
-        cls.__start_odl()
+        print ("starting opendaylight...")
+        cls.odl_process = test_utils.start_tpce()
         time.sleep(80)
+        print ("opendaylight started")
 
     @classmethod
     def tearDownClass(cls):