INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/ecs_api_functions.sh
INCLUDED_IMAGES="RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/controller_api_functions.sh
INCLUDED_IMAGES="ECS PRODSTUB CR CP"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/ecs_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
TC_ONELINE_DESCR="Preparation demo setup - policy management and enrichment information"
#App names to include in the test, space separated list
-INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC ECS PRODSTUB"
+INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC ECS PRODSTUB RC"
#SUPPORTED TEST ENV FILE
-SUPPORTED_PROFILES="ONAP-MASTER ORAN-MASTER"
+SUPPORTED_PROFILES="ONAP-MASTER ORAN-CHERRY"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
. ../common/ecs_api_functions.sh
. ../common/prodstub_api_functions.sh
. ../common/cr_api_functions.sh
+. ../common/rapp_catalogue_api_functions.sh
#### TEST BEGIN ####
use_simulator_https
use_ecs_rest_https
use_prod_stub_https
+use_rapp_catalogue_http # https not yet supported
if [ "$PMS_VERSION" == "V2" ]; then
notificationurl=$CR_PATH"/test"
start_policy_agent
+start_rapp_catalogue
+
start_cr
start_prod_stub
start_ecs
+start_rapp_catalogue
+
set_agent_trace
set_ecs_trace
+
+rapp_cat_api_get_services 200 EMPTY
+
+rapp_cat_api_put_service 201 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app"
+
+rapp_cat_api_get_services 200 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app"
+
api_get_status 200
# Print the A1 version for STD 2.X
## How to run
A test script, for example FTC1, is executed from the cmd line using the script filename and one or more parameters:
- ./FTC1.sh remote.
+ ./FTC1.sh remote --env-file ../common/test_env-oran-cherry
See the README.md in `../common/` for all details about available parameters and their meaning.
TC_ONELINE_DESCR="<test case description>"
+INCLUDED_IMAGES=<list of used app in this test case>
+
+SUPPORTED_PROFILES=<list of supported profile names>
+
. ../common/testcase_common.sh $@
< other scripts need to be sourced for specific interfaces>
Common functions for running two or more auto test scripts as a suite.
`api_curl.sh` \
-A common curl based function for the agent and ecs apis. Also partly used for the Callback receiver api.
+A common curl based function for the agent and ecs apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
`agent_api_functions.sh` \
Contains functions for adapting towards the Policy Agent API, also via dmaap (using a message-router stub interface)
`prodstub_api_functions.sh` \
Contains functions for adapting towards the Producer stub interface - simulates a producer.
+`rapp_catalogue_api_functions.sh` \
+Contains functions for adapting towards the RAPP Catalogue.
+
`compare_json.py` \
A python script to compare two json obects for equality. Note that the comparsion always sort json-arrays before comparing (that is, it does not care about the order of items within the array). In addition, the target json object may specify individual parameter values where equality is 'dont care'.
| `--stop-at-error` | intended for debugging and make the script stop at first 'FAIL' and save all logs with a prefix 'STOP_AT_ERROR' |
| `--ricsim-prefix <prefix>` | use another prefix for the ric simulator container name than the standard 'ricsim'. Note that the testscript has to read and use the env var `$RIC_SIM_PREFIX` instead of a hardcoded name of the ric(s). |
| `--env-file` | point to a file with environment variables (the previous default, test_env.sh, replaced with one env file for each branch in test/common) |
-| `--use-local-image <app-nam> [<app-name>]*` | nnly applicable when running as 'remote' or 'remote-remove'. Mainly for debugging when a locally built image shall be used together with other remote images from nexus.Accepts a space separated list of PA, CP, RICSIM, SDNC for Policy Agent, Control Panel, A1-controller and the Ric simulator |
+| `--use-local-image <app-nam> [<app-name>]*` | only applicable when running as 'remote' or 'remote-remove'. Mainly for debugging when a locally built image shall be used together with other remote images from nexus.Accepts a space separated list of PA, CP, RICSIM, SDNC, RC for Policy Agent, Control Panel, A1-controller, Ric simulator, RAPP Catalogue |
## Function: print_result ##
# Description of functions in cr_api_function.sh #
-
-
## Function: cr_equal ##
Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
| `EMPTY` | Indicator for an empty list |
| `<ric-id>` | Id of the ric |
+# Description of functions in rapp_catalogue_api_function.sh #
+
+## Function: rc_equal ##
+Tests if a variable value in the RAPP Catalogue is equal to a target value.
+Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
+With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
+See the 'cr' dir for more details.
+| arg list |
+|--|
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in the RC |
+| `<target-value>` | Target value for the variable |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
+
+## Function: rapp_cat_api_get_services() ##
+Check all registered services.
+
+| arg list |
+|--|
+| `<response-code> [(<service-id> <version> <display-name> <description>)+ | EMPTY ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-id>` | Id of the service |
+| `<version>` | Version of the service |
+| `<display-name>` | Dislay name of the service |
+| `<description>` | Description of the service |
+| `EMPTY` | Indicator for an empty list |
+
+## Function: rapp_cat_api_put_service() ##
+Register a services.
+
+| arg list |
+|--|
+| `<response-code> <service-id> <version> <display-name> <description>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-id>` | Id of the service |
+| `<version>` | Version of the service |
+| `<display-name>` | Dislay name of the service |
+| `<description>` | Description of the service |
+
+## Function: rapp_cat_api_get_service() ##
+Check a registered service.
+
+| arg list |
+|--|
+| `<response-code> <service-id> <version> <display-name> <description>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-id>` | Id of the service |
+| `<version>` | Version of the service |
+| `<display-name>` | Dislay name of the service |
+| `<description>` | Description of the service |
+
+## Function: rapp_cat_api_delete_service() ##
+Check a registered service.
+
+| arg list |
+|--|
+| `<response-code> <service-id>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-id>` | Id of the service |
+
## License
# one for sending the requests and one for receiving the response
# but only when using the DMAAP interface
# REST or DMAAP is controlled of the base url of $ADAPTER
-# arg: (PA|ECS GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH <url> [<file>]) | (PA|ECS RESPONSE <correlation-id>)
+# arg: (PA|ECS|CR|RC GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH <url> [<file>]) | (PA|ECS RESPONSE <correlation-id>)
# (Not for test scripts)
__do_curl_to_api() {
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
__ADAPTER=$CR_ADAPTER
__RESTBASE=$CR_RESTBASE
__RESTBASE_SECURE=$CR_RESTBASE_SECURE
+ __RETRY_CODES=""
+ elif [ $1 == "RC" ]; then
+ __ADAPTER=$RC_ADAPTER
+ __RESTBASE=$RC_RESTBASE
+ __RESTBASE_SECURE=$RC_RESTBASE_SECURE
__RETRY_CODES=""
else
paramError=1
--- /dev/null
+#!/bin/bash
+
+# ============LICENSE_START===============================================
+# Copyright (C) 2020 Nordix Foundation. All rights reserved.
+# ========================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=================================================
+#
+
+# This is a script that contains specific test functions for RAPP Catalogue API
+
+. ../common/api_curl.sh
+
+# Tests if a variable value in the RAPP Catalogue is equal to a target value and and optional timeout.
+# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
+# equal to the target or not.
+# Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
+# before setting pass or fail depending on if the variable value becomes equal to the target
+# value or not.
+# (Function for test scripts)
+rc_equal() {
+ if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+ __var_test RC "$LOCALHOST$RC_EXTERNAL_PORT/" $1 "=" $2 $3
+ else
+ __print_err "Wrong args to ecs_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
+ fi
+}
+
+
+##########################################
+######### RAPP Catalogue API ##########
+##########################################
+#Function prefix: rapp_cat_api
+
+# API Test function: GET /services
+# args: <response-code> [(<service-id> <version> <display-name> <description>)+ | EMPTY ]
+# (Function for test scripts)
+rapp_cat_api_get_services() {
+ __log_test_start $@
+
+ if [ $# -lt 1 ]; then
+ __print_err "<response-code> [(<service-id> <version> <display-name> <description>)+ | EMPTY ]" $@
+ return 1
+ fi
+ query="/services"
+ res="$(__do_curl_to_api RC GET $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ if [ $# -gt 1 ]; then
+ body=${res:0:${#res}-3}
+ targetJson="["
+ arr=(${@:2})
+
+ if [ $# -eq 2 ]; then
+ targetJson="[]"
+ else
+ for ((i=0; i<$(($#-1)); i=i+4)); do
+ if [ "$targetJson" != "[" ]; then
+ targetJson=$targetJson","
+ fi
+ targetJson=$targetJson"{\"name\": \"${arr[$i]}\",\"version\": \"${arr[$i+1]}\",\"display_name\": \"${arr[$i+2]}\",\"description\": \"${arr[$i+3]}\",\"registrationDate\": \"????\"}"
+ done
+ targetJson=$targetJson"]"
+ fi
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ fi
+
+ __log_test_pass
+ return 0
+}
+
+# API Test function: PUT /services/{service-id}
+# args: <response-code> <service-id> <version> <display-name> <description>
+# (Function for test scripts)
+rapp_cat_api_put_service() {
+ __log_test_start $@
+
+ if [ $# -ne 5 ]; then
+ __print_err "<response-code> <service-id> <version> <display-name> <description>" $@
+ return 1
+ fi
+
+ inputJson="{\"version\": \"$3\",\"display_name\": \"$4\",\"description\": \"$5\"}"
+ file="./tmp/.p.json"
+ echo "$inputJson" > $file
+ query="/services/$2"
+ res="$(__do_curl_to_api RC PUT $query $file)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ __log_test_pass
+ return 0
+}
+
+# API Test function: GET /services/{service-id}
+# args: <response-code> <service-id>
+# (Function for test scripts)
+rapp_cat_api_get_service() {
+ __log_test_start $@
+
+ if [ $# -lt 2 ] || [ $# -gt 5 ]; then
+ __print_err "<response-code> <service-id> <version> <display-name> <description>" $@
+ return 1
+ fi
+
+ query="/services/$2"
+ res="$(__do_curl_to_api RC GET $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ if [ $# -gt 2 ]; then
+ body=${res:0:${#res}-3}
+ targetJson="{\"name\": \"$2\",\"version\": \"$3\",\"display_name\": \"$4\",\"description\": \"$5\",\"registrationDate\": \"????\"}"
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ fi
+
+ __log_test_pass
+ return 0
+}
+
+# API Test function: DELETE /services/{service-id}
+# args: <response-code> <service-id>
+# (Function for test scripts)
+rapp_cat_api_delete_service() {
+ __log_test_start $@
+
+ if [ $# -ne 2 ]; then
+ __print_err "<response-code> <service-id>" $@
+ return 1
+ fi
+
+ query="/services/$2"
+ res="$(__do_curl_to_api RC DELETE $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ __log_test_pass
+ return 0
+}
# limitations under the License.
# ============LICENSE_END=================================================
#
-#Profile for ORAN master
-TEST_ENV_PROFILE="ORAN-MASTER"
+#Profile for ORAN Cherry
+TEST_ENV_PROFILE="ORAN-CHERRY"
NEXUS_PROXY_REPO="nexus3.onap.org:10001/"
# Set up the image and tags for the test. Do not add the image tag to the image names.
ECS_LOCAL_IMAGE="o-ran-sc/nonrtric-enrichment-coordinator-service"
ECS_LOCAL_IMAGE_TAG="1.0.0-SNAPSHOT"
# Remote ECS image and tag
-ECS_REMOTE_IMAGE="nexus3.o-ran-sc.org:10003/o-ran-sc/nonrtric-enrichment-coordinator-service"
-ECS_REMOTE_IMAGE_TAG="1.0.0-SNAPSHOT"
+ECS_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-enrichment-coordinator-service"
+ECS_REMOTE_IMAGE_TAG="1.0.0"
# Control Panel local image and tag
CONTROL_PANEL_LOCAL_IMAGE="o-ran-sc/nonrtric-controlpanel"
SDNC_A1_CONTROLLER_REMOTE_IMAGE_TAG="2.1.0"
+# RAPP Catalogue local image and tag
+RAPP_CAT_LOCAL_IMAGE="o-ran-sc/nonrtric-r-app-catalogue"
+RAPP_CAT_LOCAL_IMAGE_TAG="1.0.0-SNAPSHOT"
+# RAPP Catalogue remote image and tag
+RAPP_CAT_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-r-app-catalogue"
+RAPP_CAT_REMOTE_IMAGE_TAG="1.0.0"
+
+
#SDNC DB remote image and tag
SDNC_DB_REMOTE_IMAGE=$NEXUS_PROXY_REPO"mysql/mysql-server"
SDNC_DB_REMOTE_IMAGE_TAG="5.6"
SDNC_ALIVE_URL="/apidoc/explorer/" # Base url path for SNDC API docs (for alive check)
SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log" # Path to karaf log
+export RAPP_CAT_EXTERNAL_PORT=8680 # RAPP Catalogue container external port (host -> container)
+export RAPP_CAT_INTERNAL_PORT=8080 # RAPP Catalogue container internal port (container -> container)
+export RAPP_CAT_EXTERNAL_SECURE_PORT=8633 # RAPP Catalogue container external secure port (host -> container)
+export RAPP_CAT_INTERNAL_SECURE_PORT=8433 # RAPP Catalogue container internal secure port (container -> container)
+export RAPP_CAT_APP_NAME="rapp-catalogue" # Name for the RAPP Catalogue
+
+
export CONTROL_PANEL_APP_NAME="control-panel" # Name of the Control Panel container
export CONTROL_PANEL_EXTERNAL_PORT=8080 # Control Panel container external port (host -> container)
export CONTROL_PANEL_INTERNAL_PORT=8080 # Control Panel container external port (host -> container)
CR_RESTBASE="http://localhost:"$CR_EXTERNAL_PORT # Base url to the Callback receiver REST interface
CR_RESTBASE_SECURE="https://localhost:"$CR_EXTERNAL_SECURE_PORT # Base url to the secure Callback receiver REST interface
CR_ADAPTER=$CR_RESTBASE # Adapter holds the address the CR admin interface (REST only)
- # The values of this var is swiched between the two base url when needed
\ No newline at end of file
+ # The values of this var is swiched between the two base url when needed
+
+RC_RESTBASE="http://localhost:"$RAPP_CAT_EXTERNAL_PORT # Base url to the RAPP Catalogue REST interface
+RC_RESTBASE_SECURE="https://localhost:"$RAPP_CAT_EXTERNAL_SECURE_PORT # Base url to the secure RAPP Catalogue REST interface
+RC_ADAPTER=$RC_RESTBASE # Adapter holds the address the RAPP Catalogue interface
\ No newline at end of file
USE_LOCAL_IMAGES=""
# List of available apps to override with local image
-AVAILABLE_LOCAL_IMAGES_OVERRIDE="PA ECS CP SDNC RICSIM"
+AVAILABLE_LOCAL_IMAGES_OVERRIDE="PA ECS CP SDNC RICSIM RC"
# Use this var (STOP_AT_ERROR=1 in the test script) for debugging/trouble shooting to take all logs and exit at first FAIL test case
STOP_AT_ERROR=0
trap_fnc() {
if [ $? -eq 127 ]; then
- echo -e $RED"Function not found, set script to FAIL"$ERED
+ echo -e $RED"Function not found, setting script to FAIL"$ERED
((RES_CONF_FAIL++))
fi
}
export PROD_STUB_HTTPX="http"
export PROD_STUB_PORT=$PROD_STUB_INTERNAL_PORT
-export PROD_STUB_LOCAL_PORT=$PROD_STUB_EXTERNAL_PORT #When CR is running outside the docker net
+export PROD_STUB_LOCAL_PORT=$PROD_STUB_EXTERNAL_PORT #When Prodstub is running outside the docker net
export PROD_STUB_LOCALHOST=$PROD_STUB_HTTPX"://localhost:"$PROD_STUB_LOCAL_PORT
export SDNC_HTTPX="http"
export SDNC_PORT=$SDNC_INTERNAL_PORT
export SDNC_LOCAL_PORT=$SDNC_EXTERNAL_PORT #When agent is running outside the docker net
+export RAPP_CAT_HTTPX="http"
+export RAPP_CAT_PORT=$RAPP_CAT_INTERNAL_PORT
+export RAPP_CAT_LOCAL_PORT=$RAPP_CAT_EXTERNAL_PORT #When Rapp catalogue is running outside the docker net
+
echo -e $BOLD"Checking configured image setting for this test case"$EBOLD
#Temp var to check for image variable name errors
__check_image_var " ECS" $START_ARG "ECS_IMAGE" "ECS_LOCAL_IMAGE" "ECS_LOCAL_IMAGE_TAG" ECS
fi
+ __check_image_local_override 'RC'
+ if [ $? -eq 0 ]; then
+ #Remote ecs image
+ __check_image_var " RC" $START_ARG "RAPP_CAT_IMAGE" "RAPP_CAT_REMOTE_IMAGE" "RAPP_CAT_REMOTE_IMAGE_TAG" RC
+ else
+ #Local ecs image
+ __check_image_var " RC" $START_ARG "RAPP_CAT_IMAGE" "RAPP_CAT_LOCAL_IMAGE" "RAPP_CAT_LOCAL_IMAGE_TAG" RC
+ fi
+
else
#Should never get here....
echo "Unknow args: "$@
echo -e $YELLOW" Excluding Non-RT RIC Control Panel image from image check/pull"$EYELLOW
fi
+__check_included_image 'RC'
+if [ $? -eq 0 ]; then
+ START_ARG_MOD=$START_ARG
+ __check_image_local_override 'RC'
+ if [ $? -eq 1 ]; then
+ START_ARG_MOD="local"
+ fi
+ app="RAPP Catalogue"; __check_and_pull_image $START_ARG_MOD "$app" $RAPP_CAT_APP_NAME $RAPP_CAT_IMAGE
+else
+ echo -e $YELLOW" Excluding RAPP Catalogue image from image check/pull"$EYELLOW
+fi
+
__check_included_image 'RICSIM'
if [ $? -eq 0 ]; then
START_ARG_MOD=$START_ARG
if [ $? -eq 0 ]; then
echo -e " RIC Simulator\t$(docker images --format $format_string $RIC_SIM_IMAGE)" >> $docker_tmp_file
fi
+__check_included_image 'RC'
+if [ $? -eq 0 ]; then
+ echo -e " RAPP Catalogue\t$(docker images --format $format_string $RAPP_CAT_IMAGE)" >> $docker_tmp_file
+fi
__check_included_image 'MR'
if [ $? -eq 0 ]; then
echo -e " Message Router\t$(docker images --format $format_string $MRSTUB_IMAGE)" >> $docker_tmp_file
CONTAINTER_NAMES=("Policy Agent " $(__check_app_name $POLICY_AGENT_APP_NAME)\
"ECS " $(__check_app_name $ECS_APP_NAME)\
+ "RAPP Catalogue " $(__check_app_name $RAPP_CAT_APP_NAME)\
"Non-RT RIC Simulator(s)" $(__check_app_name $RIC_SIM_PREFIX)\
"Message Router " $(__check_app_name $MR_APP_NAME)\
"Callback Receiver " $(__check_app_name $CR_APP_NAME)\
}
+###########################
+### RAPP Catalogue
+###########################
+
+# Start the RAPP Catalogue container
+# args: -
+# (Function for test scripts)
+start_rapp_catalogue() {
+
+ echo -e $BOLD"Starting RAPP Catalogue"$EBOLD
+
+ __check_included_image 'RC'
+ if [ $? -eq 1 ]; then
+ echo -e $RED"The RAPP Catalogue image has not been checked for this test run due to arg to the test script"$ERED
+ echo -e $RED"The RAPP Catalogue will not be started"$ERED
+ exit
+ fi
+ __start_container rapp_catalogue NODOCKERARGS $RAPP_CAT_APP_NAME $RAPP_CAT_EXTERNAL_PORT "/services" "http"
+}
+
+use_rapp_catalogue_http() {
+ echo -e $BOLD"RAPP Catalogue protocol setting"$EBOLD
+ echo -e " Using $BOLD http $EBOLD towards the RAPP Catalogue"
+ export RAPP_CAT_HTTPX="http"
+ export RAPP_CAT_PORT=$RAPP_CAT_INTERNAL_PORT
+ export RAPP_CAT_LOCAL_PORT=$RAPP_CAT_EXTERNAL_PORT
+ echo ""
+}
+
+use_rapp_catalogue_https() {
+ echo -e $BOLD"RAPP Catalogue protocol setting"$EBOLD
+ echo -e " Using $BOLD https $EBOLD towards the RAPP Catalogue"
+ export RAPP_CAT_HTTPX="https"
+ export RAPP_CAT_PORT=$RAPP_CAT_INTERNAL_PORT
+ export RAPP_CAT_LOCAL_PORT=$RAPP_CAT_EXTERNAL_PORT
+ echo ""
+}
+
##################
### SDNC functions
##################
--- /dev/null
+.tmp.json
+.dockererr
\ No newline at end of file
--- /dev/null
+# ============LICENSE_START===============================================
+# Copyright (C) 2020 Nordix Foundation. All rights reserved.
+# ========================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=================================================
+#
+version: '3.0'
+networks:
+ default:
+ external:
+ name: nonrtric-docker-net
+services:
+ rapp-catalogue:
+ image: ${RAPP_CAT_IMAGE}
+ container_name: ${RAPP_CAT_APP_NAME}
+ networks:
+ - default
+ ports:
+ - ${RAPP_CAT_EXTERNAL_PORT}:${RAPP_CAT_INTERNAL_PORT}
+ - ${RAPP_CAT_EXTERNAL_SECURE_PORT}:${RAPP_CAT_INTERNAL_SECURE_PORT}
+
+
+
+
var CR_PORT="8090"
var ECS_PORT="8083"
var PRODSTUB_PORT="8092"
+var RC_PORT="8680"
var http = require('http');
var refreshCount_cr=-1
+var refreshCount_rc=-1
+
var ricbasename="ricsim"
+var rc_services=""
+
function fetchAllMetrics_pol() {
console.log("Fetching policy metrics " + refreshCount_pol)
}, 500)
}
+function fetchAllMetrics_rc() {
+
+ console.log("Fetching RC services - timer:" + refreshCount_ecs)
+
+ if (refreshCount_rc < 0) {
+ refreshCount_rc = -1
+ return
+ } else {
+ refreshCount_rc = refreshCount_rc - 1
+ }
+ setTimeout(() => {
+
+ if (checkFunctionFlag("rc_stat")) {
+ getSimCtr(LOCALHOST+RC_PORT+"/services", 0, function(data, index) {
+ var tmp_serv=""
+ try {
+ var jd=JSON.parse(data);
+ for(var i=0;i<jd.length;i++) {
+ if (tmp_serv.length > 0) {
+ tmp_serv=tmp_serv+","
+ }
+ tmp_serv=tmp_serv+jd[i]["name"]
+ }
+
+ }
+ catch (err) {
+ tmp_serv="no_response"
+ }
+ rc_services=tmp_serv
+ });
+ clearFlag("rc_stat")
+ }
+ fetchAllMetrics_rc();
+ }, 500)
+}
+
// Monitor for CR db
app.get("/mon3",function(req, res){
htmlStr=htmlStr+"<br>";
for(i=0;i<ecs_job_status.length;i++) {
tmp=ecs_job_status[i]
- console.log("tmp")
if (tmp != undefined) {
s = padding("Job", 18, ".") + formatDataRow(tmp) + "<br>"
htmlStr=htmlStr+s
}
refreshCount_pol=5
+ if (refreshCount_rc < 0) {
+ refreshCount_rc=5
+ fetchAllMetrics_rc()
+ }
+ refreshCount_rc=5
+
var bn=req.query.basename
if (bn == undefined) {
"Callbacks fetched:...................." + formatDataRow(cr2) + "<br>" +
"Number of waiting callback messages:.." + formatDataRow(cr3) + "<br>" +
"</font>" +
+ "<h3>R-APP Catalogue</h3>" +
+ "<font face=\"monospace\">" +
+ "Services:............................." + formatIdRowCompact(rc_services) + "<br>" +
+ "</font>" +
"<h3>Near-RT RIC Simulators</h3>" +
"<font face=\"monospace\">"