X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F1.2.1%2Ftest_olm.py;h=6acacd97198ab5c778d503c200e6e2ddd96bdf5c;hb=1b290f8e8a33836fcf5960ebbd19ae5afe4b17ce;hp=ed64ad1c9c42c910478996f0b34fb1bbea6edd82;hpb=c396f7e0704815553574fe4448f3a87c78adcdae;p=transportpce.git diff --git a/tests/transportpce_tests/1.2.1/test_olm.py b/tests/transportpce_tests/1.2.1/test_olm.py index ed64ad1c9..6acacd971 100644 --- a/tests/transportpce_tests/1.2.1/test_olm.py +++ b/tests/transportpce_tests/1.2.1/test_olm.py @@ -19,6 +19,7 @@ import os import psutil import shutil from unittest.result import failfast +import test_utils class TransportOlmTesting(unittest.TestCase): @@ -33,64 +34,28 @@ class TransportOlmTesting(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) + def setUpClass(cls): + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() + time.sleep(20) - @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) + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_full_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) - @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): - cls.__start_honeynode1() - time.sleep(30) - cls.__start_honeynode2() - time.sleep(30) - cls.__start_honeynode3() - time.sleep(30) - cls.__start_honeynode4() - time.sleep(30) - cls.__start_odl() + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls):