Bump lighty.io core and add tests support for it 33/84533/13
authorSamuel Kontris <samuel.kontris@pantheon.tech>
Wed, 18 Sep 2019 14:07:28 +0000 (16:07 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 8 Oct 2019 08:29:06 +0000 (10:29 +0200)
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 <samuel.kontris@pantheon.tech>
23 files changed:
lighty/build.sh
lighty/patch_ordm41_deviations.diff [deleted file]
lighty/pom.xml
lighty/src/main/assembly/resources/clean-start-controller.sh [new file with mode: 0755]
lighty/src/main/assembly/resources/start-controller.sh
tests/tox-lighty-e2e.sh [new file with mode: 0755]
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 [new file with mode: 0644]
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_portmapping.py
tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.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 [new file with mode: 0644]
tox.ini

index d073f5befdddd39a00f973d25d4a5246233c8c52..2c99dfa1ae67a7b2fe184fb2ab970777c5832e57 100755 (executable)
@@ -1,9 +1,7 @@
 #!/bin/bash
 
 cd ..
-patch -p0 <lighty/patch_ordm41_deviations.diff
-mvn clean install -DskipTests
-#git checkout -- ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
+#mvn clean install -DskipTests
 git clone https://github.com/PantheonTechnologies/lighty-core.git
 cd lighty-core
 git checkout master
@@ -11,6 +9,6 @@ mvn clean install -DskipTests
 cd ../lighty
 mvn clean install
 cd  target
-unzip lighty-transportpce-11.0.0-SNAPSHOT-bin.zip
+unzip lighty-transportpce-12.0.0-SNAPSHOT-bin.zip
 cd ..
-rm -rf ../lighty-core
+rm -rf ../lighty-core
diff --git a/lighty/patch_ordm41_deviations.diff b/lighty/patch_ordm41_deviations.diff
deleted file mode 100644 (file)
index 1650677..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-diff --git ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang
-index 9928281..3ad3749 100644
---- ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang
-+++ ordmodels/network/src/main/yang/org-openroadm-network-topology@2018-11-30.yang
-@@ -110,64 +110,6 @@ module org-openroadm-network-topology {
-       "Version 2.0";
-   }
-
--  deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
--    deviate add {
--      must
--        "(not /nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
--         (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
--         (../cnet:node-type = 'DEGREE' or ../cnet:node-type = 'SRG' or ../cnet:node-type = 'TPDR' or ../cnet:node-type = 'SWITCH' or
--          ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI' or ../cnet:node-type = 'EXT-PLUGGABLE' or
--          ../cnet:node-type = 'MUXPDR'))" {
--        error-message "Invalid node type for openroadm-topology";
--        description
--          "The valid node types in the ROADM topology are 'SRG', 'DEGREE',
--           'TPDR', 'SWITCH', 'REGEN', 'REGEN-UNI', 'EXT-PLUGGABLE' and 'MUXPDR'";
--      }
--    }
--  }
--  deviation "/nd:networks/nd:network/nd:node/nwt:termination-point/cnet:tp-type" {
--    description
--      "Defines which TP types can be instantiated on which Node types";
--    deviate add {
--      must
--        "/nd:network/nd:node/cnet:node-type != 'DEGREE' or (../../cnet:node-type = 'DEGREE'  and
--         (../cnet:tp-type = 'DEGREE-TX-TTP' or ../cnet:tp-type = 'DEGREE-RX-TTP' or  ../cnet:tp-type = 'DEGREE-TXRX-TTP' or
--         ../cnet:tp-type = 'DEGREE-TX-CTP' or ../cnet:tp-type = 'DEGREE-RX-CTP' or ../cnet:tp-type = 'DEGREE-TXRX-CTP'))" {
--        error-message "Invalid TP for node type 'DEGREE'";
--      }
--      must
--        "/nd:network/nd:node/cnet:node-type != 'SRG' or (../../cnet:node-type = 'SRG' and
--         (../cnet:tp-type = 'SRG-TX-CP' or ../cnet:tp-type = 'SRG-RX-CP' or ../cnet:tp-type = 'SRG-TXRX-CP' or
--         ../cnet:tp-type = 'SRG-RX-PP' or ../cnet:tp-type = 'SRG-TX-PP' or ../cnet:tp-type = 'SRG-TXRX-PP'))" {
--        error-message "Invalid TP for node type 'SRG'";
--      }
--      must
--        " (/nd:network/nd:node/cnet:node-type != 'TPDR' and ../../cnet:node-type != 'MUXPDR' and ../../cnet:node-type != 'REGEN' and
--         ../../cnet:node-type != 'REGEN-UNI' and ../../cnet:node-type != 'SWITCH')
--         or ((../../cnet:node-type = 'TPDR' or ../../cnet:node-type = 'MUXPDR' or ../../cnet:node-type = 'REGEN' or
--         ../../cnet:node-type = 'REGEN-UNI' or ../../cnet:node-type = 'SWITCH') and
--         (../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'))" {
--        error-message "Invalid TP for node type 'XPONDER'";
--      }
--      must "/nd:network/nd:node/cnet:node-type != 'EXT-PLUGGABLE' or (../../cnet:node-type = 'EXT-PLUGGABLE' and ../cnet:tp-type = 'EXT-PLUGGABLE-TP')" {
--        error-message "Invalid TP for node type 'EXT-PLUGGABLE'";
--      }
--    }
--  }
--  deviation "/nd:networks/nd:network/nwt:link/cnet:link-type" {
--    deviate add {
--      must
--        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology) or
--         (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-topology and
--         (../cnet:link-type = 'ROADM-TO-ROADM' or ../cnet:link-type = 'ADD-LINK' or ../cnet:link-type = 'DROP-LINK' or
--          ../cnet:link-type = 'EXPRESS-LINK' or ../cnet:link-type = 'XPONDER-INPUT' or ../cnet:link-type = 'XPONDER-OUTPUT'))" {
--        error-message "Invalid link type for openroadm-topology";
--        description
--          "The valid link types in the ROADM topology are 'ROADM-TO-ROADM', 'ADD-LINK',
--           'DROP-LINK', 'EXPRESS-LINK', 'XPONDER-INPUT', 'XPONDER-OUTPUT'";
--      }
--    }
--  }
-   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
-     description
-       "Introduce new network type for the Open ROADM optical
-diff --git ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang
-index a236b88..ce5a8d9 100644
---- ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang
-+++ ordmodels/network/src/main/yang/org-openroadm-network@2018-11-30.yang
-@@ -104,18 +104,6 @@ module org-openroadm-network {
-       "Version 1.2";
-   }
-
--  deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
--    deviate add {
--      must
--        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-network) or
--         (/nd:network/nd:network-types/cnet:openroadm-common-network/openroadm-network and
--         (../cnet:node-type = 'ROADM' or ../cnet:node-type = 'XPONDER' or ../cnet:node-type = 'EXT-PLUGGABLE'))" {
--        error-message "Invalid node type for openroadm-network";
--        description
--          "The valid node types in the ROADM network are XPONDER, EXT-PLUGGABLE and ROADM.";
--      }
--    }
--  }
-   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
-     description
-       "Introduce new network type for the Open ROADM optical network";
-diff --git ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
-index 756f4df..fd2d1f1 100644
---- ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
-+++ ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2018-11-30.yang
-@@ -90,44 +90,6 @@ module org-openroadm-otn-network-topology {
-       "Version 2.1";
-   }
-
--  deviation "/nd:networks/nd:network/nd:node/cnet:node-type" {
--    deviate add {
--      must
--        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology) or
--         (/nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology and
--         (../cnet:node-type = 'SWITCH' or ../cnet:node-type = 'MUXPDR' or ../cnet:node-type = 'TPDR' or
--          ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI'))" {
--        error-message "Invalid node type for otn-topology";
--        description
--          "The type of a node in the OTN topology. Valid node types are 'MUXPDR', 'TPDR' and 'SWITCH'";
--      }
--    }
--  }
--  deviation "/nd:networks/nd:network/nd:node/nwt:termination-point/cnet:tp-type" {
--    description
--      "Defines which TP types can be instantiated on which Node types";
--    deviate add {
--      must
--        "(/nd:network/nd:node/cnet:node-type != 'MUXPDR' and ../../cnet:node-type != 'SWITCH' and ../../cnet:node-type != 'TPDR'
--         and ../cnet:node-type != 'REGEN' and ../cnet:node-type != 'REGEN-UNI') or
--         ((../../cnet:node-type = 'MUXPDR' or ../../cnet:node-type = 'SWITCH' or ../../cnet:node-type = 'TPDR' or
--         ../cnet:node-type = 'REGEN' or ../cnet:node-type = 'REGEN-UNI') and
--         (../cnet:tp-type = 'XPONDER-NETWORK' or ../cnet:tp-type = 'XPONDER-CLIENT' or ../cnet:tp-type = 'XPONDER-PORT'))" {
--        error-message "Invalid TP for node type Xponder";
--      }
--    }
--  }
--  deviation "/nd:networks/nd:network/nwt:link/cnet:link-type" {
--    deviate add {
--      must
--        "(not /nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology) or
--         (/nd:network/nd:network-types/cnet:openroadm-common-network/otn-topology and ../cnet:link-type = 'OTN-LINK')" {
--        error-message "Invalid link type for otn-topology";
--        description
--          "The valid link type in the OTN topology is 'OTN-LINK'";
--      }
--    }
--  }
-   augment "/nd:networks/nd:network/nd:network-types/cnet:openroadm-common-network" {
-     description
-       "Introduce new network type for the Open ROADM OTN network topology";
index f12472f72c186cb5f64a4c0e0f0430a2c6513d1f..e82bc6fe881f4a14ddbfcef605adc13a672caf52 100644 (file)
     <parent>
         <groupId>io.lighty.core</groupId>
         <artifactId>lighty-app-parent</artifactId>
-        <version>11.0.0-SNAPSHOT</version>
+        <version>12.0.0-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     <groupId>io.lighty.examples.controllers</groupId>
     <artifactId>lighty-transportpce</artifactId>
-    <version>11.0.0-SNAPSHOT</version>
+    <version>12.0.0-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <properties>
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 (executable)
index 0000000..2235673
--- /dev/null
@@ -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
index 0dd9c373f5b9d9f0654cc8c0f4a77fbe685908de..82bdd1df367db74cdcff2200159904de8dd763da 100755 (executable)
@@ -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 (executable)
index 0000000..5e129dd
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+echo "Starting openroadm 2.2.1 end2end tests with lighty build..."
+export USE_LIGHTY="True"
+tox -e end2end221
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):
index 3cdb2e4e3e0ed7dab164389035c1bd18174ed9b0..157ee8461bdbe152e094c6ca9f4b72c1d27d2577 100644 (file)
@@ -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):
index ed64ad1c9c42c910478996f0b34fb1bbea6edd82..6acacd97198ab5c778d503c200e6e2ddd96bdf5c 100644 (file)
@@ -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):
index 15b3d3cc882b54dbfedf600a3ccf17e61bde18f6..3b3cf13e6c02230cd2c2703add4487421d83b97c 100644 (file)
@@ -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):
index b337f8a960a974346fe22a62845515805be9b04f..909bc45b0e844c7a9102352fa6a4e32ffc17d37c 100644 (file)
@@ -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):
index d276dbf636f17ffe2705764e784944d911161665..92fe6a0abd34d92b9cf396c136245c5decdc2fea 100644 (file)
@@ -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):
index cdc409c2a4c13572f83ad94b94bbd32ced9f7321..a538c34441bb1b7ead2c30653d61dcc38c1f2b51 100644 (file)
@@ -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):
index 3eabea7febe0eeed66f8e4dbd6b7df6e44abcb6c..81411b3bd7d4169fd73b6b037f65bb548fb0a171 100644 (file)
@@ -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 (file)
index 0000000..37b0bc5
--- /dev/null
@@ -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))
index 46d09d71e1be3d620f991eabde34b7dacdac5f16..2bf5763f00623e727aecc664f3d8313d2ffad06b 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.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):
index c04830db2283c7a86fefc20c7db228defd6e2714..58a8ca622e22f022e91f13ab3f6fc9ff06a68806 100644 (file)
@@ -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):
index 6edac72f2a3daff3b3257ac020c7ba37a49fd542..4b54cb284eae92ee4865c1305c0d3f27c66e71ad 100644 (file)
@@ -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):
index ee79b2edc36c4c4c378b4c9d60cade49c20eae68..c70bf9dd1ce1f9865e46f209338a0aaf3695d469 100644 (file)
@@ -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):
index 8a58e685e5e259e9c66b05e6ada23d68e5bedcb4..fcde5735d1c319040c33310d28bc5335b47f753a 100644 (file)
@@ -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):
index 418e56a336f68c84f5dbc2c434b5bbea86cd549b..115f30ea725834635d3fdf93861176df4d1e771d 100644 (file)
@@ -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 (file)
index 0000000..544ffef
--- /dev/null
@@ -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 8111cece8f57a6d90470cd933103eb4026605480..6b893dca418dd9a52703013f915f53a5f43de643 100644 (file)
--- 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