From 1b290f8e8a33836fcf5960ebbd19ae5afe4b17ce Mon Sep 17 00:00:00 2001 From: Samuel Kontris Date: Wed, 18 Sep 2019 16:07:28 +0200 Subject: [PATCH] Bump lighty.io core and add tests support for it lighty-core version bumped to current master branch = 12.0.0-SNAPSHOT This branch is aligned with ODL magnesium but seems to work as well with TransportPCE current dependencies based on Sodium. As a result, removing deviations from Openroadm models is no more required to pass E2E tests. How to run tests with lighty.io: 1. set environment variable "USE_LIGHTY" to value "True" 2. start any tox tests The example script tests/tox-lighty-e2e.sh can be used to start end2end221 tests based on lighty.io TransportPCE version JIRA: TRNSPRTPCE-126 TRNSPRTPCE-127 Change-Id: I856b69eb9c0a20c3b0b0ece1d9ecb704cd9a272a Signed-off-by: Samuel Kontris --- lighty/build.sh | 8 +- lighty/patch_ordm41_deviations.diff | 141 ------------------ lighty/pom.xml | 4 +- .../resources/clean-start-controller.sh | 11 ++ .../assembly/resources/start-controller.sh | 2 +- tests/tox-lighty-e2e.sh | 5 + .../transportpce_tests/1.2.1/test_end2end.py | 77 +++------- tests/transportpce_tests/1.2.1/test_gnpy.py | 13 +- tests/transportpce_tests/1.2.1/test_olm.py | 71 +++------ tests/transportpce_tests/1.2.1/test_pce.py | 13 +- .../1.2.1/test_portmapping.py | 41 ++--- .../test_renderer_service_path_nominal.py | 43 ++---- .../1.2.1/test_topoPortMapping.py | 41 ++--- .../transportpce_tests/1.2.1/test_topology.py | 70 +++------ tests/transportpce_tests/1.2.1/test_utils.py | 81 ++++++++++ .../transportpce_tests/2.2.1/test_end2end.py | 77 +++------- tests/transportpce_tests/2.2.1/test_olm.py | 72 +++------ .../2.2.1/test_portmapping.py | 42 ++---- .../test_renderer_service_path_nominal.py | 42 ++---- .../2.2.1/test_topoPortMapping.py | 42 ++---- .../transportpce_tests/2.2.1/test_topology.py | 70 +++------ tests/transportpce_tests/2.2.1/test_utils.py | 63 ++++++++ tox.ini | 2 + 23 files changed, 347 insertions(+), 684 deletions(-) delete mode 100644 lighty/patch_ordm41_deviations.diff create mode 100755 lighty/src/main/assembly/resources/clean-start-controller.sh create mode 100755 tests/tox-lighty-e2e.sh create mode 100644 tests/transportpce_tests/1.2.1/test_utils.py create mode 100644 tests/transportpce_tests/2.2.1/test_utils.py diff --git a/lighty/build.sh b/lighty/build.sh index d073f5bef..2c99dfa1a 100755 --- a/lighty/build.sh +++ b/lighty/build.sh @@ -1,9 +1,7 @@ #!/bin/bash cd .. -patch -p0 io.lighty.core lighty-app-parent - 11.0.0-SNAPSHOT + 12.0.0-SNAPSHOT io.lighty.examples.controllers lighty-transportpce - 11.0.0-SNAPSHOT + 12.0.0-SNAPSHOT jar diff --git a/lighty/src/main/assembly/resources/clean-start-controller.sh b/lighty/src/main/assembly/resources/clean-start-controller.sh new file mode 100755 index 000000000..22356736e --- /dev/null +++ b/lighty/src/main/assembly/resources/clean-start-controller.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +BASEDIR=$(dirname "$0") +#echo "${BASEDIR}" +cd ${BASEDIR} + +rm -rf cache +rm -rf target + +#start controller +java -ms128m -mx128m -XX:MaxMetaspaceSize=128m -jar lighty-transportpce-12.0.0-SNAPSHOT.jar diff --git a/lighty/src/main/assembly/resources/start-controller.sh b/lighty/src/main/assembly/resources/start-controller.sh index 0dd9c373f..82bdd1df3 100755 --- a/lighty/src/main/assembly/resources/start-controller.sh +++ b/lighty/src/main/assembly/resources/start-controller.sh @@ -5,4 +5,4 @@ BASEDIR=$(dirname "$0") cd ${BASEDIR} #start controller -java -ms128m -mx128m -XX:MaxMetaspaceSize=128m -jar lighty-transportpce-11.0.0-SNAPSHOT.jar +java -ms128m -mx128m -XX:MaxMetaspaceSize=128m -jar lighty-transportpce-12.0.0-SNAPSHOT.jar diff --git a/tests/tox-lighty-e2e.sh b/tests/tox-lighty-e2e.sh new file mode 100755 index 000000000..5e129dd9c --- /dev/null +++ b/tests/tox-lighty-e2e.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "Starting openroadm 2.2.1 end2end tests with lighty build..." +export USE_LIGHTY="True" +tox -e end2end221 diff --git a/tests/transportpce_tests/1.2.1/test_end2end.py b/tests/transportpce_tests/1.2.1/test_end2end.py index ae160c57b..610878fd2 100644 --- a/tests/transportpce_tests/1.2.1/test_end2end.py +++ b/tests/transportpce_tests/1.2.1/test_end2end.py @@ -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): diff --git a/tests/transportpce_tests/1.2.1/test_gnpy.py b/tests/transportpce_tests/1.2.1/test_gnpy.py index 3cdb2e4e3..157ee8461 100644 --- a/tests/transportpce_tests/1.2.1/test_gnpy.py +++ b/tests/transportpce_tests/1.2.1/test_gnpy.py @@ -19,6 +19,7 @@ import subprocess import time import unittest import logging +import test_utils class TransportGNPYtesting(unittest.TestCase): @@ -31,18 +32,12 @@ class TransportGNPYtesting(unittest.TestCase): if os.path.isfile("./transportpce_tests/gnpy.log"): os.remove("transportpce_tests/gnpy.log") - @classmethod - def __start_odl(cls): - executable = "../karaf/target/assembly/bin/karaf" - with open('transportpce_tests/odl.log', 'w') as outfile: - cls.odl_process = subprocess.Popen( - ["bash", executable, "server"], stdout=outfile, - stdin=open(os.devnull)) - @classmethod def setUpClass(cls): - cls.__start_odl() + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(30) + print ("opendaylight started") @classmethod def tearDownClass(cls): 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): diff --git a/tests/transportpce_tests/1.2.1/test_pce.py b/tests/transportpce_tests/1.2.1/test_pce.py index 15b3d3cc8..3b3cf13e6 100644 --- a/tests/transportpce_tests/1.2.1/test_pce.py +++ b/tests/transportpce_tests/1.2.1/test_pce.py @@ -17,6 +17,7 @@ import shutil import subprocess import time import unittest +import test_utils class TransportPCEtesting(unittest.TestCase): @@ -42,19 +43,13 @@ class TransportPCEtesting(unittest.TestCase): with open(topo_uni_dir_complex_file, 'r') as topo_uni_dir_complex: cls.complex_topo_uni_dir_data = topo_uni_dir_complex.read(); - @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)) - @classmethod def setUpClass(cls): # a class method called before tests in an individual class run. cls._get_file() - cls.__start_odl() + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(90) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/1.2.1/test_portmapping.py b/tests/transportpce_tests/1.2.1/test_portmapping.py index b337f8a96..909bc45b0 100644 --- a/tests/transportpce_tests/1.2.1/test_portmapping.py +++ b/tests/transportpce_tests/1.2.1/test_portmapping.py @@ -18,6 +18,7 @@ import shutil import subprocess import time import unittest +import test_utils class TransportPCEPortMappingTesting(unittest.TestCase): @@ -29,42 +30,20 @@ class TransportPCEPortMappingTesting(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, "17831", "sample_configs/openroadm/2.1/oper-ROADMA.xml"], - stdout=outfile) - - @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)) - @classmethod def setUpClass(cls): - cls.__start_honeynode1() + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() time.sleep(20) - cls.__start_honeynode2() + + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() time.sleep(20) - cls.__start_odl() + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py b/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py index d276dbf63..92fe6a0ab 100644 --- a/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py +++ b/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py @@ -19,6 +19,7 @@ import os import psutil import shutil from unittest.result import failfast +import test_utils class TransportPCERendererTesting(unittest.TestCase): @@ -31,41 +32,19 @@ class TransportPCERendererTesting(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, "17831", "sample_configs/openroadm/2.1/oper-ROADMA.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, "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_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 honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() + time.sleep(20) - @classmethod - def setUpClass(cls): - cls.__start_honeynode1() - time.sleep(40) - cls.__start_honeynode2() - time.sleep(40) - cls.__start_odl() + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/1.2.1/test_topoPortMapping.py b/tests/transportpce_tests/1.2.1/test_topoPortMapping.py index cdc409c2a..a538c3444 100644 --- a/tests/transportpce_tests/1.2.1/test_topoPortMapping.py +++ b/tests/transportpce_tests/1.2.1/test_topoPortMapping.py @@ -19,6 +19,7 @@ import subprocess import time import unittest import logging +import test_utils class TransportPCEtesting(unittest.TestCase): @@ -29,42 +30,20 @@ class TransportPCEtesting(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, "17831", "sample_configs/openroadm/2.1/oper-ROADMA.xml"], - stdout=outfile) - - @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)) - @classmethod def setUpClass(cls): - cls.__start_honeynode1() + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() time.sleep(20) - cls.__start_honeynode2() + + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() time.sleep(20) - cls.__start_odl() + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/1.2.1/test_topology.py b/tests/transportpce_tests/1.2.1/test_topology.py index 3eabea7fe..81411b3bd 100644 --- a/tests/transportpce_tests/1.2.1/test_topology.py +++ b/tests/transportpce_tests/1.2.1/test_topology.py @@ -19,6 +19,7 @@ import subprocess import time import unittest import logging +import test_utils class TransportPCETopologyTesting(unittest.TestCase): @@ -31,66 +32,29 @@ class TransportPCETopologyTesting(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, "17831", "sample_configs/openroadm/2.1/oper-ROADMA.xml"], - stdout=outfile) - - @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, "17832", "sample_configs/openroadm/2.1/oper-ROADMB.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, "17833", "sample_configs/openroadm/2.1/oper-ROADMC.xml"], - stdout=outfile) - - @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)) - @classmethod def setUpClass(cls): - cls.__start_honeynode1() + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() time.sleep(20) - cls.__start_honeynode2() + + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() time.sleep(20) - cls.__start_honeynode3() + + print ("starting honeynode3...") + cls.honeynode_process3 = test_utils.start_roadmb_honeynode() time.sleep(20) - cls.__start_honeynode4() + + print ("starting honeynode4...") + cls.honeynode_process4 = test_utils.start_roadmc_honeynode() time.sleep(20) - cls.__start_odl() + print ("all honeynodes started") + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/1.2.1/test_utils.py b/tests/transportpce_tests/1.2.1/test_utils.py new file mode 100644 index 000000000..37b0bc54e --- /dev/null +++ b/tests/transportpce_tests/1.2.1/test_utils.py @@ -0,0 +1,81 @@ +import os +import subprocess + +def start_xpdra_honeynode(): + 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: + return subprocess.Popen( + [executable, "17830", "sample_configs/openroadm/2.1/oper-XPDRA.xml"], + stdout=outfile) + +def start_roadma_full_honeynode(): + 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: + return subprocess.Popen( + [executable, "17821", "sample_configs/openroadm/2.1/oper-ROADMA-full.xml"], + stdout=outfile) + +def start_roadma_honeynode(): + 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: + return subprocess.Popen( + [executable, "17831", "sample_configs/openroadm/2.1/oper-ROADMA.xml"], + stdout=outfile) + +def start_roadmb_honeynode(): + 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: + return subprocess.Popen( + [executable, "17832", "sample_configs/openroadm/2.1/oper-ROADMB.xml"], + stdout=outfile) + +def start_roadmc_full_honeynode(): + 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: + return subprocess.Popen( + [executable, "17823", "sample_configs/openroadm/2.1/oper-ROADMC-full.xml"], + stdout=outfile) + +def start_roadmc_honeynode(): + 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: + return subprocess.Popen( + [executable, "17833", "sample_configs/openroadm/2.1/oper-ROADMC.xml"], + stdout=outfile) + +def start_xpdrc_honeynode(): + 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: + return subprocess.Popen( + [executable, "17834", "sample_configs/openroadm/2.1/oper-XPDRC.xml"], + stdout=outfile) + +def start_tpce(): + if "USE_LIGHTY" in os.environ and os.environ['USE_LIGHTY'] == 'True': + print ("starting LIGHTY.IO TransportPCE build...") + executable = "../lighty/target/lighty-transportpce-12.0.0-SNAPSHOT/clean-start-controller.sh" + with open('odl.log', 'w') as outfile: + return subprocess.Popen( + ["bash", executable], stdout=outfile, + stdin=open(os.devnull)) + else: + print ("starting KARAF TransportPCE build...") + executable = "../karaf/target/assembly/bin/karaf" + with open('odl.log', 'w') as outfile: + return subprocess.Popen( + ["bash", executable, "server"], stdout=outfile, + stdin=open(os.devnull)) diff --git a/tests/transportpce_tests/2.2.1/test_end2end.py b/tests/transportpce_tests/2.2.1/test_end2end.py index 46d09d71e..2bf5763f0 100644 --- a/tests/transportpce_tests/2.2.1/test_end2end.py +++ b/tests/transportpce_tests/2.2.1/test_end2end.py @@ -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.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, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"], - stdout=outfile) - - @classmethod - def __start_honeynode2(cls): - executable = ("./honeynode/2.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, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.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.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, "17843", "sample_configs/openroadm/2.2.1/oper-ROADMC.xml"], - stdout=outfile) + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() + time.sleep(20) - @classmethod - def __start_honeynode4(cls): - executable = ("./honeynode/2.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, "17844", "sample_configs/openroadm/2.2.1/oper-XPDRC.xml"], - stdout=outfile) + print ("starting honeynode3...") + cls.honeynode_process3 = test_utils.start_roadmc_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): diff --git a/tests/transportpce_tests/2.2.1/test_olm.py b/tests/transportpce_tests/2.2.1/test_olm.py index c04830db2..58a8ca622 100644 --- a/tests/transportpce_tests/2.2.1/test_olm.py +++ b/tests/transportpce_tests/2.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,29 @@ class TransportOlmTesting(unittest.TestCase): #START_IGNORE_XTESTING @classmethod - def __start_honeynode1(cls): - executable = ("./honeynode/2.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, "17840", "sample_configs/openroadm/2.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.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, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"], - stdout=outfile) + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() + time.sleep(20) - @classmethod - def __start_honeynode3(cls): - executable = ("./honeynode/2.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, "17843", "sample_configs/openroadm/2.2.1/oper-ROADMC.xml"], - stdout=outfile) - @classmethod - def __start_honeynode4(cls): - executable = ("./honeynode/2.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, "17844", "sample_configs/openroadm/2.2.1/oper-XPDRC.xml"], - stdout=outfile) + print ("starting honeynode3...") + cls.honeynode_process3 = test_utils.start_roadmc_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) - @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 ("all honeynodes started") + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/2.2.1/test_portmapping.py b/tests/transportpce_tests/2.2.1/test_portmapping.py index 6edac72f2..4b54cb284 100644 --- a/tests/transportpce_tests/2.2.1/test_portmapping.py +++ b/tests/transportpce_tests/2.2.1/test_portmapping.py @@ -18,6 +18,7 @@ import shutil import subprocess import time import unittest +import test_utils class TransportPCEPortMappingTesting(unittest.TestCase): @@ -27,42 +28,21 @@ class TransportPCEPortMappingTesting(unittest.TestCase): odl_process = None restconf_baseurl = "http://localhost:8181/restconf" - @classmethod - def __start_honeynode1(cls): - executable = ("./honeynode/2.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, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"], - stdout=outfile) - - @classmethod - def __start_honeynode2(cls): - executable = ("./honeynode/2.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, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"], - stdout=outfile) - - @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)) - @classmethod def setUpClass(cls): - cls.__start_honeynode1() + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() time.sleep(20) - cls.__start_honeynode2() + + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() time.sleep(20) - cls.__start_odl() + print ("all honeynodes started") + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py b/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py index ee79b2edc..c70bf9dd1 100644 --- a/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py +++ b/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py @@ -19,6 +19,7 @@ import os import psutil import shutil from unittest.result import failfast +import test_utils class TransportPCERendererTesting(unittest.TestCase): @@ -30,42 +31,21 @@ class TransportPCERendererTesting(unittest.TestCase): #START_IGNORE_XTESTING - @classmethod - def __start_honeynode1(cls): - executable = ("./honeynode/2.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, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"], - stdout=outfile) - - @classmethod - def __start_honeynode2(cls): - executable = ("./honeynode/2.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, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"], - stdout=outfile) - - @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)) - @classmethod def setUpClass(cls): - cls.__start_honeynode1() + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() time.sleep(20) - cls.__start_honeynode2() + + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() time.sleep(20) - cls.__start_odl() + print ("all honeynodes started") + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/2.2.1/test_topoPortMapping.py b/tests/transportpce_tests/2.2.1/test_topoPortMapping.py index 8a58e685e..fcde5735d 100644 --- a/tests/transportpce_tests/2.2.1/test_topoPortMapping.py +++ b/tests/transportpce_tests/2.2.1/test_topoPortMapping.py @@ -19,6 +19,7 @@ import subprocess import time import unittest import logging +import test_utils class TransportPCEtesting(unittest.TestCase): @@ -29,42 +30,21 @@ class TransportPCEtesting(unittest.TestCase): #START_IGNORE_XTESTING - @classmethod - def __start_honeynode1(cls): - executable = ("./honeynode/2.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, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"], - stdout=outfile) - - @classmethod - def __start_honeynode2(cls): - executable = ("./honeynode/2.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, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"], - stdout=outfile) - - @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)) - @classmethod def setUpClass(cls): - cls.__start_honeynode1() + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() time.sleep(20) - cls.__start_honeynode2() + + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() time.sleep(20) - cls.__start_odl() + print ("all honeynodes started") + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/2.2.1/test_topology.py b/tests/transportpce_tests/2.2.1/test_topology.py index 418e56a33..115f30ea7 100644 --- a/tests/transportpce_tests/2.2.1/test_topology.py +++ b/tests/transportpce_tests/2.2.1/test_topology.py @@ -19,6 +19,7 @@ import subprocess import time import unittest import logging +import test_utils class TransportPCEtesting(unittest.TestCase): @@ -31,66 +32,29 @@ class TransportPCEtesting(unittest.TestCase): #START_IGNORE_XTESTING - @classmethod - def __start_honeynode1(cls): - executable = ("./honeynode/2.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, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"], - stdout=outfile) - - @classmethod - def __start_honeynode2(cls): - executable = ("./honeynode/2.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, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"], - stdout=outfile) - - @classmethod - def __start_honeynode3(cls): - executable = ("./honeynode/2.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_process3 = subprocess.Popen( - [executable, "17842", "sample_configs/openroadm/2.2.1/oper-ROADMB.xml"], - stdout=outfile) - - @classmethod - def __start_honeynode4(cls): - executable = ("./honeynode/2.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_process4 = subprocess.Popen( - [executable, "17843", "sample_configs/openroadm/2.2.1/oper-ROADMC.xml"], - stdout=outfile) - - @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)) - @classmethod def setUpClass(cls): - cls.__start_honeynode1() + print ("starting honeynode1...") + cls.honeynode_process1 = test_utils.start_xpdra_honeynode() time.sleep(20) - cls.__start_honeynode2() + + print ("starting honeynode2...") + cls.honeynode_process2 = test_utils.start_roadma_honeynode() time.sleep(20) - cls.__start_honeynode3() + + print ("starting honeynode3...") + cls.honeynode_process3 = test_utils.start_roadmb_honeynode() time.sleep(20) - cls.__start_honeynode4() + + print ("starting honeynode4...") + cls.honeynode_process4 = test_utils.start_roadmc_honeynode() time.sleep(20) - cls.__start_odl() + print ("all honeynodes started") + + print ("starting opendaylight...") + cls.odl_process = test_utils.start_tpce() time.sleep(60) + print ("opendaylight started") @classmethod def tearDownClass(cls): diff --git a/tests/transportpce_tests/2.2.1/test_utils.py b/tests/transportpce_tests/2.2.1/test_utils.py new file mode 100644 index 000000000..544ffeff0 --- /dev/null +++ b/tests/transportpce_tests/2.2.1/test_utils.py @@ -0,0 +1,63 @@ +import os +import subprocess + +def start_xpdra_honeynode(): + executable = ("./honeynode/2.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: + return subprocess.Popen( + [executable, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"], + stdout=outfile) + +def start_roadma_honeynode(): + executable = ("./honeynode/2.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: + return subprocess.Popen( + [executable, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"], + stdout=outfile) + +def start_roadmb_honeynode(): + executable = ("./honeynode/2.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('honeynode5.log', 'w') as outfile: + return subprocess.Popen( + [executable, "17842", "sample_configs/openroadm/2.2.1/oper-ROADMB.xml"], + stdout=outfile) + +def start_roadmc_honeynode(): + executable = ("./honeynode/2.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: + return subprocess.Popen( + [executable, "17843", "sample_configs/openroadm/2.2.1/oper-ROADMC.xml"], + stdout=outfile) + +def start_xpdrc_honeynode(): + executable = ("./honeynode/2.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: + return subprocess.Popen( + [executable, "17844", "sample_configs/openroadm/2.2.1/oper-XPDRC.xml"], + stdout=outfile) + +def start_tpce(): + if "USE_LIGHTY" in os.environ and os.environ['USE_LIGHTY'] == 'True': + print ("starting LIGHTY.IO TransportPCE build...") + executable = "../lighty/target/lighty-transportpce-12.0.0-SNAPSHOT/clean-start-controller.sh" + with open('odl.log', 'w') as outfile: + return subprocess.Popen( + ["bash", executable], stdout=outfile, + stdin=open(os.devnull)) + else: + print ("starting KARAF TransportPCE build...") + executable = "../karaf/target/assembly/bin/karaf" + with open('odl.log', 'w') as outfile: + return subprocess.Popen( + ["bash", executable, "server"], stdout=outfile, + stdin=open(os.devnull)) diff --git a/tox.ini b/tox.ini index 8111cece8..6b893dca4 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ skipsdist = true setupdir = tests/ [testenv] +passenv = USE_LIGHTY usedevelop = True basepython = python2.7 deps = @@ -19,6 +20,7 @@ commands = {py27,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,olm221,end2end221,gnpy}: - bash -c "if [ ! `which mvn` ]; then ./installMavenCentOS.sh ; fi" {py27,portmapping,topoPortMapping,rspn,topology,olm,end2end,portmapping221,rspn221,topology221,olm221,end2end221,gnpy}: - bash -c "sed 's@=.*//#FUNCTESTVAL=@=@g' ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java >/tmp/pivot; mv /tmp/pivot ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java" {py27,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,olm221,end2end221,gnpy}: - bash -c "(cd .. && mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true)" + {py27,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,olm221,end2end221,gnpy}: - bash -c 'if [ "$USE_LIGHTY" == "True" ]; then (cd ../lighty && ./build.sh); fi' {py27,portmapping,topoPortMapping,rspn,topology,olm,end2end}: - ./buildHoneynode.sh {py27,portmapping}: nosetests --with-xunit transportpce_tests/1.2.1/test_portmapping.py {py27,topoPortMapping}: nosetests --with-xunit transportpce_tests/1.2.1/test_topoPortMapping.py -- 2.36.6