From 89b64ab194785ec389c8353e4b90e3e7edd08662 Mon Sep 17 00:00:00 2001 From: BjornMagnussonXA Date: Wed, 16 Dec 2020 09:21:01 +0100 Subject: [PATCH] Improved specification of images and tags Issue-ID: NONRTRIC-363 Signed-off-by: BjornMagnussonXA Change-Id: Ia6ecc3d34f2b960cdb3a64d354dfc690b7afc04c --- test/auto-test/FTC1.sh | 2 +- test/auto-test/FTC10.sh | 2 +- test/auto-test/FTC100.sh | 3 +- test/auto-test/FTC110.sh | 2 +- test/auto-test/FTC1100.sh | 2 +- test/auto-test/FTC150.sh | 2 +- test/auto-test/FTC1800.sh | 2 +- test/auto-test/FTC300.sh | 2 +- test/auto-test/FTC310.sh | 2 +- test/auto-test/FTC350.sh | 2 +- test/auto-test/FTC800.sh | 2 +- test/auto-test/FTC810.sh | 2 +- test/auto-test/FTC850.sh | 2 +- test/auto-test/FTC900.sh | 2 +- test/auto-test/PM_DEMO.sh | 2 +- test/auto-test/PM_EI_DEMO.sh | 4 +- test/auto-test/README.md | 2 +- test/common/README.md | 22 +- test/common/test_env-onap-guilin.sh | 127 ++++-- ...nv-onap-master.sh => test_env-onap-honolulu.sh} | 162 +++++-- test/common/test_env-oran-cherry.sh | 181 +++++--- test/common/test_env-oran-dawn.sh | 276 +++++++++++ test/common/test_env.sh | 12 +- test/common/testcase_common.sh | 502 +++++++++++++++------ 24 files changed, 1009 insertions(+), 310 deletions(-) rename test/common/{test_env-onap-master.sh => test_env-onap-honolulu.sh} (67%) create mode 100755 test/common/test_env-oran-dawn.sh diff --git a/test/auto-test/FTC1.sh b/test/auto-test/FTC1.sh index 144ac364..9c0254fc 100755 --- a/test/auto-test/FTC1.sh +++ b/test/auto-test/FTC1.sh @@ -24,7 +24,7 @@ TC_ONELINE_DESCR="Sanity test, create service and then create,update and delete INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC10.sh b/test/auto-test/FTC10.sh index ca545b2e..77a6c340 100755 --- a/test/auto-test/FTC10.sh +++ b/test/auto-test/FTC10.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Basic use case, register service, create/update policy, delete INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC100.sh b/test/auto-test/FTC100.sh index 4b2e1629..34705f4e 100755 --- a/test/auto-test/FTC100.sh +++ b/test/auto-test/FTC100.sh @@ -23,9 +23,8 @@ TC_ONELINE_DESCR="Full agent API walkthrough using agent REST/DMAAP and with/wit #App names to include in the test, space separated list INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" - #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC110.sh b/test/auto-test/FTC110.sh index 0406c405..50e3f370 100755 --- a/test/auto-test/FTC110.sh +++ b/test/auto-test/FTC110.sh @@ -24,7 +24,7 @@ TC_ONELINE_DESCR="Testing of service registration timeouts and keepalive" INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC1100.sh b/test/auto-test/FTC1100.sh index 4672cb2b..3ad18f3f 100755 --- a/test/auto-test/FTC1100.sh +++ b/test/auto-test/FTC1100.sh @@ -24,7 +24,7 @@ TC_ONELINE_DESCR="ECS full intefaces walkthrough" INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/ecs_api_functions.sh diff --git a/test/auto-test/FTC150.sh b/test/auto-test/FTC150.sh index daeb3c7c..ab1e8a63 100755 --- a/test/auto-test/FTC150.sh +++ b/test/auto-test/FTC150.sh @@ -24,7 +24,7 @@ TC_ONELINE_DESCR="Sample tests of the SDNC A1 controller restconf API using http INCLUDED_IMAGES="RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/controller_api_functions.sh diff --git a/test/auto-test/FTC1800.sh b/test/auto-test/FTC1800.sh index caec9398..f8079678 100755 --- a/test/auto-test/FTC1800.sh +++ b/test/auto-test/FTC1800.sh @@ -24,7 +24,7 @@ TC_ONELINE_DESCR="ECS Create 10000 jobs and restart, test job persisency" INCLUDED_IMAGES="ECS PRODSTUB CR CP" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/ecs_api_functions.sh diff --git a/test/auto-test/FTC300.sh b/test/auto-test/FTC300.sh index 39732825..713d330f 100755 --- a/test/auto-test/FTC300.sh +++ b/test/auto-test/FTC300.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Resync 10000 policies using OSC and STD interface" INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC310.sh b/test/auto-test/FTC310.sh index eec45420..674df8c5 100755 --- a/test/auto-test/FTC310.sh +++ b/test/auto-test/FTC310.sh @@ -24,7 +24,7 @@ TC_ONELINE_DESCR="Resync of RIC via changes in the consul config or pushed confi INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC350.sh b/test/auto-test/FTC350.sh index 0605944d..4df0a15d 100755 --- a/test/auto-test/FTC350.sh +++ b/test/auto-test/FTC350.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Change supported policy types and reconfigure rics" INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC800.sh b/test/auto-test/FTC800.sh index c90940c7..ceda58c3 100755 --- a/test/auto-test/FTC800.sh +++ b/test/auto-test/FTC800.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Create 10000 policies in sequence using http/https and Agent R INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC810.sh b/test/auto-test/FTC810.sh index 7ac759cb..c5d284a0 100755 --- a/test/auto-test/FTC810.sh +++ b/test/auto-test/FTC810.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC850.sh b/test/auto-test/FTC850.sh index 3b65b10a..324044ef 100755 --- a/test/auto-test/FTC850.sh +++ b/test/auto-test/FTC850.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Create/delete policies in parallel over a number of rics using INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/FTC900.sh b/test/auto-test/FTC900.sh index 356301e8..8a937ffc 100755 --- a/test/auto-test/FTC900.sh +++ b/test/auto-test/FTC900.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Preparation for test of the Control Panel and the Health Check INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/PM_DEMO.sh b/test/auto-test/PM_DEMO.sh index c43ad3eb..fe853720 100755 --- a/test/auto-test/PM_DEMO.sh +++ b/test/auto-test/PM_DEMO.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Preparation demo setup - populating a number of ric simulator INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh diff --git a/test/auto-test/PM_EI_DEMO.sh b/test/auto-test/PM_EI_DEMO.sh index 2915b02c..3f9f8fd2 100755 --- a/test/auto-test/PM_EI_DEMO.sh +++ b/test/auto-test/PM_EI_DEMO.sh @@ -23,7 +23,7 @@ TC_ONELINE_DESCR="Preparation demo setup - policy management and enrichment inf INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC ECS PRODSTUB RC" #SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ORAN-CHERRY" +SUPPORTED_PROFILES="ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" . ../common/testcase_common.sh $@ . ../common/agent_api_functions.sh @@ -72,8 +72,6 @@ consul_config_app ".consul_config.json" start_policy_agent -start_rapp_catalogue - start_cr start_prod_stub diff --git a/test/auto-test/README.md b/test/auto-test/README.md index 82ff47b9..005ee0a4 100644 --- a/test/auto-test/README.md +++ b/test/auto-test/README.md @@ -15,7 +15,7 @@ The test scripts uses configuration from a single file, found in `../common/test ## 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 --env-file ../common/test_env-oran-cherry + ./FTC1.sh remote --env-file ../common/test_env-oran-cherry.sh See the README.md in `../common/` for all details about available parameters and their meaning. diff --git a/test/common/README.md b/test/common/README.md index 21475c0e..b4754cd3 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -68,18 +68,22 @@ The script can be started with these arguments | arg list | |--| -| `local|remote|remote-remove [auto-clean] [--stop-at-error] [--ricsim-prefix ] [ --env-file ] [--use-local-image []*]` | +| `remote|remote-remove --env-file [release] [auto-clean] [--stop-at-error] [--ricsim-prefix ] [--use-local-image +] [--use-snapshot-image +] [--use-staging-image +] [--use-release-image +]` | | parameter | description | |-|-| -| `local` | only locally built images (in local docker respository) will be used for the Non-RT RIC components. CBS, Consul, DB will still use remote nexus images | -| `remote` | only remote images from nexus will be used. Images pulled if not present in local docker repository | -| `remote-remove` | same as remote but all images are removed first so that fresh images are pulled when running | -| `auto-clean` | all containers will be automatically stopped and removed when the test case is complete. Requires the function 'auto_clean_containers' to be included last in the applicable auto-test script | -| `--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 ` | 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 []*` | 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 | +| `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags | +| `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories | +| `--env-file` | The script will use the supplied file to read environment variables from | +| `release` | If this flag is given the script will use release version of the images | +| `auto-clean` | If the function 'auto_clean_containers' is present in the end of the test script then all containers will be stopped and removed. If 'auto-clean' is not given then the function has no effect | +| `--stop-at-error` | The script will stop when the first failed test or configuration | +| `--ricsim-prefix ` | The a1 simulator will use the supplied string as container prefix instead of '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). | +| `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names | +| `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names | +| `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names | +| `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names | +| `help` | Print this info along with the test script description and the list of app short names supported | ## Function: print_result ## diff --git a/test/common/test_env-onap-guilin.sh b/test/common/test_env-onap-guilin.sh index 1dc2b363..9b85bf0d 100644 --- a/test/common/test_env-onap-guilin.sh +++ b/test/common/test_env-onap-guilin.sh @@ -18,64 +18,123 @@ # #Profile for ONAP guilin release TEST_ENV_PROFILE="ONAP-GUILIN" -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. -# NOTE: A env var for each container is created by the test script. -# This var will point to the local or remote var depending on how -# the test script is started. The name format is _IMAGE, ie with 'LOCAL' or 'REMOTE'. - -# Tag for guilin branch -# Remote Policy Agent image and tag -POLICY_AGENT_REMOTE_IMAGE="nexus3.onap.org:10003/onap/ccsdk-oran-a1policymanagementservice" -POLICY_AGENT_REMOTE_IMAGE_TAG="1.0.2-SNAPSHOT" +######################################## +## Nexus repo settings +######################################## +# Nexus repos for developed images +NEXUS_PROXY_REPO="nexus3.onap.org:10001/" +NEXUS_RELEASE_REPO="nexus3.onap.org:10002/" +NEXUS_SNAPSHOT_REPO="nexus3.onap.org:10003/" +NEXUS_STAGING_REPO=$NEXUS_SNAPSHOT_REPO #staging repo not used in ONAP, using snapshot + +# Nexus repos for images used by test (not developed by the project) +NEXUS_RELEASE_REPO_ORAN="nexus3.o-ran-sc.org:10002/" # Only for released ORAN images +NEXUS_RELEASE_REPO_ONAP=$NEXUS_RELEASE_REPO + +######################################## +# Set up of image and tags for the test. +######################################## + +# NOTE: One environment variable containing the image name and tag is create by the test script +# for each image from the env variables below. +# The variable is created by removing the suffix "_BASE" from the base image variable name. +# Example: POLICY_AGENT_IMAGE_BASE -> POLICY_AGENT_IMAGE +# This var will point to the local or remote image depending on cmd line arguments. +# In addition, the repo and the image tag version are selected from the list of image tags based on the cmd line argurment. +# For images built by the script, only tag #1 shall be specified +# For project images, only tag #1, #2, #3 and #4 shall be specified +# For ORAN images (non project), only tag #5 shall be specified +# For ONAP images (non project), only tag #6 shall be specified +# For all other images, only tag #7 shall be specified +# 1 XXX_LOCAL: local images: : +# 2 XXX_REMOTE_SNAPSHOT: snapshot images: : +# 3 XXX_REMOTE: staging images: : +# 4 XXX_REMOTE_RELEASE: release images: : +# 5 XXX_REMOTE_RELEASE_ORAN: ORAN release images: : +# 6 XXX_REMOTE_RELEASE_ONAP: ONAP release images: : +# 7 XXX_PROXY: other images, not produced by the project: : + + +# Policy Agent image and tags +POLICY_AGENT_IMAGE_BASE="onap/ccsdk-oran-a1policymanagementservice" +POLICY_AGENT_IMAGE_TAG_LOCAL="1.0.2-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="1.0.2-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE="1.0.2-SNAPSHOT" #Will use snapshot repo +POLICY_AGENT_IMAGE_TAG_REMOTE_RELEASE="1.0.1" -# Control Panel remote image and tag -CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_REMOTE_IMAGE_TAG="2.0.0" # Tag for guilin branch # SDNC A1 Controller remote image and tag -SDNC_A1_CONTROLLER_REMOTE_IMAGE="nexus3.onap.org:10003/onap/sdnc-image" -SDNC_A1_CONTROLLER_REMOTE_IMAGE_TAG="2.0.2-STAGING-latest" +SDNC_A1_CONTROLLER_IMAGE_BASE="onap/sdnc-image" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.0.5-STAGING-latest" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.0.5-STAGING-latest" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.0.4" #Will use snapshot repo #SDNC DB remote image and tag -SDNC_DB_REMOTE_IMAGE=$NEXUS_PROXY_REPO"mysql/mysql-server" -SDNC_DB_REMOTE_IMAGE_TAG="5.6" -#No local image for DB, remote image always used +#The DB is part of SDNC so handled in the same way as SDNC +SDNC_DB_IMAGE_BASE="mysql/mysql-server" +SDNC_DB_IMAGE_TAG_REMOTE_PROXY="5.6" -# Near RT RIC Simulator remote image and tag -RIC_SIM_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator" -RIC_SIM_REMOTE_IMAGE_TAG="2.0.0" +# Control Panel image and tag - uses bronze release +CONTROL_PANEL_IMAGE_BASE="o-ran-sc/nonrtric-controlpanel" +CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE_ORAN="2.0.0" + + +# Near RT RIC Simulator image and tags - uses bronze release +RIC_SIM_IMAGE_BASE="o-ran-sc/a1-simulator" +RIC_SIM_IMAGE_TAG_REMOTE_RELEASE_ORAN="2.0.0" #Consul remote image and tag -CONSUL_REMOTE_IMAGE=$NEXUS_PROXY_REPO"consul" -CONSUL_REMOTE_IMAGE_TAG="1.7.2" +CONSUL_IMAGE_BASE="consul" +CONSUL_IMAGE_TAG_REMOTE_PROXY="1.7.2" #No local image for Consul, remote image always used #CBS remote image and tag -CBS_REMOTE_IMAGE="nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app" -CBS_REMOTE_IMAGE_TAG="2.3.0" +CBS_IMAGE_BASE="onap/org.onap.dcaegen2.platform.configbinding.app-app" +CBS_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.3.0" #No local image for CBS, remote image always used #MR stub image and tag -MRSTUB_LOCAL_IMAGE="mrstub" -MRSTUB_LOCAL_IMAGE_TAG="latest" +MRSTUB_IMAGE_BASE="mrstub" +MRSTUB_IMAGE_TAG_LOCAL="latest" #No remote image for MR stub, local image always used + #Callback receiver image and tag -CR_LOCAL_IMAGE="callback-receiver" -CR_LOCAL_IMAGE_TAG="latest" +CR_IMAGE_BASE="callback-receiver" +CR_IMAGE_TAG_LOCAL="latest" #No remote image for CR, local image always used -# Common env var for auto-test. Vars used by docker-compose need to be exported + +#Producer stub image and tag +PROD_STUB_IMAGE_BASE="producer-stub" +PROD_STUB_IMAGE_TAG_LOCAL="latest" +#No remote image for producer stub, local image always used + + +# List of app short names produced by the project +PROJECT_IMAGES_APP_NAMES="PA SDNC" + +# List of app short names which images pulled from ORAN +ORAN_IMAGES_APP_NAMES="CP RICSIM" + +# List of app short names which images pulled from ONAP +ONAP_IMAGES_APP_NAMES="" # Not used + +######################################## +# Detailed settings per app +######################################## + +# Vars used by docker-compose need to be exported + + export DOCKER_SIM_NWNAME="nonrtric-docker-net" # Name of docker private network export POLICY_AGENT_EXTERNAL_PORT=8081 # Policy Agent container external port (host -> container) @@ -140,6 +199,12 @@ export CONTROL_PANEL_EXTERNAL_PORT=8080 # Control Panel export CONTROL_PANEL_INTERNAL_PORT=8080 # Control Panel container external port (host -> container) CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log" # Path the application log in the Control Panel container + +######################################## +# Setting for common curl-base function +######################################## + + UUID="" # UUID used as prefix to the policy id to simulate a real UUID # Testscript need to set the UUID to use other this empty prefix is used diff --git a/test/common/test_env-onap-master.sh b/test/common/test_env-onap-honolulu.sh similarity index 67% rename from test/common/test_env-onap-master.sh rename to test/common/test_env-onap-honolulu.sh index 29647bd2..a8c852ec 100644 --- a/test/common/test_env-onap-master.sh +++ b/test/common/test_env-onap-honolulu.sh @@ -16,84 +16,134 @@ # limitations under the License. # ============LICENSE_END================================================= # -#Profile for ONAP master -TEST_ENV_PROFILE="ONAP-MASTER" +#Profile for ONAP honolulu release +TEST_ENV_PROFILE="ONAP-HONOLULU" + +######################################## +## Nexus repo settings +######################################## + +# Nexus repos for developed images NEXUS_PROXY_REPO="nexus3.onap.org:10001/" +NEXUS_RELEASE_REPO="nexus3.onap.org:10002/" +NEXUS_SNAPSHOT_REPO="nexus3.onap.org:10003/" +NEXUS_STAGING_REPO=$NEXUS_SNAPSHOT_REPO #staging repo not used in ONAP, using snapshot + +# Nexus repos for images used by test (not developed by the project) +NEXUS_RELEASE_REPO_ORAN="nexus3.o-ran-sc.org:10002/" # Only for released ORAN images +NEXUS_RELEASE_REPO_ONAP=$NEXUS_RELEASE_REPO + +######################################## +# Set up of image and tags for the test. +######################################## + +# NOTE: One environment variable containing the image name and tag is create by the test script +# for each image from the env variables below. +# The variable is created by removing the suffix "_BASE" from the base image variable name. +# Example: POLICY_AGENT_IMAGE_BASE -> POLICY_AGENT_IMAGE +# This var will point to the local or remote image depending on cmd line arguments. +# In addition, the repo and the image tag version are selected from the list of image tags based on the cmd line argurment. +# For images built by the script, only tag #1 shall be specified +# For project images, only tag #1, #2, #3 and #4 shall be specified +# For ORAN images (non project), only tag #5 shall be specified +# For ONAP images (non project), only tag #6 shall be specified +# For all other images, only tag #7 shall be specified +# 1 XXX_LOCAL: local images: : +# 2 XXX_REMOTE_SNAPSHOT: snapshot images: : +# 3 XXX_REMOTE: staging images: : +# 4 XXX_REMOTE_RELEASE: release images: : +# 5 XXX_REMOTE_RELEASE_ORAN: ORAN release images: : +# 6 XXX_REMOTE_RELEASE_ONAP: ONAP release images: : +# 7 XXX_PROXY: other images, not produced by the project: : + +# Policy Agent image and tags +POLICY_AGENT_IMAGE_BASE="onap/ccsdk-oran-a1policymanagementservice" +POLICY_AGENT_IMAGE_TAG_LOCAL="1.1.1-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="1.1.1-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE="1.1.1-SNAPSHOT" #Will use snapshot repo +POLICY_AGENT_IMAGE_TAG_REMOTE_RELEASE="1.1.1" -# Set up the image and tags for the test. Do not add the image tag to the image names. -# NOTE: A env var for each container is created by the test script. -# This var will point to the local or remote var depending on how -# the test script is started. The name format is _IMAGE, ie with 'LOCAL' or 'REMOTE'. +# SDNC A1 Controller remote image and tag +SDNC_A1_CONTROLLER_IMAGE_BASE="onap/sdnc-image" +SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.1.1-SNAPSHOT" ###CHECK THIS +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.1-STAGING-latest" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.1.1-STAGING-latest" #Will use snapshot repo +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.1.1" -# Local Policy Agent image and tag -POLICY_AGENT_LOCAL_IMAGE="onap/ccsdk-oran-a1policymanagementservice" -POLICY_AGENT_LOCAL_IMAGE_TAG="1.1.0-SNAPSHOT" -# Remote Policy Agent image and tag -POLICY_AGENT_REMOTE_IMAGE="nexus3.onap.org:10003/onap/ccsdk-oran-a1policymanagementservice" -POLICY_AGENT_REMOTE_IMAGE_TAG="1.1.0-SNAPSHOT" +#SDNC DB remote image and tag +#The DB is part of SDNC so handled in the same way as SDNC +SDNC_DB_IMAGE_BASE="mysql/mysql-server" +SDNC_DB_IMAGE_TAG_REMOTE_PROXY="5.6" -# Local ECS image and tag -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" -# Control Panel local image and tag -CONTROL_PANEL_LOCAL_IMAGE="o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_LOCAL_IMAGE_TAG="2.0.0-SNAPSHOT" -# Control Panel remote image and tag -CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_REMOTE_IMAGE_TAG="2.0.0" +# ECS image and tag - uses cherry release +ECS_IMAGE_BASE="o-ran-sc/nonrtric-enrichment-coordinator-service" +ECS_IMAGE_TAG_REMOTE_RELEASE_ORAN="1.0.0" -# SDNC A1 Controller remote image and tag -SDNC_A1_CONTROLLER_REMOTE_IMAGE="nexus3.onap.org:10003/onap/sdnc-image" -SDNC_A1_CONTROLLER_REMOTE_IMAGE_TAG="2.1.0-STAGING-latest" +# Control Panel image and tag - uses cherry release +CONTROL_PANEL_IMAGE_BASE="o-ran-sc/nonrtric-controlpanel" +CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE_ORAN="2.1.0" -#SDNC DB remote image and tag -SDNC_DB_REMOTE_IMAGE=$NEXUS_PROXY_REPO"mysql/mysql-server" -SDNC_DB_REMOTE_IMAGE_TAG="5.6" -#No local image for DB, remote image always used +# RAPP Catalogue image and tags - uses cherry release +RAPP_CAT_IMAGE_BASE="o-ran-sc/nonrtric-r-app-catalogue" +RAPP_CAT_IMAGE_TAG_REMOTE_RELEASE_ORAN="1.0.0" -# Near RT RIC Simulator local image and tag -RIC_SIM_LOCAL_IMAGE="o-ran-sc/a1-simulator" -RIC_SIM_LOCAL_IMAGE_TAG="latest" -# Near RT RIC Simulator remote image and tag -RIC_SIM_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator" -RIC_SIM_REMOTE_IMAGE_TAG="2.1.0" + +# Near RT RIC Simulator image and tags - uses cherry release +RIC_SIM_IMAGE_BASE="o-ran-sc/a1-simulator" +RIC_SIM_IMAGE_TAG_REMOTE_RELEASE_ORAN="2.1.0" #Consul remote image and tag -CONSUL_REMOTE_IMAGE=$NEXUS_PROXY_REPO"consul" -CONSUL_REMOTE_IMAGE_TAG="1.7.2" +CONSUL_IMAGE_BASE="consul" +CONSUL_IMAGE_TAG_REMOTE_PROXY="1.7.2" #No local image for Consul, remote image always used #CBS remote image and tag -CBS_REMOTE_IMAGE="nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app" -CBS_REMOTE_IMAGE_TAG="2.3.0" +CBS_IMAGE_BASE="onap/org.onap.dcaegen2.platform.configbinding.app-app" +CBS_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.3.0" #No local image for CBS, remote image always used #MR stub image and tag -MRSTUB_LOCAL_IMAGE="mrstub" -MRSTUB_LOCAL_IMAGE_TAG="latest" +MRSTUB_IMAGE_BASE="mrstub" +MRSTUB_IMAGE_TAG_LOCAL="latest" #No remote image for MR stub, local image always used + #Callback receiver image and tag -CR_LOCAL_IMAGE="callback-receiver" -CR_LOCAL_IMAGE_TAG="latest" +CR_IMAGE_BASE="callback-receiver" +CR_IMAGE_TAG_LOCAL="latest" #No remote image for CR, local image always used + #Producer stub image and tag -PROD_STUB_LOCAL_IMAGE="producer-stub" -PROD_STUB_LOCAL_IMAGE_TAG="latest" +PROD_STUB_IMAGE_BASE="producer-stub" +PROD_STUB_IMAGE_TAG_LOCAL="latest" #No remote image for producer stub, local image always used -# Common env var for auto-test. Vars used by docker-compose need to be exported + +# List of app short names produced by the project +PROJECT_IMAGES_APP_NAMES="PA SDNC" + +# List of app short names which images pulled from ORAN +ORAN_IMAGES_APP_NAMES="CP ECS RICSIM RC" + +# List of app short names which images pulled from ONAP +ONAP_IMAGES_APP_NAMES="" # Not used + + +######################################## +# Detailed settings per app +######################################## + +# Vars used by docker-compose need to be exported + + export DOCKER_SIM_NWNAME="nonrtric-docker-net" # Name of docker private network export POLICY_AGENT_EXTERNAL_PORT=8081 # Policy Agent container external port (host -> container) @@ -171,12 +221,22 @@ SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:" # Base url path 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_APP_NAME="rapp-catalogue" # Name for the RAPP Catalogue +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 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) CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log" # Path the application log in the Control Panel container + +######################################## +# Setting for common curl-base function +######################################## + UUID="" # UUID used as prefix to the policy id to simulate a real UUID # Testscript need to set the UUID to use other this empty prefix is used @@ -198,4 +258,8 @@ ECS_ADAPTER=$ECS_RESTBASE # Adapter holds 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 diff --git a/test/common/test_env-oran-cherry.sh b/test/common/test_env-oran-cherry.sh index 4650768e..a0f8871e 100755 --- a/test/common/test_env-oran-cherry.sh +++ b/test/common/test_env-oran-cherry.sh @@ -18,94 +18,144 @@ # #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. +######################################## +## Nexus repo settings +######################################## + +# Nexus repos for developed images +NEXUS_PROXY_REPO="nexus3.o-ran-sc.org:10001/" +NEXUS_RELEASE_REPO="nexus3.o-ran-sc.org:10002/" +NEXUS_SNAPSHOT_REPO="nexus3.o-ran-sc.org:10003/" +NEXUS_STAGING_REPO="nexus3.o-ran-sc.org:10004/" + +# Nexus repos for images used by test (not developed by the project) +NEXUS_RELEASE_REPO_ONAP="nexus3.onap.org:10002/" # Only for released ONAP images +NEXUS_RELEASE_REPO_ORAN=$NEXUS_RELEASE_REPO + +######################################## +# Set up of image and tags for the test. +######################################## + +# NOTE: One environment variable containing the image name and tag is create by the test script +# for each image from the env variables below. +# The variable is created by removing the suffix "_BASE" from the base image variable name. +# Example: POLICY_AGENT_IMAGE_BASE -> POLICY_AGENT_IMAGE +# This var will point to the local or remote image depending on cmd line arguments. +# In addition, the repo and the image tag version are selected from the list of image tags based on the cmd line argurment. +# For images built by the script, only tag #1 shall be specified +# For project images, only tag #1, #2, #3 and #4 shall be specified +# For ORAN images (non project), only tag #5 shall be specified +# For ONAP images (non project), only tag #6 shall be specified +# For all other images, only tag #7 shall be specified +# 1 XXX_LOCAL: local images: : +# 2 XXX_REMOTE_SNAPSHOT: snapshot images: : +# 3 XXX_REMOTE: staging images: : +# 4 XXX_REMOTE_RELEASE: release images: : +# 5 XXX_REMOTE_RELEASE_ORAN: ORAN release images: : +# 6 XXX_REMOTE_RELEASE_ONAP: ONAP release images: : +# 7 XXX_PROXY: other images, not produced by the project: : + + +# Policy Agent base image and tags +POLICY_AGENT_IMAGE_BASE="o-ran-sc/nonrtric-policy-agent" +POLICY_AGENT_IMAGE_TAG_LOCAL="2.1.0-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE="2.1.0" +POLICY_AGENT_IMAGE_TAG_REMOTE_RELEASE="2.1.0" + +# ECS image and tags +ECS_IMAGE_BASE="o-ran-sc/nonrtric-enrichment-coordinator-service" +ECS_IMAGE_TAG_LOCAL="1.0.0-SNAPSHOT" +ECS_IMAGE_TAG_REMOTE_SNAPSHOT="1.0.0-SNAPSHOT" +ECS_IMAGE_TAG_REMOTE="1.0.0" +ECS_IMAGE_TAG_REMOTE_RELEASE="1.0.0" + + +# Control Panel image and tags +CONTROL_PANEL_IMAGE_BASE="o-ran-sc/nonrtric-controlpanel" +CONTROL_PANEL_IMAGE_TAG_LOCAL="2.1.0-SNAPSHOT" +CONTROL_PANEL_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT" +CONTROL_PANEL_IMAGE_TAG_REMOTE="2.1.0" +CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE="2.1.0" + + +# SDNC A1 Controller image and tags +SDNC_A1_CONTROLLER_IMAGE_BASE="o-ran-sc/nonrtric-a1-controller" +SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.0.1-SNAPSHOT" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.0.1-SNAPSHOT" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.0.1" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.0.1" -# NOTE: A env var for each container is created by the test script. -# This var will point to the local or remote var depending on how -# the test script is started. The name format is _IMAGE, ie with 'LOCAL' or 'REMOTE'. -# Local Policy Agent image and tag -POLICY_AGENT_LOCAL_IMAGE="o-ran-sc/nonrtric-policy-agent" -POLICY_AGENT_LOCAL_IMAGE_TAG="2.1.0-SNAPSHOT" -# Remote Policy Agent image and tag -POLICY_AGENT_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent" -POLICY_AGENT_REMOTE_IMAGE_TAG="2.1.0" - -# Local ECS image and tag -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: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" -CONTROL_PANEL_LOCAL_IMAGE_TAG="2.0.0-SNAPSHOT" -# Control Panel remote image and tag -CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_REMOTE_IMAGE_TAG="2.0.0" - - -# SDNC A1 Controller local image and tag -SDNC_A1_CONTROLLER_LOCAL_IMAGE="o-ran-sc/nonrtric-a1-controller" -SDNC_A1_CONTROLLER_LOCAL_IMAGE_TAG="2.1.0-SNAPSHOT" -# SDNC A1 Controller remote image and tag -SDNC_A1_CONTROLLER_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-a1-controller" -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_IMAGE_BASE="mysql/mysql-server" +SDNC_DB_IMAGE_TAG_REMOTE_PROXY="5.6" +#No local image for SSDNC DB, remote image always used -#SDNC DB remote image and tag -SDNC_DB_REMOTE_IMAGE=$NEXUS_PROXY_REPO"mysql/mysql-server" -SDNC_DB_REMOTE_IMAGE_TAG="5.6" -#No local image for DB, remote image always used +# RAPP Catalogue image and tags +RAPP_CAT_IMAGE_BASE="o-ran-sc/nonrtric-r-app-catalogue" +RAPP_CAT_IMAGE_TAG_LOCAL="1.0.0-SNAPSHOT" +RAPP_CAT_IMAGE_TAG_REMOTE_SNAPSHOT="1.0.0-SNAPSHOT" +RAPP_CAT_IMAGE_TAG_REMOTE="1.0.0" +RAPP_CAT_IMAGE_TAG_REMOTE_RELEASE="1.0.0" -# Near RT RIC Simulator local image and tag -RIC_SIM_LOCAL_IMAGE="o-ran-sc/a1-simulator" -RIC_SIM_LOCAL_IMAGE_TAG="latest" -# Near RT RIC Simulator remote image and tag -RIC_SIM_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator" -RIC_SIM_REMOTE_IMAGE_TAG="2.1.0" +# Near RT RIC Simulator image and tags +RIC_SIM_IMAGE_BASE="o-ran-sc/a1-simulator" +RIC_SIM_IMAGE_TAG_LOCAL="latest" +RIC_SIM_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT" +RIC_SIM_IMAGE_TAG_REMOTE="2.1.0" +RIC_SIM_IMAGE_TAG_REMOTE_RELEASE="2.1.0" #Consul remote image and tag -CONSUL_REMOTE_IMAGE=$NEXUS_PROXY_REPO"consul" -CONSUL_REMOTE_IMAGE_TAG="1.7.2" +CONSUL_IMAGE_BASE="consul" +CONSUL_IMAGE_TAG_REMOTE_PROXY="1.7.2" #No local image for Consul, remote image always used #CBS remote image and tag -CBS_REMOTE_IMAGE="nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app" -CBS_REMOTE_IMAGE_TAG="2.3.0" +CBS_IMAGE_BASE="onap/org.onap.dcaegen2.platform.configbinding.app-app" +CBS_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.3.0" #No local image for CBS, remote image always used #MR stub image and tag -MRSTUB_LOCAL_IMAGE="mrstub" -MRSTUB_LOCAL_IMAGE_TAG="latest" +MRSTUB_IMAGE_BASE="mrstub" +MRSTUB_IMAGE_TAG_LOCAL="latest" #No remote image for MR stub, local image always used + #Callback receiver image and tag -CR_LOCAL_IMAGE="callback-receiver" -CR_LOCAL_IMAGE_TAG="latest" +CR_IMAGE_BASE="callback-receiver" +CR_IMAGE_TAG_LOCAL="latest" #No remote image for CR, local image always used + #Producer stub image and tag -PROD_STUB_LOCAL_IMAGE="producer-stub" -PROD_STUB_LOCAL_IMAGE_TAG="latest" +PROD_STUB_IMAGE_BASE="producer-stub" +PROD_STUB_IMAGE_TAG_LOCAL="latest" #No remote image for producer stub, local image always used -# Common env var for auto-test. Vars used by docker-compose need to be exported + +# List of app short names produced by the project +PROJECT_IMAGES_APP_NAMES="PA ECS CP SDNC RC RICSIM" + +# List of app short names which images pulled from ORAN +ORAN_IMAGES_APP_NAMES="" # Not used + +# List of app short names which images pulled from ONAP +ONAP_IMAGES_APP_NAMES="CBS" + + +######################################## +# Detailed settings per app +######################################## + +# Vars used by docker-compose need to be exported + export DOCKER_SIM_NWNAME="nonrtric-docker-net" # Name of docker private network export POLICY_AGENT_EXTERNAL_PORT=8081 # Policy Agent container external port (host -> container) @@ -183,11 +233,11 @@ SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:" # Base url path 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_APP_NAME="rapp-catalogue" # Name for the RAPP Catalogue 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 @@ -195,6 +245,11 @@ export CONTROL_PANEL_EXTERNAL_PORT=8080 # Control Panel export CONTROL_PANEL_INTERNAL_PORT=8080 # Control Panel container external port (host -> container) CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log" # Path the application log in the Control Panel container + +######################################## +# Setting for common curl-base function +######################################## + UUID="" # UUID used as prefix to the policy id to simulate a real UUID # Testscript need to set the UUID otherwise this empty prefix is used diff --git a/test/common/test_env-oran-dawn.sh b/test/common/test_env-oran-dawn.sh new file mode 100755 index 00000000..637e5c1e --- /dev/null +++ b/test/common/test_env-oran-dawn.sh @@ -0,0 +1,276 @@ +#!/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================================================= +# +#Profile for ORAN Cherry +TEST_ENV_PROFILE="ORAN-DAWN" + +######################################## +## Nexus repo settings +######################################## + +# Nexus repos for developed images +NEXUS_PROXY_REPO="nexus3.o-ran-sc.org:10001/" +NEXUS_RELEASE_REPO="nexus3.o-ran-sc.org:10002/" +NEXUS_SNAPSHOT_REPO="nexus3.o-ran-sc.org:10003/" +NEXUS_STAGING_REPO="nexus3.o-ran-sc.org:10004/" + +# Nexus repos for images used by test (not developed by the project) +NEXUS_RELEASE_REPO_ONAP="nexus3.onap.org:10002/" # Only for released ONAP images +NEXUS_RELEASE_REPO_ORAN=$NEXUS_RELEASE_REPO + +######################################## +# Set up of image and tags for the test. +######################################## + +# NOTE: One environment variable containing the image name and tag is create by the test script +# for each image from the env variables below. +# The variable is created by removing the suffix "_BASE" from the base image variable name. +# Example: POLICY_AGENT_IMAGE_BASE -> POLICY_AGENT_IMAGE +# This var will point to the local or remote image depending on cmd line arguments. +# In addition, the repo and the image tag version are selected from the list of image tags based on the cmd line argurment. +# For images built by the script, only tag #1 shall be specified +# For project images, only tag #1, #2, #3 and #4 shall be specified +# For ORAN images (non project), only tag #5 shall be specified +# For ONAP images (non project), only tag #6 shall be specified +# For all other images, only tag #7 shall be specified +# 1 XXX_LOCAL: local images: : +# 2 XXX_REMOTE_SNAPSHOT: snapshot images: : +# 3 XXX_REMOTE: staging images: : +# 4 XXX_REMOTE_RELEASE: release images: : +# 5 XXX_REMOTE_RELEASE_ORAN: ORAN release images: : +# 6 XXX_REMOTE_RELEASE_ONAP: ONAP release images: : +# 7 XXX_PROXY: other images, not produced by the project: : + + +# Policy Agent base image and tags +POLICY_AGENT_IMAGE_BASE="o-ran-sc/nonrtric-policy-agent" +POLICY_AGENT_IMAGE_TAG_LOCAL="2.2.0-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="2.2.0-SNAPSHOT" +POLICY_AGENT_IMAGE_TAG_REMOTE="2.2.0" +POLICY_AGENT_IMAGE_TAG_REMOTE_RELEASE="2.2.0" + +# ECS image and tags +ECS_IMAGE_BASE="o-ran-sc/nonrtric-enrichment-coordinator-service" +ECS_IMAGE_TAG_LOCAL="1.1.0-SNAPSHOT" +ECS_IMAGE_TAG_REMOTE_SNAPSHOT="1.1.0-SNAPSHOT" +ECS_IMAGE_TAG_REMOTE="1.1.0" +ECS_IMAGE_TAG_REMOTE_RELEASE="1.1.0" + + +# Control Panel image and tags +CONTROL_PANEL_IMAGE_BASE="o-ran-sc/nonrtric-controlpanel" +CONTROL_PANEL_IMAGE_TAG_LOCAL="2.2.0-SNAPSHOT" +CONTROL_PANEL_IMAGE_TAG_REMOTE_SNAPSHOT="2.2.0-SNAPSHOT" +CONTROL_PANEL_IMAGE_TAG_REMOTE="2.2.0" +CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE="2.2.0" + + +# SDNC A1 Controller image and tags +SDNC_A1_CONTROLLER_IMAGE_BASE="o-ran-sc/nonrtric-a1-controller" +SDNC_A1_CONTROLLER_IMAGE_TAG_LOCAL="2.1.0-SNAPSHOT" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE="2.1.0" +SDNC_A1_CONTROLLER_IMAGE_TAG_REMOTE_RELEASE="2.1.0" + + +#SDNC DB remote image and tag +SDNC_DB_IMAGE_BASE="mysql/mysql-server" +SDNC_DB_IMAGE_TAG_REMOTE_PROXY="5.6" +#No local image for SSDNC DB, remote image always used + + +# RAPP Catalogue image and tags +RAPP_CAT_IMAGE_BASE="o-ran-sc/nonrtric-r-app-catalogue" +RAPP_CAT_IMAGE_TAG_LOCAL="1.1.0-SNAPSHOT" +RAPP_CAT_IMAGE_TAG_REMOTE_SNAPSHOT="1.1.0-SNAPSHOT" +RAPP_CAT_IMAGE_TAG_REMOTE="1.1.0" +RAPP_CAT_IMAGE_TAG_REMOTE_RELEASE="1.1.0" + + +# Near RT RIC Simulator image and tags +RIC_SIM_IMAGE_BASE="o-ran-sc/a1-simulator" +RIC_SIM_IMAGE_TAG_LOCAL="latest" +RIC_SIM_IMAGE_TAG_REMOTE_SNAPSHOT="2.1.0-SNAPSHOT" +RIC_SIM_IMAGE_TAG_REMOTE="2.1.0" +RIC_SIM_IMAGE_TAG_REMOTE_RELEASE="2.1.0" + + +#Consul remote image and tag +CONSUL_IMAGE_BASE="consul" +CONSUL_IMAGE_TAG_REMOTE_PROXY="1.7.2" +#No local image for Consul, remote image always used + + +#CBS remote image and tag +CBS_IMAGE_BASE="onap/org.onap.dcaegen2.platform.configbinding.app-app" +CBS_IMAGE_TAG_REMOTE_RELEASE_ONAP="2.3.0" +#No local image for CBS, remote image always used + + +#MR stub image and tag +MRSTUB_IMAGE_BASE="mrstub" +MRSTUB_IMAGE_TAG_LOCAL="latest" +#No remote image for MR stub, local image always used + + +#Callback receiver image and tag +CR_IMAGE_BASE="callback-receiver" +CR_IMAGE_TAG_LOCAL="latest" +#No remote image for CR, local image always used + + +#Producer stub image and tag +PROD_STUB_IMAGE_BASE="producer-stub" +PROD_STUB_IMAGE_TAG_LOCAL="latest" +#No remote image for producer stub, local image always used + + +# List of app short names produced by the project +PROJECT_IMAGES_APP_NAMES="PA ECS CP SDNC RC RICSIM" + +# List of app short names which images pulled from ORAN +ORAN_IMAGES_APP_NAMES="" # Not used + +# List of app short names which images pulled from ONAP +ONAP_IMAGES_APP_NAMES="CBS" + + +######################################## +# Detailed settings per app +######################################## + +# Common env var for auto-test. Vars used by docker-compose need to be exported +export DOCKER_SIM_NWNAME="nonrtric-docker-net" # Name of docker private network + +export POLICY_AGENT_EXTERNAL_PORT=8081 # Policy Agent container external port (host -> container) +export POLICY_AGENT_INTERNAL_PORT=8081 # Policy Agent container internal port (container -> container) +export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433 # Policy Agent container external secure port (host -> container) +export POLICY_AGENT_INTERNAL_SECURE_PORT=8433 # Policy Agent container internal secure port (container -> container) +export POLICY_AGENT_APIS="V1 V2" # Supported northbound api versions +export PMS_VERSION="V2" # Tested version of northbound API + +export POLICY_AGENT_APP_NAME="policy-agent" # Name for Policy Agent container +POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container +export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container" # Alias name, name used by the control panel + +export ECS_EXTERNAL_PORT=8083 # ECS container external port (host -> container) +export ECS_INTERNAL_PORT=8083 # ECS container internal port (container -> container) +export ECS_EXTERNAL_SECURE_PORT=8434 # ECS container external secure port (host -> container) +export ECS_INTERNAL_SECURE_PORT=8434 # ECS container internal secure port (container -> container) + +export ECS_APP_NAME="ecs" # Name for ECS container +ECS_LOGPATH="/var/log/enrichment-coordinator-service/application.log" # Path the application log in the ECS container +export ECS_APP_NAME_ALIAS="enrichment-service-container" # Alias name, name used by the control panel +export ECS_HOST_MNT_DIR="./mnt" # Mounted dir, relative to compose file, on the host +export ECS_CONTAINER_MNT_DIR="/var/enrichment-coordinator-service" # Mounted dir in the container + +export MR_EXTERNAL_PORT=3905 # MR stub container external port (host -> container) +export MR_INTERNAL_PORT=3905 # MR stub container internal port (container -> container) +export MR_EXTERNAL_SECURE_PORT=3906 # MR stub container external secure port (host -> container) +export MR_INTERNAL_SECURE_PORT=3906 # MR stub container internal secure port (container -> container) +export MR_APP_NAME="message-router" # Name for the MR +export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR +export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE" # Path write messages to MR + +export CR_EXTERNAL_PORT=8090 # Callback receiver container external port (host -> container) +export CR_INTERNAL_PORT=8090 # Callback receiver container internal port (container -> container) +export CR_EXTERNAL_SECURE_PORT=8091 # Callback receiver container external secure port (host -> container) +export CR_INTERNAL_SECURE_PORT=8091 # Callback receiver container internal secure port (container -> container) +export CR_APP_NAME="callback-receiver" # Name for the Callback receiver +export CR_APP_CALLBACK="/callbacks" # Url for callbacks + +export PROD_STUB_EXTERNAL_PORT=8092 # Producer stub container external port (host -> container) +export PROD_STUB_INTERNAL_PORT=8092 # Producer stub container internal port (container -> container) +export PROD_STUB_EXTERNAL_SECURE_PORT=8093 # Producer stub container external secure port (host -> container) +export PROD_STUB_INTERNAL_SECURE_PORT=8093 # Producer stub container internal secure port (container -> container) +export PROD_STUB_APP_NAME="producer-stub" # Name for the Producer stub + +export CONSUL_HOST="consul-server" # Host name of consul +export CONSUL_EXTERNAL_PORT=8500 # Consul container external port (host -> container) +export CONSUL_INTERNAL_PORT=8500 # Consul container internal port (container -> container) +export CONSUL_APP_NAME="polman-consul" # Name for consul container + +export CBS_APP_NAME="polman-cbs" # Name for CBS container +export CBS_EXTERNAL_PORT=10000 # CBS container external port (host -> container) +export CBS_INTERNAL_PORT=10000 # CBS container internal port (container -> container) +export CONFIG_BINDING_SERVICE="config-binding-service" # Host name of CBS + +export RIC_SIM_BASE="g" # Base name of the RIC Simulator container, shall be the group code + # Note, a prefix is added to each container name by the .env file in the 'ric' dir +RIC_SIM_PREFIX="ricsim" # Prefix added to ric container name, added in the .env file in the 'ric' dir + # This prefix can be changed from the command line +export RIC_SIM_INTERNAL_PORT=8085 # RIC Simulator container internal port (container -> container). + # (external ports allocated by docker) +export RIC_SIM_INTERNAL_SECURE_PORT=8185 # RIC Simulator container internal secure port (container -> container). + # (external ports allocated by docker) + +export SDNC_APP_NAME="a1-controller" # Name of the SNDC A1 Controller container +export SDNC_EXTERNAL_PORT=8282 # SNDC A1 Controller container external port (host -> container) +export SDNC_INTERNAL_PORT=8181 # SNDC A1 Controller container internal port (container -> container) +export SDNC_EXTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container external securee port (host -> container) +export SDNC_INTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container internal secure port (container -> container) +export SDNC_DB_APP_NAME="sdnc-db" # Name of the SDNC DB container +export SDNC_A1_TRUSTSTORE_PASSWORD="" # SDNC truststore password +SDNC_USER="admin" # SDNC username +SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" # SNDC PWD +SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:" # Base url path for SNDC API +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) +CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log" # Path the application log in the Control Panel container + + +######################################## +# Setting for common curl-base function +######################################## + +UUID="" # UUID used as prefix to the policy id to simulate a real UUID + # Testscript need to set the UUID otherwise this empty prefix is used + +RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT # Base url to the Agent NB REST interface +RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface +DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT # Base url to the Dmaap adapter, http +DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT # Base url to the Dmaap adapter, https +ADAPTER=$RESTBASE # Adapter holds the address the agent R-APP interface (REST OR DMAAP) + # The values of this var is swiched between the four base url when needed + +ECS_RESTBASE="http://localhost:"$ECS_EXTERNAL_PORT # Base url to the ECS NB REST interface +ECS_RESTBASE_SECURE="https://localhost:"$ECS_EXTERNAL_SECURE_PORT # Base url to the secure ECS NB REST interface +ECS_DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT # Base url to the Dmaap adapter, http +ECS_DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT # Base url to the Dmaap adapter, https +ECS_ADAPTER=$ECS_RESTBASE # Adapter holds the address the ECS R-APP interface (REST OR DMAAP) + # The values of this var is swiched between the four base url when needed + +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 + +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 diff --git a/test/common/test_env.sh b/test/common/test_env.sh index 293e993a..a8e618fe 100644 --- a/test/common/test_env.sh +++ b/test/common/test_env.sh @@ -25,24 +25,24 @@ # Local Policy Agent image and tag POLICY_AGENT_LOCAL_IMAGE="o-ran-sc/nonrtric-policy-agent" -POLICY_AGENT_LOCAL_IMAGE_TAG="2.1.0-SNAPSHOT" +POLICY_AGENT_LOCAL_IMAGE_TAG="2.2.0-SNAPSHOT" # Remote Policy Agent image and tag POLICY_AGENT_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent" -POLICY_AGENT_REMOTE_IMAGE_TAG="2.1.0" +POLICY_AGENT_REMOTE_IMAGE_TAG="2.2.0" # Local ECS image and tag ECS_LOCAL_IMAGE="o-ran-sc/nonrtric-enrichment-coordinator-service" -ECS_LOCAL_IMAGE_TAG="1.0.0-SNAPSHOT" +ECS_LOCAL_IMAGE_TAG="1.1.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_TAG="1.1.0-SNAPSHOT" # Control Panel local image and tag CONTROL_PANEL_LOCAL_IMAGE="o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_LOCAL_IMAGE_TAG="2.0.0-SNAPSHOT" +CONTROL_PANEL_LOCAL_IMAGE_TAG="2.2.0-SNAPSHOT" # Control Panel remote image and tag CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_REMOTE_IMAGE_TAG="2.0.0" +CONTROL_PANEL_REMOTE_IMAGE_TAG="2.2.0" # SDNC A1 Controller local image and tag diff --git a/test/common/testcase_common.sh b/test/common/testcase_common.sh index f2783f39..cef81887 100755 --- a/test/common/testcase_common.sh +++ b/test/common/testcase_common.sh @@ -17,8 +17,44 @@ # ============LICENSE_END================================================= # -# This is a script that contains all the functions needed for auto test -# Arg: local|remote|remote-remove [auto-clean] [--stop-at-error] [--ricsim-prefix ] [ --env-file ] [--use-local-image []*] +# This is a script that contains all the common functions needed for auto test. +# Specific test function are defined in scripts XXXX_functions.sh + + +# List of short names for all supported apps, including simulators etc +APP_SHORT_NAMES="PA RICSIM SDNC CP ECS RC CBS CONSUL RC MRSTUB CR PRODSTUB" + +__print_args() { + echo "Args: remote|remote-remove --env-file [release] [auto-clean] [--stop-at-error] " + echo " [--ricsim-prefix ] [--use-local-image +] [--use-snapshot-image +]" + echo " [--use-staging-image +] [--use-release-image +]" +} + +if [ $# -eq 1 ] && [ "$1" == "help" ]; then + + if [ ! -z "$TC_ONELINE_DESCR" ]; then + echo "Test script description:" + echo $TC_ONELINE_DESCR + echo "" + fi + __print_args + echo "" + echo "remote - Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags" + echo "remote-remove - Same as 'remote' but will also try to pull fresh images from remote repositories" + echo "--env-file - The script will use the supplied file to read environment variables from" + echo "release - If this flag is given the script will use release version of the images" + echo "auto-clean - If the function 'auto_clean_containers' is present in the end of the test script then all containers will be stopped and removed. If 'auto-clean' is not given then the function has no effect." + echo "--stop-at-error - The script will stop when the first failed test or configuration" + echo "--ricsim-prefix - The a1 simulator will use the supplied string as container prefix instead of 'ricsim'" + echo "--use-local-image - The script will use local images for the supplied apps, space separated list of app short names" + echo "--use-snapshot-image - The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names" + echo "--use-staging-image - The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names" + echo "--use-release-image - The script will use images from the nexus release repo for the supplied apps, space separated list of app short names" + echo "" + echo "List of app short names supported: "$APP_SHORT_NAMES + exit 0 +fi + # Create a test case id, ATC (Auto Test Case), from the name of the test case script. @@ -80,15 +116,29 @@ AGENT_STAND_ALONE=0 # Var to hold 'auto' in case containers shall be stopped when test case ends AUTO_CLEAN="" -# Var to hold the app names to use local image for when running 'remote' or 'remote-remove' +# Var to hold the app names to use local images for USE_LOCAL_IMAGES="" -# List of available apps to override with local image -AVAILABLE_LOCAL_IMAGES_OVERRIDE="PA ECS CP SDNC RICSIM RC" +# Var to hold the app names to use remote snapshot images for +USE_SNAPSHOT_IMAGES="" + +# Var to hold the app names to use remote staging images for +USE_STAGING_IMAGES="" + +# Var to hold the app names to use remote release images for +USE_RELEASE_IMAGES="" + +# List of available apps to override with local or remote staging/snapshot/release image +AVAILABLE_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 +# The default value "DEV" indicate that development image tags (SNAPSHOT) and nexus repos (nexus port 10002) are used. +# The value "RELEASE" indicate that relase image tag and nexus repos (nexus port) are used +# Applies only to images defined in the test-env files with image names and tags defined as XXXX_RELEASE +IMAGE_CATEGORY="DEV" + # Function to indent cmd output with one space indent1() { sed 's/^/ /'; } @@ -265,12 +315,16 @@ echo "----------------------------------- Test case setup ------------ START_ARG=$1 paramerror=0 +paramerror_str="" if [ $# -lt 1 ]; then paramerror=1 fi if [ $paramerror -eq 0 ]; then - if [ "$1" != "remote" ] && [ "$1" != "remote-remove" ] && [ "$1" != "local" ]; then + if [ "$1" != "remote" ] && [ "$1" != "remote-remove" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="First arg shall be 'remote' or 'remote-remove'" + fi else shift; fi @@ -278,6 +332,14 @@ fi foundparm=0 while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do foundparm=1 + if [ $paramerror -eq 0 ]; then + if [ "$1" == "release" ]; then + IMAGE_CATEGORY="RELEASE" + echo "Option set - Release image tags used for applicable images " + shift; + foundparm=0 + fi + fi if [ $paramerror -eq 0 ]; then if [ "$1" == "auto-clean" ]; then AUTO_CLEAN="auto" @@ -300,6 +362,9 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do RIC_SIM_PREFIX=$1 if [ -z "$1" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No prefix found for flag: '--ricsim-prefix'" + fi else echo "Option set - Overriding RIC_SIM_PREFIX with: "$1 shift; @@ -313,6 +378,9 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do TEST_ENV_VAR_FILE=$1 if [ -z "$1" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No env file found for flag: '--env-file'" + fi else echo "Option set - Reading test env from: "$1 shift; @@ -326,16 +394,97 @@ while [ $paramerror -eq 0 ] && [ $foundparm -eq 0 ]; do shift while [ $# -gt 0 ] && [[ "$1" != "--"* ]]; do USE_LOCAL_IMAGES=$USE_LOCAL_IMAGES" "$1 - if [[ "$AVAILABLE_LOCAL_IMAGES_OVERRIDE" != *"$1"* ]]; then + if [[ "$AVAILABLE_IMAGES_OVERRIDE" != *"$1"* ]]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="App name $1 is not available for local override for flag: '--use-local-image'" + fi fi shift; done foundparm=0 if [ -z "$USE_LOCAL_IMAGES" ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No app name found for flag: '--use-local-image'" + fi + else + echo "Option set - Overriding with local images for app(s):"$USE_LOCAL_IMAGES + fi + fi + fi + if [ $paramerror -eq 0 ]; then + if [ "$1" == "--use-snapshot-image" ]; then + USE_SNAPSHOT_IMAGES="" + shift + while [ $# -gt 0 ] && [[ "$1" != "--"* ]]; do + USE_SNAPSHOT_IMAGES=$USE_SNAPSHOT_IMAGES" "$1 + if [[ "$AVAILABLE_IMAGES_OVERRIDE" != *"$1"* ]]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="App name $1 is not available for snapshot override for flag: '--use-snapshot-image'" + fi + fi + shift; + done + foundparm=0 + if [ -z "$USE_SNAPSHOT_IMAGES" ]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No app name found for flag: '--use-snapshot-image'" + fi else - echo "Option set - Override remote images for app(s):"$USE_LOCAL_IMAGES + echo "Option set - Overriding with snapshot images for app(s):"$USE_SNAPSHOT_IMAGES + fi + fi + fi + if [ $paramerror -eq 0 ]; then + if [ "$1" == "--use-staging-image" ]; then + USE_STAGING_IMAGES="" + shift + while [ $# -gt 0 ] && [[ "$1" != "--"* ]]; do + USE_STAGING_IMAGES=$USE_STAGING_IMAGES" "$1 + if [[ "$AVAILABLE_IMAGES_OVERRIDE" != *"$1"* ]]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="App name $1 is not available for staging override for flag: '--use-staging-image'" + fi + fi + shift; + done + foundparm=0 + if [ -z "$USE_STAGING_IMAGES" ]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No app name found for flag: '--use-staging-image'" + fi + else + echo "Option set - Overriding with staging images for app(s):"$USE_STAGING_IMAGES + fi + fi + fi + if [ $paramerror -eq 0 ]; then + if [ "$1" == "--use-release-image" ]; then + USE_RELEASE_IMAGES="" + shift + while [ $# -gt 0 ] && [[ "$1" != "--"* ]]; do + USE_RELEASE_IMAGES=$USE_RELEASE_IMAGES" "$1 + if [[ "$AVAILABLE_IMAGES_OVERRIDE" != *"$1"* ]]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="App name $1 is not available for release override for flag: '--use-release-image'" + fi + fi + shift; + done + foundparm=0 + if [ -z "$USE_RELEASE_IMAGES" ]; then + paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="No app name found for flag: '--use-release-image'" + fi + else + echo "Option set - Overriding with release images for app(s):"$USE_RELEASE_IMAGES fi fi fi @@ -345,10 +494,14 @@ echo "" #Still params left? if [ $paramerror -eq 0 ] && [ $# -gt 0 ]; then paramerror=1 + if [ -z "$paramerror_str" ]; then + paramerror_str="Unknown parameter(s): "$@ + fi fi if [ $paramerror -eq 1 ]; then - echo -e $RED"Expected arg: local|remote|remote-remove [auto-clean] [--stop-at-error] [--ricsim-prefix ] [ --env-file ] [--use-local-image []*]"$ERED + echo -e $RED"Incorrect arg list: "$paramerror_str$ERED + __print_args exit 1 fi @@ -358,12 +511,13 @@ if [ -f "$TEST_ENV_VAR_FILE" ]; then . $TEST_ENV_VAR_FILE if [ -z "$TEST_ENV_PROFILE" ] || [ -z "$SUPPORTED_PROFILES" ]; then - echo -e $YELLOW"This test case may no work with selected test env file. TEST_ENV_PROFILE is missing in test_env file or SUPPORTED_PROFILES is missing in test case file"$EYELLOW + echo -e $YELLOW"This test case may not work with selected test env file. TEST_ENV_PROFILE is missing in test_env file or SUPPORTED_PROFILES is missing in test case file"$EYELLOW else if [[ "$SUPPORTED_PROFILES" == *"$TEST_ENV_PROFILE"* ]]; then echo -e $GREEN"Test case support the selected test env file"$EGREEN else echo -e $RED"Test case does not support the selected test env file"$ERED + echo "Profile: "$TEST_ENV_PROFILE" Supported profiles: "$SUPPORTED_PROFILES echo -e $RED"Exiting...."$ERED exit 1 fi @@ -376,6 +530,12 @@ else exit 1 fi +if [ -z "$PROJECT_IMAGES_APP_NAMES" ]; then + echo -e $RED"Var PROJECT_IMAGES_APP_NAMES must be defined in: "$TEST_ENV_VAR_FILE$ERED$ERED + exit 1 +fi + + #Vars for A1 interface version and container count G1_A1_VERSION="" G2_A1_VERSION="" @@ -422,13 +582,13 @@ echo -e $BOLD"Checking configured image setting for this test case"$EBOLD IMAGE_ERR=0 #Create a file with image info for later printing as a table image_list_file="./tmp/.image-list" -echo -e " Container\tImage\ttag" > $image_list_file +echo -e " Container\tImage\ttag\ttag-switch" > $image_list_file # Check if image env var is set and if so export the env var with image to use (used by docker compose files) -# arg: