Use environment variables for OLM timers 91/98991/4
authorGilles Thouenon <gilles.thouenon@orange.com>
Tue, 14 Dec 2021 16:14:43 +0000 (17:14 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 17 Dec 2021 14:45:35 +0000 (15:45 +0100)
- 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 <gilles.thouenon@orange.com>
Co-authored-by: Christophe Betoule <christophe.betoule@orange.com>
Change-Id: I3e649f17159ae852aa00d14f4e089c1f599f2c11

docs/user-guide.rst
features/odl-transportpce/pom.xml
features/odl-transportpce/src/main/feature/feature.xml [new file with mode: 0644]
features/odl-transportpce/src/main/resources/org.opendaylight.transportpce.cfg [new file with mode: 0644]
karaf/src/main/assembly/ressources/post_install_for_tests.sh
olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml
tests/karaf121.env
tests/karaf221.env
tests/karaf71.env
tox.ini

index 6567a889ca399e820920a0473b4e503f75bd9e83..f8ee5e8ba3e7bc49ba3e35a8d10f742fae13c61f 100644 (file)
@@ -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
index b43edde677c53a34e9e7fa125382d9ac43cdfa2b..07c27e325161e5a673f65c7c8a51527ff3f34f02 100644 (file)
@@ -126,6 +126,28 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
           <skipTests>true</skipTests>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifact</id>
+            <phase>test</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>${basedir}/src/main/resources/org.opendaylight.transportpce.cfg</file>
+                  <type>cfg</type>
+                  <classifier>config</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/features/odl-transportpce/src/main/feature/feature.xml b/features/odl-transportpce/src/main/feature/feature.xml
new file mode 100644 (file)
index 0000000..13c3598
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- Copyright © 2021 Orange and others. All rights reserved. This program
+    and the accompanying materials are made available under the terms of the
+    Eclipse Public License v1.0 which accompanies this distribution, and is available
+    at http://www.eclipse.org/legal/epl-v10.html INTERNAL -->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-transportpce">
+    <feature name="odl-transportpce">
+        <configfile finalname="etc/org.opendaylight.transportpce.cfg" override="true">
+            mvn:${project.groupId}/${project.artifactId}/${project.version}/cfg/config
+        </configfile>
+    </feature>
+</features>
\ 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 (file)
index 0000000..f77d6fe
--- /dev/null
@@ -0,0 +1,2 @@
+timer1=${env:OLM_TIMER1:-120000}
+timer2=${env:OLM_TIMER2:-20000}
\ No newline at end of file
index a39ebb4f9c0a41bfb1a2e57c0171c53dec4259f2..813d9c3f05933a67603da05200a1e5851b953f62 100755 (executable)
@@ -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\
index 10ef220e0edf39425c85d9ed9ca3c5504ff2b4d1..dee2972ff9576364112e86fee5e8a8982fee0e24 100644 (file)
@@ -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">
 
-    <cm:property-placeholder persistent-id="org.opendaylight.transportpce.olm" update-strategy="reload">
+    <cm:property-placeholder persistent-id="org.opendaylight.transportpce" update-strategy="reload">
         <cm:default-properties>
-            <cm:property name="timer1" value="120000" />
-            <cm:property name="timer2" value="20000" />
+            <cm:property name="timer1" value="" />
+            <cm:property name="timer2" value="" />
             <!--The following values are used to speed-up tests with simulators without convergence times-->
             <!--cm:property name="timer1" value="3000" /-->
             <!--cm:property name="timer2" value="2000" /-->
index 078e71e335a99378b30c2cb4c3bcb79b4caddd44..593f9a2440a550ef1bcacd68ad6f2f9b6e69980a 100644 (file)
@@ -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
index 1366aabfb55a60e339bd57355ca1c780f91c073e..d8771bae3314976f855a33fa192ee25cac449d3a 100644 (file)
@@ -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
index 9d8c2197844955404eb1d5d162c706a43e13f0f6..d57288677939b211b0b62a2130679f889a1e7860 100644 (file)
@@ -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 8131efd36ef5432788957a77c27a112fa60f1fac..d7ceef4664a545a0bf87bd49f6347882d3c2b540 100644 (file)
--- 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