Allow Karaf to use an alternative websocket port 70/96770/5
authorGuillaume Lambert <guillaume.lambert@orange.com>
Thu, 1 Jul 2021 20:00:39 +0000 (22:00 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 17 Aug 2021 23:05:44 +0000 (01:05 +0200)
In tests post install script
- generate configuration file template for restconf nc-bierman02
- patch Karaf exec to generate configuration file from environment
  variable and template

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: Ib507f486103a9edcaa9a948644c3739ef7381460

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

index 5adde6d3896ba20b4b7d4342742d6c1dc25b9878..9faf529b36b8419cd97b77314368d763892916ec 100755 (executable)
@@ -35,6 +35,12 @@ else\
     RMI_SERVER_PORT=$USE_ODL_ALT_RMI_SERVER_PORT\
 fi\
 sed -e "s/ODL_RMI_REGISTRY_PORT/$RMI_REGISTRY_PORT/" -e "s/ODL_RMI_SERVER_PORT/$RMI_SERVER_PORT/" \$(dirname \$0)/\.\./ressources/org.apache.karaf.management._template.cfg  >\$(dirname \$0)/\.\./etc/org.apache.karaf.management.cfg\
+if [ -z "$USE_ODL_ALT_WEBSOCKET_PORT" ]; then\
+    WEBSOCKET_PORT=8185\
+else\
+    WEBSOCKET_PORT=$USE_ODL_ALT_WEBSOCKET_PORT\
+fi\
+sed -e "s/ODL_WEBSOCKET_PORT/$WEBSOCKET_PORT/" \$(dirname \$0)/\.\./ressources/org.opendaylight.restconf._template.cfg  >\$(dirname \$0)/\.\./etc/org.opendaylight.restconf.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
@@ -42,3 +48,4 @@ sed 's/8181/ODL_RESTCONF_PORT/' ../etc/org.ops4j.pax.web.cfg > org.ops4j.pax.web
 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
 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