Fixes for control panel config in test env 91/6091/1
authorBjornMagnussonXA <bjorn.magnusson@est.tech>
Wed, 19 May 2021 10:10:12 +0000 (12:10 +0200)
committerBjornMagnussonXA <bjorn.magnusson@est.tech>
Wed, 19 May 2021 10:10:36 +0000 (12:10 +0200)
Issue-ID: NONRTRIC-513
Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: Ie2ee82fcb36b4a605ebae22e64239fe3863e2e22

test/common/control_panel_api_functions.sh
test/common/gateway_api_functions.sh
test/common/test_env-oran-d-release.sh
test/simulator-group/control_panel/nginx.conf

index df8a4ad..8c0b41f 100644 (file)
@@ -155,7 +155,7 @@ start_control_panel() {
 
                if [ $retcode_i -eq 0 ]; then
 
-                       echo -e " Creating $CP_APP_NAME app and expose service"
+                       echo -e " Creating $CONTROL_PANEL_APP_NAME app and expose service"
 
                        #Export all vars needed for service and deployment
                        export CONTROL_PANEL_APP_NAME
@@ -172,6 +172,8 @@ start_control_panel() {
 
                        export NGW_DOMAIN_NAME=$NRT_GATEWAY_APP_NAME.$KUBE_NONRTRIC_NAMESPACE.svc.cluster.local  # suffix needed for nginx name resolution
                        export NRT_GATEWAY_EXTERNAL_PORT
+                       export CONTROL_PANEL_PATH_POLICY_PREFIX
+                       export CONTROL_PANEL_PATH_ECS_PREFIX
 
                        export CP_NGINX_RESOLVER=$CONTROL_PANEL_NGINX_KUBE_RESOLVER
 
@@ -251,12 +253,14 @@ start_control_panel() {
                export CONTROL_PANEL_CONFIG_FILE
                export CONTROL_PANEL_DISPLAY_NAME
                export NGW_DOMAIN_NAME=$NRT_GATEWAY_APP_NAME
+               export CONTROL_PANEL_PATH_POLICY_PREFIX
+               export CONTROL_PANEL_PATH_ECS_PREFIX
 
                export CP_NGINX_RESOLVER=$CONTROL_PANEL_NGINX_DOCKER_RESOLVER
 
                dest_file=$SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_HOST_MNT_DIR/$CONTROL_PANEL_CONFIG_FILE
 
-               envsubst '${NGW_DOMAIN_NAME},${CP_NGINX_RESOLVER},${NRT_GATEWAY_EXTERNAL_PORT},${POLICY_AGENT_EXTERNAL_SECURE_PORT},${ECS_EXTERNAL_SECURE_PORT},${POLICY_AGENT_DOMAIN_NAME},${ECS_DOMAIN_NAME}' < $1 > $dest_file
+               envsubst '${NGW_DOMAIN_NAME},${CP_NGINX_RESOLVER},${NRT_GATEWAY_EXTERNAL_PORT},${POLICY_AGENT_EXTERNAL_SECURE_PORT},${ECS_EXTERNAL_SECURE_PORT},${POLICY_AGENT_DOMAIN_NAME},${ECS_DOMAIN_NAME},${CONTROL_PANEL_PATH_POLICY_PREFIX},${CONTROL_PANEL_PATH_ECS_PREFIX}' < $1 > $dest_file
 
                __start_container $CONTROL_PANEL_COMPOSE_DIR "" NODOCKERARGS 1 $CONTROL_PANEL_APP_NAME
 
index fbeaddf..59bdb67 100644 (file)
@@ -192,7 +192,7 @@ start_gateway() {
 
                if [ $retcode_i -eq 0 ]; then
 
-                       echo -e " Creating $NGW_APP_NAME app and expose service"
+                       echo -e " Creating $NRT_GATEWAY_APP_NAME app and expose service"
 
                        #Export all vars needed for service and deployment
                        export NRT_GATEWAY_APP_NAME
index bc29ac9..c244936 100755 (executable)
@@ -388,6 +388,8 @@ CONTROL_PANEL_HOST_MNT_DIR="./mnt"                       # Mounted dir, relative
 CONTROL_PANEL_CONFIG_MOUNT_PATH=/etc/nginx               # Container internal path for config
 CONTROL_PANEL_NGINX_KUBE_RESOLVER="kube-dns.kube-system.svc.cluster.local valid=5s"  #nginx resolver for kube
 CONTROL_PANEL_NGINX_DOCKER_RESOLVER="127.0.0.11"         # nginx resolver for docker
+CONTROL_PANEL_PATH_POLICY_PREFIX="/a1-policy/"           # Path prefix for forwarding policy calls to NGW
+CONTROL_PANEL_PATH_ECS_PREFIX="/data-producer/"          # Path prefix for forwarding ecs calls to NGW
 
 NRT_GATEWAY_APP_NAME="nonrtricgateway"                   # Name of the Gateway container
 NRT_GATEWAY_DISPLAY_NAME="NonRT-RIC Gateway"
index 5b1e895..0a15a48 100644 (file)
@@ -26,11 +26,11 @@ http {
         server_name localhost;
         root /usr/share/nginx/html;
         index index.html;
-        location /a1-policy/ {
+        location ${CONTROL_PANEL_PATH_POLICY_PREFIX} {
             set $upstream ${NGW_DOMAIN_NAME};
             proxy_pass http://$upstream:${NRT_GATEWAY_EXTERNAL_PORT};
         }
-        location /ei-producer/{
+        location ${CONTROL_PANEL_PATH_ECS_PREFIX} {
             set $upstream ${NGW_DOMAIN_NAME};
             proxy_pass http://$upstream:${NRT_GATEWAY_EXTERNAL_PORT};
         }