Allow Karaf to listen to an alternative SSH port 31/98231/2
authorguillaume.lambert <guillaume.lambert@orange.com>
Mon, 28 Jun 2021 12:41:50 +0000 (14:41 +0200)
committerVachhani, Shweta (sv111y) <sv111y@att.com>
Sun, 31 Oct 2021 11:26:40 +0000 (07:26 -0400)
In Karaf post-install script for tests
- generate a configuration file template for Karaf Shell
- patch Karaf exec to generate configuration file from environment
  variable and template

In tox.ini
- declare the related variable in SETENV parameters

Allowing the controller configuration to listen to alternative ports
is a commodity to run functional tests in parallel.

JIRA: TRNSPRTPCE-482
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Id1b367aaaaccae4bcf74d1b6ac0aa4997f3083a6

karaf/src/main/assembly/ressources/post_install_for_tests.sh
tox.ini

index 60f382369456b24e759d7897347ed3dd0625c718..22e9b11273a102da8c3bbbdcc907bad6f451ada8 100755 (executable)
@@ -18,8 +18,15 @@ else\
     AKKA_PORT=$USE_ODL_ALT_AKKA_PORT\
 fi\
 sed -e "s/ODL_AKKA_PORT/$AKKA_PORT/" \$(dirname \$0)/\.\./ressources/akka-default_template.conf  >\$(dirname \$0)/\.\./configuration/initial/akka.conf\
+if [ -z "$USE_ODL_ALT_SHELL_PORT" ]; then\
+    SHELL_PORT=8101\
+else\
+    SHELL_PORT=$USE_ODL_ALT_SHELL_PORT\
+fi\
+sed -e "s/ODL_SHELL_PORT/$SHELL_PORT/" \$(dirname \$0)/\.\./ressources/org.apache.karaf.shell._template.cfg  >\$(dirname \$0)/\.\./etc/org.apache.karaf.shell.cfg\
 ' ../bin/karaf
 
 sed 's/2550/ODL_AKKA_PORT/' ../system/org/opendaylight/controller/sal-clustering-config/*/sal-clustering-config-*-akkaconf.xml >akka-default_template.conf
 sed 's/8181/ODL_RESTCONF_PORT/' ../etc/org.ops4j.pax.web.cfg > org.ops4j.pax.web._template.cfg
 sed 's/8181/ODL_RESTCONF_PORT/' ../etc/jetty.xml > jetty_template.xml
+sed 's/8101/ODL_SHELL_PORT/' ../etc/org.apache.karaf.shell.cfg > org.apache.karaf.shell._template.cfg
diff --git a/tox.ini b/tox.ini
index a26f0dd100679ae90185b4522ac5520f69a172c7..e15665a1de71e8edaa7e619db8cf5e101aea2e10 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -76,6 +76,7 @@ setenv =
     USE_ODL_ALT_WEBSOCKET_PORT=8186
     USE_ODL_ALT_AKKA_PORT=2551
     USE_ODL_ALT_AKKA_MGT_PORT=8559
+    USE_ODL_ALT_SHELL_PORT=8102
     USE_ODL_ALT_RESTCONF_PORT=8182
 commands =
   ./launch_tests.sh 1.2.1 {posargs:}
@@ -98,6 +99,7 @@ setenv =
     USE_ODL_ALT_WEBSOCKET_PORT=8187
     USE_ODL_ALT_AKKA_PORT=2552
     USE_ODL_ALT_AKKA_MGT_PORT=8560
+    USE_ODL_ALT_SHELL_PORT=8103
     USE_ODL_ALT_RESTCONF_PORT=8183
 commands =
   ./launch_tests.sh 2.2.1 {posargs:}
@@ -111,6 +113,7 @@ setenv =
     USE_ODL_ALT_WEBSOCKET_PORT=8188
     USE_ODL_ALT_AKKA_PORT=2553
     USE_ODL_ALT_AKKA_MGT_PORT=8561
+    USE_ODL_ALT_SHELL_PORT=8104
     USE_ODL_ALT_RESTCONF_PORT=8184
 commands =
   ./launch_tests.sh 7.1 {posargs:}