README and function documentation updates 18/5518/1
authorBjornMagnussonXA <bjorn.magnusson@est.tech>
Wed, 27 Jan 2021 10:48:56 +0000 (11:48 +0100)
committerBjornMagnussonXA <bjorn.magnusson@est.tech>
Wed, 27 Jan 2021 13:02:44 +0000 (14:02 +0100)
Issue-ID: NONRTRIC-359

Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I84e59f4d204e83de013e5dc7ed5319c28817f117

test/auto-test/README.md
test/common/README.md
test/common/agent_api_functions.sh
test/common/ecs_api_functions.sh
test/common/test_env-onap-guilin.sh
test/common/testcase_common.sh

index 005ee0a..478dd31 100644 (file)
@@ -6,8 +6,8 @@ A few of the bash scripts are so called 'suites', These suite scripts calls a se
 There are two types of scripts, filenames in the format FTCXXX.sh test one or more components of the Non-RT RIC. Filenames in the format SuiteZZZZ.sh tests a number of FTCXXX.sh script as one suite. (XXX is an integer selected from the categories described further below).
 FTC is short for Function Test Case. In addition, there are also other test scripts with other naming format used for demo setup etc (e.g PM_DEMO.sh).
 
-The requirements, in terms of the execution enviroment, to run a script or a suite is to have docker, docker-compose and python3 installed (the scripts warns if not installed).
-The scripts have been tested to work on both MacOS and Ubuntu. They should work also in git bash on windows but not yet verified.
+The requirements, in terms of the execution enviroment, to run a script or a suite is to have docker, docker-compose and python3 installed (the scripts warns if not installed). As an option, the scripts can also be executed in a Minikube installation. However, this feature is still experimental. The additional requirement is to have a clean minikube installation, perferably with the kube dashboard installed in the minikube.
+The scripts have been tested to work on both MacOS and Ubuntu using docker. They should work also in git-bash on windows (for docker) but not yet verified. Running using minikube has only been verified on Ubuntu.
 
 ## Configuration
 The test scripts uses configuration from a single file, found in `../common/test_env.sh`, which contains all needed configuration in terms of image names, image tags, ports, file paths, passwords etc. This file can be modified if needed.  See the README.md in  `../common/` for all details of the config file.
@@ -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.sh
+ ./FTC1.sh remote docker --env-file ../common/test_env-oran-cherry.sh
 
 See the README.md in  `../common/` for all details about available parameters and their meaning.
 
@@ -53,10 +53,15 @@ It is strongly suggested to look at the existing test scripts, it is probably ea
 
 TC_ONELINE_DESCR="<test case description>"
 
-INCLUDED_IMAGES=<list of used app in this test case>
+DOCKER_INCLUDED_IMAGES=<list of used apps in this test case - for docker>
+
+KUBE_INCLUDED_IMAGES=<list of used apps (started by the script) in this test case - for kube>
+KUBE_PRESTARTED_IMAGES=<list of used apps (prestartedd - i.e. not started by the script) in this test case - for kube>
 
 SUPPORTED_PROFILES=<list of supported profile names>
 
+SUPPORTED_RUNMODES=<List of runmodes, DOCKER and/or KUBE>
+
 . ../common/testcase_common.sh  $@
 < other scripts need to be sourced for specific interfaces>
 
index b4754cd..2422eb9 100644 (file)
@@ -1,47 +1,36 @@
 # Introduction #
-This dir contains most scripts needed for the auto-test environment. There are scripts with functions to adapt to the apis of the components of the Non-RT RIC; Policy Agent, A1 Controller and Ric (A1) simulator.
+This dir contains most scripts needed for the auto-test environment. There are scripts with functions to adapt to the apis of the components of the Non-RT RIC; Policy Agent, A1 Controller and Ric (A1) simulator. The test environment supports both test with docker and kubernetes(still experimental)
 Some of the scripts can also be used for other kinds of tests, for example basic tests.
 
 ## Overview for common test scripts and files ##
 
-`test_env*.sh` \
-Common env variables for test in the auto-test dir. All configuration of port numbers, image names and version etc shall be made in this file.
-Used by the auto test scripts/suites but could be used for other test script as well. The test cases shall be started with the file for the intended target using command line argument '--env-file'. There are preconfigured env files, pattern 'test_env*.sh', in ../common.
-
-`testcase_common.sh` \
-Common functions for auto test cases in the auto-test dir. This script is the foundation of test auto environment which sets up images and enviroment variables needed by this script as well as the script adapting to the APIs.
-The included functions are described in detail further below.
-
-`testsuite_common.sh` \
-Common functions for running two or more auto test scripts as a suite.
+`agent_api_functions.sh` \
+Contains functions for adapting towards the Policy Management Service (PMS) API, also via dmaap (using a message-router stub interface)
 
 `api_curl.sh` \
 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)
-
-`ecs_api_functions.sh` \
-Contains functions for adapting towards the ECS API
-
-`controller_api_functions.sh` \
-Contains functions for adaping towards the A1-controller API.
+`clean-kube.sh` \
+Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
 
-`ricsimulator_api_functions.sh` \
-Contains functions for adapting towards the RIC (A1) simulator admin API.
+`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'.
 
-`prodstub_api_functions.sh` \
-Contains functions for adapting towards the Producer stub interface - simulates a producer.
+`consult_cbs_function.sh` \
+Contains functions for managing Consul and CBS as well as create the configuration for the PMS.
 
-`rapp_catalogue_api_functions.sh` \
-Contains functions for adapting towards the RAPP Catalogue.
+`control_panel_api_function.sh` \
+Contains functions for managing Control Panel.
 
-`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'.
+`controller_api_functions.sh` \
+Contains functions for adaping towards the A1-controller API.
 
 `count_json_elements.py` \
 A python script returning the number of items in a json array.
 
+`cr_api_functions.sh` \
+Contains functions for adapting towards the Callback receiver for checking received callback event.
+
 `create_policies_process.py` \
 A python script to create a batch of policies. The script is intended to run in a number of processes to create policies in parallel.
 
@@ -51,15 +40,40 @@ A python script to create a json file from a formatted string of ric info. Helpe
 `delete_policies_process.py` \
 A python script to delete a batch of policies. The script is intended to run in a number of processes to delete policies in parallel.
 
+`do_curl_function.sh`
+A script for executing a curl call with a specific url and optional payload. It also compare the response with an expected result in terms of response code and optional returned payload. Intended to be used by test script (for example basic test scripts of other components)
+
+`ecs_api_functions.sh` \
+Contains functions for adapting towards the ECS API
+
 `extract_sdnc_reply.py` \
 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
 
-`do_curl_function.sh`
-A script for executing a curl call with a specific url and optional payload. It also compare the response with an expected result in terms of response code and optional returned payload. Intended to be used by test script (for example basic test scripts of other components)
+`http_proxy_api_functions.sh` \
+Contains functions for managing the Http Proxy
 
-`cr_api_functions.sh` \
-Contains functions for adapting towards the Callback receiver for checking received callback event.
+`mr_api_functions.sh` \
+Contains functions for managing the MR Stub and the Dmaap Message Router
 
+`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.
+
+`ricsimulator_api_functions.sh` \
+Contains functions for adapting towards the RIC (A1) simulator admin API.
+
+`test_env*.sh` \
+Common env variables for test in the auto-test dir. All configuration of port numbers, image names and version etc shall be made in this file.
+Used by the auto test scripts/suites but could be used for other test script as well. The test cases shall be started with the file for the intended target using command line argument '--env-file'. There are preconfigured env files, pattern 'test_env*.sh', in ../common.
+
+`testcase_common.sh` \
+Common functions for auto test cases in the auto-test dir. This script is the foundation of test auto environment which sets up images and enviroment variables needed by this script as well as the script adapting to the APIs.
+The included functions are described in detail further below.
+
+`testsuite_common.sh` \
+Common functions for running two or more auto test scripts as a suite.
 
 # Description of functions in testcase_common.sh #
 
@@ -68,12 +82,14 @@ The script can be started with these arguments
 
 | arg list |
 |--|
-| `remote|remote-remove --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+]  [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+]` |
+| `remote|remote-remove docker|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+]  [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+]` |
 
 | parameter | description |
 |-|-|
 | `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 |
+| `docker` | Use docker environment for test |
+| `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
 | `--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 |
@@ -85,6 +101,17 @@ The script can be started with these arguments
 | `--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: indent1 ##
+Indent every line of a command output with one space char.
+| arg list |
+|--|
+| None |
+
+## Function: indent2 ##
+Indent every line of a command output with two space chars.
+| arg list |
+|--|
+| None |
 
 ## Function: print_result ##
 Print a test report of an auto-test script.
@@ -128,14 +155,24 @@ Mark a test as a deviation from the requirements. The list of deviations will be
 | --------- | ----------- |
 | `<deviation-message-to-print>` | Any text message describing the deviation. The text will also be printed in the test report. The intention is to mark known deviations, compared to required functionality |
 
-## Function: clean_containers ##
-Stop and remove all containers. Containers not part of the test are not affected.
+## Function: get_kube_sim_host ##
+Translate ric name to kube host name.
+| arg list |
+|--|
+| `<ric-name>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<ric-name>` | The name of the ric to translate into a host name (ip) |
+
+## Function: clean_environment ##
+Stop and remove all containers (docker) or resources (kubernetes). Containers not part of the test are not affected (docker only). Removes all resources started by previous kube tests (kube only).
 | arg list |
 |--|
 | None |
 
 ## Function: auto_clean_containers ##
-Stop and remove all containers. Containers not part of the test are not affected. This function has effect only if the test script is started with arg `auto-clean`. This intention is to use this function as the last step in an auto-test script.
+Same function as 'clean_environment'. This function has effect only if the test script is started with arg `auto-clean`. This intention is to use this function as the last step in an auto-test script.
 | arg list |
 |--|
 | None |
@@ -158,148 +195,60 @@ UUID is then automatically added to the policy id in GET/PUT/DELETE.
 |--|
 | None |
 
-## Function: consul_config_app ##
-Function to load a json config from a file into consul for the Policy Agent
-
-| arg list |
-|--|
-| `<json-config-file>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
-
-## Function: prepare_consul_config ##
-Function to prepare a Consul config based on the previously configured (and started simulators). Note that all simulator must be running and the test script has to configure if http or https shall be used for the components (this is done by the functions 'use_simulator_http', 'use_simulator_https', 'use_sdnc_http', 'use_sdnc_https', 'use_mr_http', 'use_mr_https')
+## Function: check_policy_agent_logs ##
+Check the Policy Agent log for any warnings and errors and print the count of each.
 | arg list |
 |--|
-| `<deviation-message-to-print>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `SDNC|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
-| `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app'  |
+| None |
 
-## Function: start_consul_cbs ##
-Start the Consul and CBS containers
+## Function: check_ecs_logs ##
+Check the ECS log for any warnings and errors and print the count of each.
 | arg list |
 |--|
 | None |
 
-## Function: use_simulator_http ##
-Use http for all API calls (A1) toward the simulator. This is the default. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
+## Function: check_control_panel_logs ##
+Check the Control Panel log for any warnings and errors and print the count of each.
 | arg list |
 |--|
 | None |
 
-## Function: use_simulator_https ##
-Use https for all API calls (A1) toward the simulator. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
+## Function: check_sdnc_logs ##
+Check the SDNC log for any warnings and errors and print the count of each.
 | arg list |
 |--|
 | None |
 
-## Function: start_ric_simulators ##
-Start a group of simulator where a group may contain 1 more simulators.
+## Function: store_logs ##
+Take a snap-shot of all logs for all running containers and stores them in `./logs/<ATC-id>`. All logs will get the specified prefix in the file name. In general, one of the last steps in an auto-test script shall be to call this function. If logs shall be taken several times during a test script, different prefixes shall be used each time.
 | arg list |
 |--|
-| `ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>` |
+| `<logfile-prefix>` |
 
 | parameter | description |
 | --------- | ----------- |
-| `ricsim_g1|ricsim_g2|ricsim_g3` | Base name of the simulator. Each instance will have an postfix instance id added, starting on '1'. For examplle 'ricsim_g1_1', 'ricsim_g1_2' etc  |
-|`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
-|`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
-
-## Function: start_control_panel ##
-Start the Control Panel container
-| arg list |
-|--|
-| None |
-
-## Function: start_sdnc ##
-Start the SDNC A1 Controller container and its database container
-| arg list |
-|--|
-| None |
-
-## Function: use_sdnc_http ##
-Use http for all API calls towards the SDNC A1 Controller. This is the default. Note that this function shall be called before preparing the config for Consul.
-| arg list |
-|--|
-| None |
-
-## Function: use_sdnc_http ##
-Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
-| arg list |
-|--|
-| None |
-
-## Function: start_mr ##
-Start the Message Router stub interface container
-| arg list |
-|--|
-| None |
-
-## Function: use_mr_http ##
-Use http for all Dmaap calls to the MR. This is the default. The admin API is not affected. Note that this function shall be called before preparing the config for Consul.
-| arg list |
-|--|
-| None |
-
-## Function: use_mr_https ##
-Use https for all Dmaap call to the MR. The admin API is not affected. Note that this function shall be called before preparing the config for Consul.
-| arg list |
-|--|
-| None |
-
-## Function: start_cr ##
-Start the Callback Receiver container
-| arg list |
-|--|
-| None |
-
-## Function: use_cr_http ##
-Use http for getting event from CR.  The admin API is not affected. This is the default.
-| arg list |
-|--|
-| None |
+| `<logfile-prefix>` | Log file prefix  |
 
-## Function: use_cr_https ##
-Use https for getting event from CR. The admin API is not affected.
-Note: Not yet used as callback event is not fully implemented/deciced.
-| arg list |
-|--|
-| None |
 
-## Function: start_prod_stub ##
-Start the Producer stubb container
-| arg list |
-|--|
-| None |
+# Description of functions in testsuite_common.sh #
 
-## Function: use_prod_stub_http ##
-Use http for the API.  The admin API is not affected. This is the default protocol.
+## Function: suite_setup ##
+Sets up the test suite and prints out a heading.
 | arg list |
 |--|
 | None |
 
-## Function: use_prod_stub_https ##
-Use https for the API. The admin API is not affected.
+## suite_complete ##
+Print out the overall result of the executed test cases.
 | arg list |
 |--|
 | None |
 
-## Function: start_policy_agent ##
-Start the Policy Agent container. If the test script is configured to use a stand alone Policy Agent (for example other container or stand alone app) the script will prompt for starting the stand alone Policy Agent.
-| arg list |
-|--|
-| None |
+# Description of functions in agent_api_functions.sh #
 
-## Function: use_agent_stand_alone ##
-Configure to run the Policy Agent as a stand alone container or app. See also 'start_policy_agent'
-| arg list |
-|--|
-| None |
+## General ##
+Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
+For api function in version 2, an url prefix is added if configured.
 
 ## Function: use_agent_rest_http ##
 Use http for all API calls to the Policy Agent. This is the default.
@@ -325,193 +274,44 @@ Send and recieve all API calls to the Policy Agent over Dmaap via the MR over ht
 |--|
 | None |
 
-## Function: set_agent_debug ##
-Configure the Policy Agent log on debug level. The Policy Agent must be running.
-| arg list |
-|--|
-| None |
-
-## Function: set_agent_trace ##
-Configure the Policy Agent log on trace level. The Policy Agent must be running.
-| arg list |
-|--|
-| None |
-
-## Function: use_agent_retries ##
-Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
-| arg list |
-|--|
-| `[<response-code>]*` |
-
-| parameter | description |
-| --------- | ----------- |
-| `[<response-code>]*` | A space separated list of http response codes, may be empty to reset to 'no codes'.  |
-
-## Function: start_ecs ##
-Start the ECS container.
-| arg list |
-|--|
-| None |
-
-## Function: restart_ecs ##
-Restart the ECS container.
-| arg list |
-|--|
-| None |
-
-## Function: use_ecs_rest_http ##
-Use http for all API calls to the ECS. This is the default protocol.
-| arg list |
-|--|
-| None |
-
-## Function: use_ecs_rest_https ##
-Use https for all API calls to the ECS.
-| arg list |
-|--|
-| None |
-
-## Function: use_ecs_dmaap_http ##
-Send and recieve all API calls to the ECS over Dmaap via the MR using http.
-| arg list |
-|--|
-| None |
-
-## Function: use_ecs_dmaap_https ##
-Send and recieve all API calls to the ECS over Dmaap via the MR using https.
-| arg list |
-|--|
-| None |
-
-## Function: set_ecs_debug ##
-Configure the ECS log on debug level. The ECS must be running.
-| arg list |
-|--|
-| None |
-
-## Function: set_ecs_trace ##
-Configure the ECS log on trace level. The ECS must be running.
-| arg list |
-|--|
-| None |
-
-## Function: check_policy_agent_logs ##
-Check the Policy Agent log for any warnings and errors and print the count of each.
-| arg list |
-|--|
-| None |
-
-## Function: check_ecs_logs ##
-Check the ECS log for any warnings and errors and print the count of each.
-| arg list |
-|--|
-| None |
-
-## Function: check_control_panel_logs ##
-Check the Control Panel log for any warnings and errors and print the count of each.
-| arg list |
-|--|
-| None |
-
-## Function: check_sdnc_logs ##
-Check the SDNC log for any warnings and errors and print the count of each.
-| arg list |
-|--|
-| None |
-
-## Function: store_logs ##
-Take a snap-shot of all logs for all running containers and stores them in `./logs/<ATC-id>`. All logs will get the specified prefix in the file name. In general, one of the last steps in an auto-test script shall be to call this function. If logs shall be taken several times during a test script, different prefixes shall be used each time.
+## Function: start_policy_agent ##
+Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
 | arg list |
-|--|
 | `<logfile-prefix>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<logfile-prefix>` | Log file prefix  |
-
-
-## Function: mr_equal ##
-Tests if a variable value in the Message Router (MR) 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.
-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 'mrstub' dir for more details.
-| arg list |
-|--|
-| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<variable-name>` | Variable name in the MR  |
-| `<target-value>` | Target value for the variable  |
-| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
-
-## Function: mr_greater ##
-Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
-Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than 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 greater than the target value or not.
-See the 'mrstub' dir for more details.
-| arg list |
-|--|
-| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
-
+| (docker) `PROXY|NOPROXY <config-file>` |
+| (kube) `PROXY|NOPROXY <config-file> [ <data-file> ]` |
 | parameter | description |
 | --------- | ----------- |
-| `<variable-name>` | Variable name in the MR  |
-| `<target-value>` | Target value for the variable  |
-| `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
+| `PROXY` | Configure with http proxy, if proxy is started  |
+| `NOPROXY` | Configure without http proxy  |
+| <config-file>` | Path to application.yaml  |
+|  <data-file>` | Optional path to application_configuration.json  |
 
-## Function: mr_read ##
-Reads the value of a variable in the Message Router (MR) simulator. The value is intended to be passed to a env variable in the test script.
-See the 'mrstub' dir for more details.
+## Function: agent_load_config ##
+Load the config into a config map (kubernetes only).
 | arg list |
-|--|
-| `<variable-name>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<variable-name>` | Variable name in the MR  |
-
-## Function: mr_print ##
-Prints the value of a variable in the Message Router (MR) simulator.
-See the 'mrstub' dir for more details.
-| arg list |
-|--|
-| `<variable-name>` |
-
+|  <data-file> ]` |
 | parameter | description |
 | --------- | ----------- |
-| `<variable-name>` | Variable name in the MR  |
-
-## Function: indent1 ##
-Indent every line of a command output with one space char.
-| arg list |
-|--|
-| None |
+|  <data-file>` | Path to application_configuration.json  |
 
-## Function: indent2 ##
-Indent every line of a command output with two space chars.
+## Function: set_agent_debug ##
+Configure the Policy Agent log on debug level. The Policy Agent must be running.
 | arg list |
 |--|
 | None |
 
-# Description of functions in testsuite_common.sh #
-
-## Function: suite_setup ##
-Sets up the test suite and prints out a heading.
+## Function: set_agent_trace ##
+Configure the Policy Agent log on trace level. The Policy Agent must be running.
 | arg list |
 |--|
 | None |
 
-## suite_complete ##
-Print out the overall result of the executed test cases.
+## Function: use_agent_retries ##
+Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
 | arg list |
 |--|
-| None |
-
-# Description of functions in agent_api_function.sh #
-
-## General ##
-Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
+| `[<response-code>]*` |
 
 ## Function: api_equal() ##
 
@@ -922,139 +722,83 @@ Test of GET '/v2/configuration'
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
 | `<config-file>` |  Path json config file to compare the retrieved config with |
-
-# Description of functions in ricsimulator_api_functions.sh #
-The functions below only use the admin interface of the simulator, no usage of the A1 interface.
-
-## Function: sim_equal ##
-Tests if a variable value in the RIC 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.
-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 'a1-interface' repo for more details.
-
-| arg list |
-|--|
-| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<variable-name>` | Variable name in the ric simulator  |
-| `<target-value>` | Target value for the variable  |
-| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
-
-## Function: sim_print ##
-Prints the value of a variable in the RIC simulator.
-See the 'a1-interface' repo for more details.
-
-| arg list |
-|--|
-| `<variable-name>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<variable-name>` | Variable name in the RIC simulator  |
-
-
-## Function: sim_contains_str ##
-Tests if a variable value in the RIC simulator contains a target string.
-Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
-With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value contains the target string or not.
-See the 'a1-interface' repo for more details.
-
-| arg list |
-|--|
-| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<variable-name>` | Variable name in the ric simulator  |
-| `<target-value>` | Target substring for the variable  |
-| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
-
-## Function: sim_put_policy_type ##
-Loads a policy type to the simulator
-
-| arg list |
-|--|
-| `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
-| `<policy-type-id>` |  Id of the policy type |
-| `<policy-type-file>` |  Path to the schema file of the policy type |
-
-## Function: sim_delete_policy_type ##
-Deletes a policy type from the simulator
-
-| arg list |
-|--|
-| `<response-code> <ric-id> <policy_type_id>` |
-
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
-| `<policy-type-id>` |  Id of the policy type |
-
-## Function: sim_post_delete_instances ##
-Deletes all instances (and status), for one ric
+| `[<response-code>]*` | A space separated list of http response codes, may be empty to reset to 'no codes'.  |
 
-| arg list |
-|--|
-| `<response-code> <ric-id>` |
 
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
+# Description of functions in consult_cbs_function.sh #
 
 
-## Function: sim_post_delete_all ##
-Deletes all types, instances (and status), for one ric
+## Function: consul_config_app ##
+Function to load a json config from a file into consul for the Policy Agent
 
 | arg list |
 |--|
-| `<response-code> <ric-id>` |
+| `<json-config-file>` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
-
-## Function: sim_post_forcedresponse ##
-Sets (or resets) response code for next (one) A1 message, for one ric.
-The intention is to simulate error response on the A1 interface.
+| `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
 
+## Function: prepare_consul_config ##
+Function to prepare a Consul config based on the previously configured (and started simulators). Note that all simulator must be running and the test script has to configure if http or https shall be used for the components (this is done by the functions 'use_simulator_http', 'use_simulator_https', 'use_sdnc_http', 'use_sdnc_https', 'use_mr_http', 'use_mr_https')
 | arg list |
 |--|
-| `<response-code> <ric-id> [<forced_response_code>]`|
+| `<deviation-message-to-print>` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
-| `<forced_response_code>` |  Http response code to send |
+| `SDNC|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
+| `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app'  |
 
-## Function: sim_post_forcedelay ##
-Sets (or resets) A1 response delay, for one ric
-The intention is to delay responses on the A1 interface. Setting remains until removed.
+## Function: start_consul_cbs ##
+Start the Consul and CBS containers
+| arg list |
+|--|
+| None |
+
+# Description of functions in control_panel_api_function.sh #
 
+## Function: use_control_panel_http ##
+Set http as the protocol to use for all communication to the Control Panel
 | arg list |
 |--|
-| `<response-code> <ric-id> [<delay-in-seconds>]`|
+| None |
 
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
-| `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
+## Function: use_control_panel_https ##
+Set https as the protocol to use for all communication to the Control Panel
+| arg list |
+|--|
+| None |
 
+## Function: start_control_panel ##
+Start the Control Panel container
+| arg list |
+|--|
+| None |
 
 # Description of functions in controller_api_functions.sh #
 The file contains a selection of the possible API tests towards the a1-controller
 
+## Function: use_sdnc_http ##
+Use http for all API calls towards the SDNC A1 Controller. This is the default. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: use_sdnc_http ##
+Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: start_sdnc ##
+Start the SDNC A1 Controller container and its database container
+| arg list |
+|--|
+| None |
+
 ## Function: controller_api_get_A1_policy_ids ##
 Test of GET policy ids towards OSC or STD type simulator.
 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
@@ -1144,7 +888,105 @@ Checks the status of a policy
 | `<has-been-deleted>` |  Deleted status, true or false |
 
 
+# Description of functions in cr_api_functions.sh #
+
+## Function: use_cr_http ##
+Use http for getting event from CR.  The admin API is not affected. This is the default.
+| arg list |
+|--|
+| None |
+
+## Function: use_cr_https ##
+Use https for getting event from CR. The admin API is not affected.
+Note: Not yet used as callback event is not fully implemented/deciced.
+| arg list |
+|--|
+| None |
+
+## Function: start_cr ##
+Start the Callback Receiver container in docker or kube depending on start mode.
+| arg list |
+|--|
+| None |
+
+## 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.
+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 CR  |
+| `<target-value>` | Target value for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
+
+## Function: cr_api_check_all_sync_events() ##
+Check the contents of all ric events received for a callback id.
+
+| arg list |
+|--|
+| `<response-code> <id> [ EMPTY | ( <ric-id> )+ ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<id>` | Id of the callback destination  |
+| `EMPTY` | Indicator for an empty list  |
+| `<ric-id>` | Id of the ric  |
+
+# Description of functions in ecs_api_functions.sh #
+
+## Function: use_ecs_rest_http ##
+Use http for all API calls to the ECS. This is the default protocol.
+| arg list |
+|--|
+| None |
+
+## Function: use_ecs_rest_https ##
+Use https for all API calls to the ECS.
+| arg list |
+|--|
+| None |
+
+## Function: use_ecs_dmaap_http ##
+Send and recieve all API calls to the ECS over Dmaap via the MR using http.
+| arg list |
+|--|
+| None |
+
+## Function: use_ecs_dmaap_https ##
+Send and recieve all API calls to the ECS over Dmaap via the MR using https.
+| arg list |
+|--|
+| None |
+
+## Function: start_ecs ##
+Start the ECS container in docker or kube depending on running mode.
+| arg list |
+|--|
+| None |
+
+## Function: restart_ecs ##
+Restart the ECS container.
+| arg list |
+|--|
+| None |
+
+## Function: set_ecs_debug ##
+Configure the ECS log on debug level. The ECS must be running.
+| arg list |
+|--|
+| None |
 
+## Function: set_ecs_trace ##
+Configure the ECS log on trace level. The ECS must be running.
+| arg list |
+|--|
+| None |
 
 # Description of functions in ecs_api_function.sh #
 
@@ -1365,64 +1207,176 @@ To test, provide all parameters.
 
 | arg list |
 |--|
-| `<response-code> <producer-id>` |
+| `<response-code> <producer-id>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<producer-id>` | Id of the producer  |
+
+## Function: ecs_api_edp_put_producer() ##
+Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
+To test, provide all parameters. The list of type/schema pair may be empty.
+
+| arg list |
+|--|
+| `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<producer-id>` | Id of the producer  |
+| `<job-callback>` | Callback for create/delete job  |
+| `<supervision-callback>` | Callback for producer supervision  |
+| `<type-id>` | Id of the EI type  |
+| `<schema-file>` | Path to a schema file  |
+| `EMPTY` | The list of type/schema pairs is empty  |
+
+## Function: ecs_api_edp_get_producer_jobs() ##
+Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
+To test the response code only, provide the response and the producer-id.
+To also test the response payload add the remaining parameters.
+
+| arg list |
+|--|
+| `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<producer-id>` | Id of the producer  |
+| `<job-id>` | Id of the job  |
+| `<type-id>` | Id of the EI type  |
+| `<target-url>` | Target url for data delivery  |
+| `<job-owner>` | Id of the job owner  |
+| `<template-job-file>` | Path to a job template file  |
+| `EMPTY` | The list of job/type/target/job-file tuples is empty  |
+
+## Function: ecs_api_service_status() ##
+Test of GET '/status'.
+
+| arg list |
+|--|
+| `<response-code>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+
+## Function: ecs_api_admin_reset() ##
+Test of GET '/status'.
+
+| arg list |
+|--|
+| `<response-code> [ <type> ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<type>` | Type id, if the interface supports type in url |
+
+
+# Description of functions in http_proxy_api_functions.sh #
+
+## Function: start_http_proxy ##
+Start the http proxy container in docker or kube depending on running mode.
+| arg list |
+|--|
+| None |
+
+# Description of functions in mr_api_functions.sh #
+
+## Function: use_mr_http ##
+Use http for all Dmaap calls to the MR. This is the default. The admin API is not affected. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: use_mr_https ##
+Use https for all Dmaap call to the MR. The admin API is not affected. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: start_mr ##
+Start the Message Router stub interface container in docker or kube depending on start mode
+| arg list |
+|--|
+| None |
+
+
+## Function: mr_equal ##
+Tests if a variable value in the Message Router (MR) 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.
+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 'mrstub' dir for more details.
+| arg list |
+|--|
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in the MR  |
+| `<target-value>` | Target value for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
+
+## Function: mr_greater ##
+Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
+Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than 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 greater than the target value or not.
+See the 'mrstub' dir for more details.
+| arg list |
+|--|
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<producer-id>` | Id of the producer  |
-
-## Function: ecs_api_edp_put_producer() ##
-Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
-To test, provide all parameters. The list of type/schema pair may be empty.
+| `<variable-name>` | Variable name in the MR  |
+| `<target-value>` | Target value for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
 
+## Function: mr_read ##
+Reads the value of a variable in the Message Router (MR) simulator. The value is intended to be passed to a env variable in the test script.
+See the 'mrstub' dir for more details.
 | arg list |
 |--|
-| `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
+| `<variable-name>` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<producer-id>` | Id of the producer  |
-| `<job-callback>` | Callback for create/delete job  |
-| `<supervision-callback>` | Callback for producer supervision  |
-| `<type-id>` | Id of the EI type  |
-| `<schema-file>` | Path to a schema file  |
-| `EMPTY` | The list of type/schema pairs is empty  |
-
-## Function: ecs_api_edp_get_producer_jobs() ##
-Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
-To test the response code only, provide the response and the producer-id.
-To also test the response payload add the remaining parameters.
+| `<variable-name>` | Variable name in the MR  |
 
+## Function: mr_print ##
+Prints the value of a variable in the Message Router (MR) simulator.
+See the 'mrstub' dir for more details.
 | arg list |
 |--|
-| `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
+| `<variable-name>` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<producer-id>` | Id of the producer  |
-| `<job-id>` | Id of the job  |
-| `<type-id>` | Id of the EI type  |
-| `<target-url>` | Target url for data delivery  |
-| `<job-owner>` | Id of the job owner  |
-| `<template-job-file>` | Path to a job template file  |
-| `EMPTY` | The list of job/type/target/job-file tuples is empty  |
+| `<variable-name>` | Variable name in the MR  |
 
-## Function: ecs_api_service_status() ##
-Test of GET '/status'.
 
+# Description of functions in prodstub_api_functions.sh #
+
+## Function: use_prod_stub_http ##
+Use http for the API.  The admin API is not affected. This is the default protocol.
 | arg list |
 |--|
-| `<response-code>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
+| None |
 
+## Function: use_prod_stub_https ##
+Use https for the API. The admin API is not affected.
+| arg list |
+|--|
+| None |
 
-# Description of functions in prodstub_api_function.sh #
+## Function: start_prod_stub ##
+Start the Producer stub container in docker or kube depending on start mode
+| arg list |
+|--|
+| None |
 
 ## Function: prodstub_arm_producer() ##
 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
@@ -1535,38 +1489,26 @@ With the timeout, the test waits up to the timeout seconds before setting pass o
 | `<target-value>` | Target value for the variable  |
 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
 
-# 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.
-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.
+# Description of functions in rapp_catalogue_api_function.sh #
+
+## Function: use_rapp_catalogue_http ##
+Use http for the API. This is the default protocol.
 | arg list |
 |--|
-| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<variable-name>` | Variable name in the CR  |
-| `<target-value>` | Target value for the variable  |
-| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
-
-## Function: cr_api_check_all_sync_events() ##
-Check the contents of all ric events received for a callback id.
+| None |
 
+## Function: use_rapp_catalogue_https ##
+Use https for the API.
 | arg list |
 |--|
-| `<response-code> <id> [ EMPTY | ( <ric-id> )+ ]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<id>` | Id of the callback destination  |
-| `EMPTY` | Indicator for an empty list  |
-| `<ric-id>` | Id of the ric  |
+| None |
 
-# Description of functions in rapp_catalogue_api_function.sh #
+## Function: start_rapp_catalogue ##
+Start the rapp catalogue container in docker or kube depending on start mode
+| arg list |
+|--|
+| None |
 
 ## Function: rc_equal ##
 Tests if a variable value in the RAPP Catalogue is equal to a target value.
@@ -1642,6 +1584,160 @@ Check a registered service.
 | `<service-id>` | Id of the service  |
 
 
+# Description of functions in ricsimulator_api_functions.sh #
+The functions below only use the admin interface of the simulator, no usage of the A1 interface.
+
+
+## Function: use_simulator_http ##
+Use http for all API calls (A1) toward the simulator. This is the default. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: use_simulator_https ##
+Use https for all API calls (A1) toward the simulator. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: start_ric_simulators ##
+Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
+| arg list |
+|--|
+| `ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `ricsim_g1|ricsim_g2|ricsim_g3` | Base name of the simulator. Each instance will have an postfix instance id added, starting on '1'. For examplle 'ricsim_g1_1', 'ricsim_g1_2' etc  |
+|`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
+|`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
+
+## Function: sim_equal ##
+Tests if a variable value in the RIC 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.
+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 'a1-interface' repo for more details.
+
+| arg list |
+|--|
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in the ric simulator  |
+| `<target-value>` | Target value for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
+
+## Function: sim_print ##
+Prints the value of a variable in the RIC simulator.
+See the 'a1-interface' repo for more details.
+
+| arg list |
+|--|
+| `<variable-name>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in the RIC simulator  |
+
+
+## Function: sim_contains_str ##
+Tests if a variable value in the RIC simulator contains a target string.
+Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
+With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value contains the target string or not.
+See the 'a1-interface' repo for more details.
+
+| arg list |
+|--|
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in the ric simulator  |
+| `<target-value>` | Target substring for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
+
+## Function: sim_put_policy_type ##
+Loads a policy type to the simulator
+
+| arg list |
+|--|
+| `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+| `<policy-type-id>` |  Id of the policy type |
+| `<policy-type-file>` |  Path to the schema file of the policy type |
+
+## Function: sim_delete_policy_type ##
+Deletes a policy type from the simulator
+
+| arg list |
+|--|
+| `<response-code> <ric-id> <policy_type_id>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+| `<policy-type-id>` |  Id of the policy type |
+
+## Function: sim_post_delete_instances ##
+Deletes all instances (and status), for one ric
+
+| arg list |
+|--|
+| `<response-code> <ric-id>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+
+
+## Function: sim_post_delete_all ##
+Deletes all types, instances (and status), for one ric
+
+| arg list |
+|--|
+| `<response-code> <ric-id>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+
+## Function: sim_post_forcedresponse ##
+Sets (or resets) response code for next (one) A1 message, for one ric.
+The intention is to simulate error response on the A1 interface.
+
+| arg list |
+|--|
+| `<response-code> <ric-id> [<forced_response_code>]`|
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+| `<forced_response_code>` |  Http response code to send |
+
+## Function: sim_post_forcedelay ##
+Sets (or resets) A1 response delay, for one ric
+The intention is to delay responses on the A1 interface. Setting remains until removed.
+
+| arg list |
+|--|
+| `<response-code> <ric-id> [<delay-in-seconds>]`|
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+| `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
+
+
 ## License
 
 Copyright (C) 2020 Nordix Foundation. All rights reserved.
index 80b49d1..2f1f543 100644 (file)
@@ -257,6 +257,7 @@ start_policy_agent() {
        return 0
 }
 
+# Load the the appl config for the agent into a config map
 agent_load_config() {
        echo -e $BOLD"Agent - load config from "$EBOLD$1
        data_json=$PWD/tmp/$POLICY_AGENT_DATA_FILE
index e9ff1f9..1a6f9ac 100644 (file)
@@ -1565,7 +1565,7 @@ ecs_api_service_status() {
 # Function prefix: ecs_api_admin
 
 # Admin to remove all jobs
-# args:
+# args: <response-code> [ <type> ]
 # (Function for test scripts)
 
 ecs_api_admin_reset() {
index e0e732c..007d63c 100644 (file)
@@ -63,7 +63,7 @@ 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"
+POLICY_AGENT_IMAGE_TAG_REMOTE_RELEASE="1.0.2"
 
 
 # Tag for guilin branch
index aee3af5..adf2ce2 100755 (executable)
@@ -198,6 +198,7 @@ trap trap_fnc ERR
 # Counter for tests
 TEST_SEQUENCE_NR=1
 
+# Function to log the start of a test case
 __log_test_start() {
        TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
        echo -e $BOLD"TEST $TEST_SEQUENCE_NR (${BASH_LINENO[1]}): ${FUNCNAME[1]}" $@ $EBOLD
@@ -206,30 +207,35 @@ __log_test_start() {
        ((TEST_SEQUENCE_NR++))
 }
 
+# General function to log a failed test case
 __log_test_fail_general() {
        echo -e $RED" FAIL."$1 $ERED
        ((RES_FAIL++))
        __check_stop_at_error
 }
 
+# Function to log a test case failed due to incorrect response code
 __log_test_fail_status_code() {
        echo -e $RED" FAIL. Exepected status "$1", got "$2 $3 $ERED
        ((RES_FAIL++))
        __check_stop_at_error
 }
 
+# Function to log a test case failed due to incorrect response body
 __log_test_fail_body() {
        echo -e $RED" FAIL, returned body not correct"$ERED
        ((RES_FAIL++))
        __check_stop_at_error
 }
 
+# Function to log a test case that is not supported
 __log_test_fail_not_supported() {
        echo -e $RED" FAIL, function not supported"$ERED
        ((RES_FAIL++))
        __check_stop_at_error
 }
 
+# General function to log a passed test case
 __log_test_pass() {
        if [ $# -gt 0 ]; then
                echo $@
@@ -240,6 +246,8 @@ __log_test_pass() {
 
 #Counter for configurations
 CONF_SEQUENCE_NR=1
+
+# Function to log the start of a configuration setup
 __log_conf_start() {
        TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
        echo -e $BOLD"CONF $CONF_SEQUENCE_NR (${BASH_LINENO[1]}): "${FUNCNAME[1]} $@ $EBOLD
@@ -247,24 +255,28 @@ __log_conf_start() {
        ((CONF_SEQUENCE_NR++))
 }
 
+# Function to log a failed configuration setup
 __log_conf_fail_general() {
        echo -e $RED" FAIL."$1 $ERED
        ((RES_CONF_FAIL++))
        __check_stop_at_error
 }
 
+# Function to log a failed configuration setup due to incorrect response code
 __log_conf_fail_status_code() {
        echo -e $RED" FAIL. Exepected status "$1", got "$2 $3 $ERED
        ((RES_CONF_FAIL++))
        __check_stop_at_error
 }
 
+# Function to log a failed configuration setup due to incorrect response body
 __log_conf_fail_body() {
        echo -e $RED" FAIL, returned body not correct"$ERED
        ((RES_CONF_FAIL++))
        __check_stop_at_error
 }
 
+# Function to log a passed configuration setup
 __log_conf_ok() {
        if [ $# -gt 0 ]; then
                echo $@
@@ -965,6 +977,7 @@ __check_and_pull_image() {
        return 0
 }
 
+# The following sequence pull the configured images
 
 echo -e $BOLD"Pulling configured images, if needed"$EBOLD
 
@@ -1729,7 +1742,6 @@ get_kube_sim_host() {
        set_name=$(echo $name | rev | cut -d- -f2- | rev) # Cut index part of ric name to get the name of statefulset
        # example gnb-g1-2 -> gnb-g1 where gnb-g1-2 is the ric name and gnb-g1 is the set name
        echo $name"."$set_name"."$KUBE_NONRTRIC_NAMESPACE
-
 }
 
 # Find the named port to an app (using the service resource)
@@ -1956,170 +1968,6 @@ __clean_kube() {
        echo ""
 }
 
-# # This function scales or deletes all resources for app selected by the testcase.
-# # args: -
-# # (Not for test scripts)
-# __clean_kube() {
-#      echo -e $BOLD"Initialize kube services//pods/statefulsets/replicaset to initial state"$EBOLD
-
-#      # Clean prestarted apps
-#      __check_prestarted_image 'RICSIM'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD RICSIM $EBOLD to 0"
-#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-a1simulator
-#      fi
-
-#      __check_prestarted_image 'PA'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD PA $EBOLD to 0"
-#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-policymanagementservice
-#      fi
-
-#      __check_prestarted_image 'ECS'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD ECS $EBOLD to 0"
-#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-enrichmentservice
-#      fi
-
-#      __check_prestarted_image 'RC'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD RC $EBOLD to 0"
-#              __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app nonrtric-rappcatalogueservice
-#      fi
-
-#      __check_prestarted_image 'CP'
-#      if [ $? -eq 0 ]; then
-#              echo -e " CP replicas kept as is"
-#      fi
-
-#      __check_prestarted_image 'SDNC'
-#      if [ $? -eq 0 ]; then
-#              echo -e " SDNC replicas kept as is"
-#      fi
-
-#      __check_prestarted_image 'MR'
-#      if [ $? -eq 0 ]; then
-#              echo -e " MR replicas kept as is"
-#      fi
-
-
-#      # Clean included apps - apps fully managed by the script
-
-#      ## Scale all to zero
-#      __check_included_image 'RICSIM'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD RICSIM $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RICSIM
-#      fi
-
-#      __check_included_image 'PA'
-#      if [ $? -eq 0 ]; then
-#          echo -e " Scaling all kube resources for app $BOLD PA $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
-#      fi
-
-#      __check_included_image 'ECS'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD ECS $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ECS
-#      fi
-
-#      __check_included_image 'RC'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD RC $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
-#      fi
-
-#      __check_included_image 'CP'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD CP $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest CP
-#      fi
-
-#      __check_included_image 'SDNC'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD SDNC $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest SDNC
-#      fi
-
-#      __check_included_image 'CR'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD CR $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_SIM_NAMESPACE autotest CR
-#      fi
-
-#      __check_included_image 'MR'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD MR $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_ONAP_NAMESPACE autotest MR
-#      fi
-
-#      __check_included_image 'PRODSTUB'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Scaling all kube resources for app $BOLD PRODSTUB $EBOLD to 0"
-#              __kube_scale_all_resources $KUBE_SIM_NAMESPACE autotest PRODSTUB
-#      fi
-
-
-#      ## Remove all resources
-
-#      __check_included_image 'RICSIM'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD RICSIM $EBOLD"
-#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RICSIM
-#      fi
-
-#      __check_included_image 'PA'
-#      if [ $? -eq 0 ]; then
-#          echo -e " Deleting all kube resources for app $BOLD PA $EBOLD"
-#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
-#      fi
-
-#      __check_included_image 'ECS'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD ECS $EBOLD"
-#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest ECS
-#      fi
-
-#      __check_included_image 'RC'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD RC $EBOLD"
-#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
-#      fi
-
-#      __check_included_image 'CP'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD CP $EBOLD"
-#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest CP
-#      fi
-
-#      __check_included_image 'SDNC'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD SDNC $EBOLD"
-#              __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest SDNC
-#      fi
-
-#      __check_included_image 'CR'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD CR $EBOLD"
-#              __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest CR
-#      fi
-
-#      __check_included_image 'MR'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD MR $EBOLD"
-#              __kube_delete_all_resources $KUBE_ONAP_NAMESPACE autotest MR
-#      fi
-
-#      __check_included_image 'PRODSTUB'
-#      if [ $? -eq 0 ]; then
-#              echo -e " Deleting all kube resources for app $BOLD PRODSTUB $EBOLD"
-#              __kube_delete_all_resources $KUBE_SIM_NAMESPACE autotest PRODSTUB
-#      fi
-
-#      echo ""
-# }
-
 # Function stop and remove all containers (docker) and services/deployments etc(kube)
 # args: -
 # Function for test script
@@ -2129,7 +1977,6 @@ clean_environment() {
        else
                __clean_containers
        fi
-
 }
 
 # Function stop and remove all containers (docker) and services/deployments etc(kube) in the end of the test script, if the arg 'auto-clean' is given at test script start