From: Gilles Thouenon Date: Tue, 14 Dec 2021 16:14:43 +0000 (+0100) Subject: Use environment variables for OLM timers X-Git-Tag: 5.0.0~133 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=transportpce.git;a=commitdiff_plain;h=3d1dd382415217763ea8d1f729a45bb9ca48d91b Use environment variables for OLM timers - Allow injection of environment variables in OLM blueprint to modify the default value of OLM timers - Adapt tox configuration for functional tests - update user-guide JIRA: TRNSPRTPCE-580 Signed-off-by: Gilles Thouenon Co-authored-by: Christophe Betoule Change-Id: I3e649f17159ae852aa00d14f4e089c1f599f2c11 --- diff --git a/docs/user-guide.rst b/docs/user-guide.rst index 6567a889c..f8ee5e8ba 100644 --- a/docs/user-guide.rst +++ b/docs/user-guide.rst @@ -83,6 +83,23 @@ Preparing for Installation Installation Feature ~~~~~~~~~~~~~~~~~~~~ +Creation of services with TransportPCE controller on real optical devices takes a rather long while, +due to the fact that the output optical power level modification on interfaces requires time for stabilisation +level. Per default values of TransportPCE timers are those recommended by OpenROADM MSA, respectively 120 000 +and 20 000 seconds. +When running TransportPCE controller with honeynode simulators, which is the case of all TransportPCE functional tests, +we don't need so important timer values. You can considerably speed tests using respectively 3000 and 2000 seconds. +To that end, before running OpenDaylight, set OLM_TIMER1 and OLM_TIMER2 as environment variables. +For example:: + + export OLM_TIMER1=3000 OLM_TIMER2=2000 + +To come back with per default values for these timers, just logout from OpenDaylight controller, and unset your +environment variables, and start again the controller:: + + unset OLM_TIMER1 OLM_TIMER2 + + Run OpenDaylight and install TransportPCE Service *odl-transportpce* as below:: feature:install odl-transportpce diff --git a/features/odl-transportpce/pom.xml b/features/odl-transportpce/pom.xml index b43edde67..07c27e325 100644 --- a/features/odl-transportpce/pom.xml +++ b/features/odl-transportpce/pom.xml @@ -126,6 +126,28 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL true + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifact + test + + attach-artifact + + + + + ${basedir}/src/main/resources/org.opendaylight.transportpce.cfg + cfg + config + + + + + + diff --git a/features/odl-transportpce/src/main/feature/feature.xml b/features/odl-transportpce/src/main/feature/feature.xml new file mode 100644 index 000000000..13c35983c --- /dev/null +++ b/features/odl-transportpce/src/main/feature/feature.xml @@ -0,0 +1,12 @@ + + + + + + mvn:${project.groupId}/${project.artifactId}/${project.version}/cfg/config + + + \ No newline at end of file diff --git a/features/odl-transportpce/src/main/resources/org.opendaylight.transportpce.cfg b/features/odl-transportpce/src/main/resources/org.opendaylight.transportpce.cfg new file mode 100644 index 000000000..f77d6fe84 --- /dev/null +++ b/features/odl-transportpce/src/main/resources/org.opendaylight.transportpce.cfg @@ -0,0 +1,2 @@ +timer1=${env:OLM_TIMER1:-120000} +timer2=${env:OLM_TIMER2:-20000} \ No newline at end of file diff --git a/karaf/src/main/assembly/ressources/post_install_for_tests.sh b/karaf/src/main/assembly/ressources/post_install_for_tests.sh index a39ebb4f9..813d9c3f0 100755 --- a/karaf/src/main/assembly/ressources/post_install_for_tests.sh +++ b/karaf/src/main/assembly/ressources/post_install_for_tests.sh @@ -9,9 +9,6 @@ sed 's/8101/ODL_SHELL_PORT/' ../etc/org.apache.karaf.shell.cfg > org.apache.kara sed -e 's/1099/ODL_RMI_REGISTRY_PORT/' -e 's/44444/ODL_RMI_SERVER_PORT/' ../etc/org.apache.karaf.management.cfg > org.apache.karaf.management._template.cfg sed 's/^[#|]websocket-port=8185/websocket-port=ODL_WEBSOCKET_PORT/' ../system/org/opendaylight/netconf/sal-rest-connector-config/[0-9.]*/sal-rest-connector-config-[0-9.]*-restconf.cfg >org.opendaylight.restconf._template.cfg -echo 'timer1=3000' >../etc/org.opendaylight.transportpce.olm.cfg -echo 'timer2=2000' >>../etc/org.opendaylight.transportpce.olm.cfg - sed -i'_' -e '1 a\ \ . \$(dirname \$0)/\.\./\.\./\.\./\.\./tests/reflectwarn.sh\ diff --git a/olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml b/olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml index 10ef220e0..dee2972ff 100644 --- a/olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml +++ b/olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml @@ -12,10 +12,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" odl:use-default-for-reference-types="true"> - + - - + + diff --git a/tests/karaf121.env b/tests/karaf121.env index 078e71e33..593f9a244 100644 --- a/tests/karaf121.env +++ b/tests/karaf121.env @@ -5,3 +5,5 @@ export USE_ODL_ALT_SHELL_PORT=8102 export USE_ODL_ALT_RMI_REGISTRY_PORT=1100 export USE_ODL_ALT_RMI_SERVER_PORT=44445 export USE_ODL_ALT_RESTCONF_PORT=8182 +export OLM_TIMER1=3000 +export OLM_TIMER2=2000 \ No newline at end of file diff --git a/tests/karaf221.env b/tests/karaf221.env index 1366aabfb..d8771bae3 100644 --- a/tests/karaf221.env +++ b/tests/karaf221.env @@ -5,3 +5,5 @@ export USE_ODL_ALT_SHELL_PORT=8103 export USE_ODL_ALT_RMI_REGISTRY_PORT=1101 export USE_ODL_ALT_RMI_SERVER_PORT=44446 export USE_ODL_ALT_RESTCONF_PORT=8183 +export OLM_TIMER1=3000 +export OLM_TIMER2=2000 \ No newline at end of file diff --git a/tests/karaf71.env b/tests/karaf71.env index 9d8c21978..d57288677 100644 --- a/tests/karaf71.env +++ b/tests/karaf71.env @@ -5,3 +5,5 @@ export USE_ODL_ALT_SHELL_PORT=8104 export USE_ODL_ALT_RMI_REGISTRY_PORT=1102 export USE_ODL_ALT_RMI_SERVER_PORT=44447 export USE_ODL_ALT_RESTCONF_PORT=8184 +export OLM_TIMER1=3000 +export OLM_TIMER2=2000 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 8131efd36..d7ceef466 100644 --- a/tox.ini +++ b/tox.ini @@ -15,9 +15,12 @@ skipsdist = true setupdir = tests/ [testenv] -passenv = USE_LIGHTY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY -#setenv = +passenv = USE_LIGHTY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OLM_TIMER1 OLM_TIMER2 +setenv = # USE_LIGHTY=True + OLM_TIMER1=3000 + OLM_TIMER2=2000 + usedevelop = true basepython = python3 deps = @@ -183,7 +186,11 @@ commands = depends = buildcontroller,sims221 whitelist_externals = launch_tests.sh dockercmd.sh -passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION +passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION OLM_TIMER1 OLM_TIMER2 +setenv = + OLM_TIMER1=3000 + OLM_TIMER2=2000 + commands = ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0 ./launch_tests.sh with_docker nbinotifications