From e25e05d4b55c7fbb30bc3f51e42398a8af4c04df Mon Sep 17 00:00:00 2001 From: BjornMagnussonXA Date: Wed, 19 May 2021 12:10:12 +0200 Subject: [PATCH] Fixes for control panel config in test env Issue-ID: NONRTRIC-513 Signed-off-by: BjornMagnussonXA Change-Id: Ie2ee82fcb36b4a605ebae22e64239fe3863e2e22 --- test/common/control_panel_api_functions.sh | 8 ++++++-- test/common/gateway_api_functions.sh | 2 +- test/common/test_env-oran-d-release.sh | 2 ++ test/simulator-group/control_panel/nginx.conf | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test/common/control_panel_api_functions.sh b/test/common/control_panel_api_functions.sh index df8a4adf..8c0b41f5 100644 --- a/test/common/control_panel_api_functions.sh +++ b/test/common/control_panel_api_functions.sh @@ -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 diff --git a/test/common/gateway_api_functions.sh b/test/common/gateway_api_functions.sh index fbeaddf9..59bdb67a 100644 --- a/test/common/gateway_api_functions.sh +++ b/test/common/gateway_api_functions.sh @@ -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 diff --git a/test/common/test_env-oran-d-release.sh b/test/common/test_env-oran-d-release.sh index bc29ac94..c244936e 100755 --- a/test/common/test_env-oran-d-release.sh +++ b/test/common/test_env-oran-d-release.sh @@ -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" diff --git a/test/simulator-group/control_panel/nginx.conf b/test/simulator-group/control_panel/nginx.conf index 5b1e8954..0a15a484 100644 --- a/test/simulator-group/control_panel/nginx.conf +++ b/test/simulator-group/control_panel/nginx.conf @@ -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}; } -- 2.16.6