Updated image tags for e-release test profile 27/7427/1
authorBjornMagnussonXA <bjorn.magnusson@est.tech>
Mon, 20 Dec 2021 07:58:10 +0000 (08:58 +0100)
committerBjornMagnussonXA <bjorn.magnusson@est.tech>
Mon, 20 Dec 2021 07:58:17 +0000 (08:58 +0100)
Updated README files

Issue-ID: NONRTRIC-618

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

test/auto-test/README.md
test/common/README.md
test/common/test_env-oran-e-release.sh
test/common/testcase_common.sh

index 76858fe..793b92e 100644 (file)
@@ -1,7 +1,7 @@
 # Overview
 
 The bash scripts in this dir are intended for function test of the Non-RT RIC in different configurations, using simulators when needed for the external interfaces.
-A few of the bash scripts are so called 'suites', These suite scripts calls a sequence of the other bash scripts.
+A few of the bash scripts are so called 'suites', These suite scripts calls a sequence of the other bash test scripts.
 
 ## Automated test scripts
 
@@ -9,11 +9,12 @@ There are two types of scripts, filenames in the format FTCXXX.sh test one or mo
 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). As an option, the scripts can also be executed in a Minikube or Kubernetes installation. The additional requirement is to have a clean minikube/kubernetes installation, perferably with the kube dashboard installed.
-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 only partly verified. Running using minikube has only been verified on Ubuntu and running on kubernetes has only been verified on MacOS.
+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 only partly verified. Running using minikube has only been verified on Ubuntu and running on kubernetes has been verified on MacOS and Ubuntu. Successful sample tests has been made on google cloud.
 
 ## 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.
+The test scripts uses configuration from a single profile file, found in `../common/test_env-*.sh`, which contains all needed configuration in terms of image names, image tags, ports, file paths, passwords etc. There is one profile file for system (ORAN/ONAP) and release.
+If temporary changes are needed to the settings in a profile file, use an override file containing only the variable to override.
 
 ## How to run
 
@@ -30,7 +31,7 @@ Each test script prints out the overall result of the tests in the end of the ex
 The test scripts produce quite a number of logs; all container logs, a log of all http/htps calls from the test scripts including the payload, some configuration created during test and also a test case log (same as what is printed on the screen during execution). All these logs are stored in `logs/FTCXXX/`. So each test script is using its own log directory.
 
 To test all components on a very basic level, run the demo test script(s) for the desired release.
-Note that oran tests only include components from oran.
+Note that oran tests only include components from oran (exception is the onap sdnc).
 Note that onap test uses components from onap combined with released oran components available at that onap release (e.g. Honolulu contains onap images from honolulu and oran images from cherry)
 
 
@@ -81,21 +82,21 @@ ONAP ISTANBUL
 The test script are number using these basic categories where 0-999 are releated to the policy managment and 1000-1999 are related to information management. 2000-2999 are for southbound http proxy. There are also demo test cases that test more or less all components. These test scripts does not use the numbering scheme below.
 
 The numbering in each series corresponds to the following groupings
-1-99 - Basic sanity tests
+1-99 - Basic sanity tests, PMS
 
-100-199 - API tests
+100-199 - API tests, PMS
 
-300-399 - Config changes and sync
+300-399 - Config changes and sync, PMS
 
-800-899 - Stability and capacity test
+800-899 - Stability and capacity test, PMS
 
-900-999 - Misc test
+900-999 - Misc test, PMS
 
 11XX - ICS API Tests
 
 18XX - ICS Stability and capacity test
 
-2000 - Southbound http proxy tests
+20XX - Southbound http proxy tests
 
 30XX - rApp tests
 
@@ -121,7 +122,7 @@ TC_ONELINE_DESCR="<test case description>"
 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>
+KUBE_PRESTARTED_IMAGES=<list of used apps (prestarte - i.e. not started by the script) in this test case - for kube>
 
 SUPPORTED_PROFILES=<list of supported profile names>
 
@@ -141,6 +142,8 @@ setup_testenvironment
 
 #### TEST COMPLETE ####
 
+print_result
+
 store_logs          END
 
 ```
index c52ee9c..dc7b64d 100644 (file)
@@ -1,36 +1,39 @@
 # 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. The test environment supports both test with docker and kubernetes(still experimental)
+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 Managerment Service, Information Coordinator Service , A1 simulator as well as other components and simulators. The test environment supports both test with docker and kubernetes.
 Some of the scripts can also be used for other kinds of tests, for example basic tests.
 
 ## Overview for common test scripts and files ##
 
-`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 ics apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
 
+`cbs_api_function.sh` \
+All functions are implemented in `consul_api_function.sh`.
+
+`clean-docker.sh` \
+Cleans all containers started by the test environment in docker.
+
 `clean-kube.sh` \
 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
 
 `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'.
 
-`consul_cbs_function.sh` \
-Contains functions for managing Consul and CBS as well as create the configuration for the PMS.
+`consul_api_function.sh` \
+Contains functions for managing Consul and CBS.
 
-`control_panel_api_function.sh` \
-Contains functions for managing Control Panel.
-
-`controller_api_functions.sh` \
-Contains functions for adaping towards the A1-controller API.
+`count_json_elements.py` \
+A python script calculate the length of json array or size of a json dictionary'.
 
 `count_json_elements.py` \
 A python script returning the number of items in a json array.
 
+`cp_api_function.sh` \
+Contains functions for managing the Control Panel.
+
 `cr_api_functions.sh` \
-Contains functions for adapting towards the Callback receiver for checking received callback event.
+Contains functions for adapting towards the Callback receiver for checking received callback events.
 
 `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.
@@ -41,36 +44,60 @@ 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.
 
+`dmaapadp_api_function.sh`
+Contains funnctions for managing the Dmaap Adaptor Service.
+
+`dmaapmed_api_function.sh`
+Contains funnctions for managing the Dmaap Mediator Service.
+
+`dmaapmr_api_function.sh`
+All functions are implemented in `mr_api_functions.sh`.
+
 `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)
 
-`ics_api_functions.sh` \
-Contains functions for adapting towards the ICS API
-
 `extract_sdnc_reply.py` \
 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
 
-`gateway_api_functions.sh` \
-Contains functions for managing the Non-RT RIC Gateway
+`genstat.sh` \
+This script collects container statistics to a file. Works both in docker and kubernetes (only for docker runtime).
 
 `http_proxy_api_functions.sh` \
-Contains functions for managing the Http Proxy
+Contains functions for managing the Http Proxy.
+
+`ics_api_functions.sh` \
+Contains functions for adapting towards the Information Coordinator Service API.
+
+`kafkapc_api_functions.sh` \
+Contains functions for managing the kafka producer/consumer. Kafka is started by the dmaap message router component.
 
 `kube_proxy_api_functions.sh` \
-Contains functions for managing the Kube Proxy - to gain access to all services pod inside a kube cluster.
+Contains functions for managing the Kube Proxy - to gain access to all services pod inside a kube cluster or all containers in a private docker network.
 
 `mr_api_functions.sh` \
 Contains functions for managing the MR Stub and the Dmaap Message Router
 
+`ngw_api_functions.sh` \
+Contains functions for managing the Non-RT RIC Gateway
+
+`pa_api_functions.sh` \
+Contains functions for adapting towards the Policy Management Service (PMS) API, also via dmaap (using a message-router stub interface)
+
 `prodstub_api_functions.sh` \
 Contains functions for adapting towards the Producer stub interface - simulates a producer.
 
-`rapp_catalogue_api_functions.sh` \
+`pvccleaner_api_functions.sh` \
+Contains functions for managing the PVC Cleaner (used for reset mounted volumes in kubernetes).
+
+`rc_api_functions.sh` \
 Contains functions for adapting towards the RAPP Catalogue.
 
-`ricsimulator_api_functions.sh` \
+`ricsim_api_functions.sh` \
 Contains functions for adapting towards the RIC (A1) simulator admin API.
 
+`sdnc_api_functions.sh` \
+Contains functions for adaping towards the SDNC (used as an A1 controller).
+
 `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'.
@@ -79,6 +106,9 @@ Used by the auto test scripts/suites but could be used for other test script as
 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.
 
+`testengine_config.sh` \
+Configuration file to setup the applications (components and simulators) the test enviroment handles.
+
 `testsuite_common.sh` \
 Common functions for running two or more auto test scripts as a suite.
 
@@ -101,6 +131,9 @@ This file must implement the following functions used by the test engine. Note t
 | __<app-short_name>_kube_scale_zero |
 | __<app-short_name>_kube_scale_zero_and_wait |
 | __<app-short_name>_kube_delete_all |
+| __<app-short_name>_store_docker_logs |
+| __<app-short_name>_initial_setup |
+| __<app-short_name>_statisics_setup |
 
 In addition, all other functions used for testing of the application shall also be added to the file. For example functions to start the application, setting interface parameters as well as functions to send rest call towards the api of the application and validating the result.
 
@@ -148,7 +181,7 @@ The script can be started with these arguments
 | `--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 |
 | `--image-repo` |  Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
-| `-repo-policy` |  Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push on locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
+| `-repo-policy` |  Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push only locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
 | `--cluster-timeout` |  Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
 | `--print-stats` |  Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
 | `--override <file>` |  Override setting from the file supplied by --env-file |
@@ -164,20 +197,6 @@ Must be called right after sourcing all component scripts.
 |--|
 | None |
 
-## 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.
@@ -190,18 +209,15 @@ Print a test report of an auto-test script.
 Start a timer for time measurement. Only one timer can be running.
 | arg list |
 |--|
+| `<timer-message-to-print>` |
 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
 
 ## Function: print_timer ##
 
-Print the value of the timer (in seconds) previously started by 'start_timer'. (Note that timer is still running after this function). The result of the timer as well as the args to the function will also be printed in the test report.
+Print the value of the timer (in seconds) previously started by 'start_timer'. (Note that timer is still running after this function). The result of the timer as well as the arg to 'start_timer' will also be printed in the test report.
 | arg list |
 |--|
-| `<timer-message-to-print>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<timer-message-to-print>` | Any text message to be printed along with the timer result.(It is good practice to use same args for this function as for the `start_timer`) |
+| None |
 
 ## Function: deviation ##
 
@@ -240,16 +256,9 @@ Make the script sleep for a number of seconds.
 | `<sleep-time-in-sec>` | Number of seconds to sleep |
 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
 
-## 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: 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.
+Take a snap-shot of all logs for all running containers/pods 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 |
 |--|
 | `<logfile-prefix>` |
@@ -274,1151 +283,711 @@ Print out the overall result of the executed test cases.
 |--|
 | None |
 
-# Description of functions in agent_api_functions.sh #
+# Description of functions in consul_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.
-For api function in version 2, an url prefix is added if configured.
+## Function: consul_config_app ##
 
-## Function: use_agent_rest_http ##
+Function to load a json config from a file into consul for the Policy Agent
 
-Use http for all API calls to the Policy Agent. This is the default.
 | arg list |
 |--|
-| None |
+| `<json-config-file>` |
 
-## Function: use_agent_rest_https ##
+| parameter | description |
+| --------- | ----------- |
+| `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
 
-Use https for all API calls to the Policy Agent.
+## Function: start_consul_cbs ##
+
+Start the Consul and CBS containers
 | arg list |
 |--|
 | None |
 
-## Function: use_agent_dmaap_http ##
+# Description of functions in cp_api_function.sh #
 
-Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
+## Function: use_control_panel_http ##
+
+Set http as the protocol to use for all communication to the Control Panel
 | arg list |
 |--|
 | None |
 
-## Function: use_agent_dmaap_https ##
+## Function: use_control_panel_https ##
 
-Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
+Set https as the protocol to use for all communication to the Control Panel
 | arg list |
 |--|
 | None |
 
-## Function: start_policy_agent ##
+## Function: start_control_panel ##
 
-Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
+Start the Control Panel container
 | arg list |
 |--|
-| `<logfile-prefix>` |
-| (docker) `PROXY\|NOPROXY <config-file>` |
-| (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
+| None |
 
-| parameter | description |
-| --------- | ----------- |
-| `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  |
+# Description of functions in cr_api_functions.sh #
 
-## Function: agent_load_config ##
+## Function: use_cr_http ##
 
-Load the config into a config map (kubernetes only).
+Use http for getting event from CR.  The admin API is not affected. This is the default.
 | arg list |
 |--|
-|  `<data-file>` |
-
-| parameter | description |
-| --------- | ----------- |
-|  `<data-file>` | Path to application_configuration.json  |
+| None |
 
-## Function: set_agent_debug ##
+## Function: use_cr_https ##
 
-Configure the Policy Agent log on debug level. The Policy Agent must be running.
+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: set_agent_trace ##
+## Function: start_cr ##
 
-Configure the Policy Agent log on trace level. The Policy Agent must be running.
+Start the Callback Receiver container in docker or kube depending on start mode.
 | arg list |
 |--|
 | None |
 
-## Function: use_agent_retries ##
+## Function: cr_equal ##
 
-Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
+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 |
 |--|
-| `[<response-code>]*` |
-
-## Function: check_policy_agent_logs ##
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
 
-Check the Policy Agent log for any warnings and errors and print the count of each.
-| arg list |
-|--|
-| None |
+| 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: api_equal() ##
+## Function: cr_contains_str ##
 
-Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
-Without the timeout, the test sets pass or fail immediately depending on if the array length 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 array length becomes equal to the target value or not.
-See the 'cr' dir for more details.
+Tests if a variable value in the CR 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>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types  |
-| `<target-value>` | Target value for the length  |
-| `<timeout-in-sec>` | Max time to wait for the length to reach the target value  |
-
-## Function: api_get_policies() ##
+| `<variable-name>` | Variable name in the CR  |
+| `<target-value>` | Target substring for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
 
-Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
-To test the response code only, provide the response code parameter as well as the following three parameters.
-To also test the response payload add the 'NOID' for an expected empty array or repeat the last five/seven parameters for each expected policy.
+## Function: cr_read ##
 
+Reads the value of a variable in the CR 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> <ric-id>\|NORIC <service-id>\|NOSERVICE <policy-type-id>\|NOTYPE [ NOID \| [<policy-id> <ric-id> <service-id> EMPTY\|<policy-type-id> <template-file>]*]` |
-
-| arg list V2 |
-|--|
-| `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <policy-type-id>\|NOTYPE [ NOID \| [<policy-id> <ric-id> <service-id> EMPTY\|<policy-type-id> <transient> <notification-url> <template-file>]*]` |
+| `<variable-name>` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` | Id of the ric  |
-| `NORIC` | Indicator that no ric is provided  |
-| `<service-id>` | Id of the service  |
-| `NOSERVICE` | Indicator that no service id is provided  |
-| `<policy-type-id>` |  Id of the policy type |
-| `NOTYPE` | Indicator that no type id is provided  |
-| `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
-| `<policy-id>` |  Id of the policy |
-| `EMPTY` |  Indicate for the special empty policy type |
-| `transient` |  Transient, true or false |
-| `notification-url` |  Url for notifications |
-| `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
+| `<variable-name>` | Variable name in the CR  |
 
-## Function: api_get_policy() ##
+## Function: cr_delay_callback ##
 
-Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
-To test the the response code only, provide the expected response code and policy id.
-To test the contents of the returned json payload, add a path to the template file used when creating the policy.
+Function to configure write delay on callbacks. Delay given in seconds. Setting remains until removed.
 
 | arg list |
 |--|
-| `<response-code>  <policy-id> [<template-file>]` |
-
-| arg list V2|
-|--|
-| `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
+| `<response-code> <cr-path-id> [<delay-in-seconds>]`|
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<policy-id>` |  Id of the policy |
-| `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
-| `<service-id>` | Id of the service  |
-| `<ric-id>` | Id of the ric  |
-| `<policy-type-id>` |  Id of the policy type |
-| `NOTYPE` | Indicator that no type id is provided  |
-| `transient` |  Transient, true or false |
-| `notification-url` |  Url for notifications |
+| `<cr-path-id>` |  Variable index to CR |
+| `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
 
-## Function: api_put_policy() ##
+## Function: cr_api_check_all_sync_events ##
 
-Test of PUT '/policy' or V2 PUT '/policies'.
-If more than one policy shall be created, add a count value to indicate the number of policies to create. Note that if more than one policy shall be created the provided policy-id must be numerical (will be used as the starting id).
+Check the contents of all ric events received for a callback id.
 
 | arg list |
 |--|
-| `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
-
-| arg list V2 |
-|--|
-| `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
+| `<response-code> <id> [ EMPTY \| ( <ric-id> )+ ]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<service-id>` | Id of the service  |
+| `<id>` | Id of the callback destination  |
+| `EMPTY` | Indicator for an empty list  |
 | `<ric-id>` | Id of the ric  |
-| `<policy-type-id>` |  Id of the policy type |
-| `<policy-id>` |  Id of the policy. This value shall be a numeric value if more than one policy shall be created |
-| `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
-| `notification-url` |  Url for notifications |
-|`NOURL`| Indicator for no url |
-| `<template-file>` |  Path to the template file for the policy |
-| `<count>` |  An optional count (default is 1). If a value greater than 1 is given, the policy ids will use the given policy id as the first id and add 1 to that id for each new policy |
-
-## Function: api_put_policy_batch() ##
 
-This tests the same as function 'api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
-If the agent api is not configured to use dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
-For arg list and parameters, see 'api_put_policy'.
-
-## Function: api_put_policy_parallel() ##
+## Function: cr_api_check_all_ics_events ##
 
-This tests the same as function 'api_put_policy' except that the policy create is spread out over a number of processes and it only uses the agent rest API. The total number of policies created is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the creation of all the policies in one ric.
-
-| arg list |
-|--|
-| `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
+Check the contents of all current status events for one id from ICS
 
 | arg list |
 |--|
-| `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <notification-url>\|NOURL <template-file> <count-per-ric> <number-of-threads>`
+| `<response-code> <id> [ EMPTY \| ( <status> )+ ]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<service-id>` | Id of the service  |
-| `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
-| `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id  |
-| `<policy-type-id>` |  Id of the policy type |
-| `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
-| `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
-| `notification-url` |  Url for notifications |
-| `<template-file>` |  Path to the template file for the policy |
-| `<count-per-ric>` |  Number of policies per ric |
-| `<number-of-threads>` |  Number of threads (processes) to run in parallel |
+| `<id>` | Id of the callback destination  |
+| `EMPTY` | Indicator for an empty list  |
+| `<status>` | Status string  |
 
-## Function: api_delete_policy() ##
+## Function: cr_api_check_all_ics_subscription_events ##
 
-This tests the DELETE '/policy' or V2 DELETE '/v2/policies/{policy_id}'. Removes the indicated policy or a 'count' number of policies starting with 'policy-id' as the first id.
+Check the contents of all current subscription events for one id from ICS
 
 | arg list |
 |--|
-| `<response-code> <policy-id> [<count>]`
+| `<response-code> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<policy-id>` |  Id of the policy |
-| `<count>` |  An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
+| `<id>` | Id of the callback destination  |
+| `EMPTY` | Indicator for an empty list  |
+| `<type-id>` | Id of the data type  |
+| `<schema>` | Path to typeschema file  |
+| `<registration-status>` | Status string  |
 
-## Function: api_delete_policy_batch() ##
+## Function: cr_api_reset ##
 
-This tests the same as function 'api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
-If the agent api is not configured to used dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
-For arg list and parameters, see 'api_delete_policy'.
+Reset the callback receiver
 
-## Function: api_delete_policy_parallel() ##
+| arg list |
+|--|
+| - |
 
-This tests the same as function 'api_delete_policy' except that the policy delete is spread out over a number of processes and it only uses the agent rest API. The total number of policies deleted is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the deletion of all the policies in one ric.
+## Function: cr_api_check_all_genric_json_events ##
+
+Check the contents of all json events for path
 
 | arg list |
 |--|
-| `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
+| `<response-code> <cr-path-id>  <topic-url> (EMPTY | <json-msg>+ )` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
-| `<number-of-rics>` | The number of rics, assuming the first index is '1'  |
-| `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
-| `<count-per-ric>` |  Number of policies per ric |
-| `<number-of-threads>` |  Number of threads (processes) to run in parallel |
+| `<cr-path-id>` | Variable index for CR  |
+| `<topic-url>` | Topic url  |
+| `EMPTY` | Indicator for an empty list  |
+| `json-msg` | Json msg string to compare with  |
 
-## Function: api_get_policy_ids() ##
+## Function: cr_api_check_single_genric_json_event ##
 
-Test of GET '/policy_ids' or V2 GET '/v2/policies'.
-To test response code only, provide the response code parameter as well as the following three parameters.
-To also test the response payload add the 'NOID' for an expected empty array or repeat the 'policy-instance-id' for each expected policy id.
+Check a single (oldest) json event (or none if empty) for path
 
 | arg list |
 |--|
-| `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
+| `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg> )` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<ric-id>` | Id of the ric  |
-| `NORIC` | Indicator that no ric is provided  |
-| `<service-id>` | Id of the service  |
-| `NOSERVICE` | Indicator that no service id is provided  |
-| `type-id>` |  Id of the policy type |
-| `NOTYPE` | Indicator that no type id is provided  |
-| `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
-| `<policy-instance-id>` |  Id of the policy |
+| `<cr-path-id>` | Variable index for CR  |
+| `<topic-url>` | Topic url  |
+| `EMPTY` | Indicator for no msg  |
+| `json-msg` | Json msg string to compare with  |
 
-## Function: api_get_policy_schema() ##
+## Function: cr_api_check_single_genric_event_md5 ##
 
-Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
-To test the response code only, provide the expected response code and policy type id.
-To test the contents of the returned json schema, add a path to a schema file to compare with.
+Check a single (oldest) json in md5 format (or none if empty) for path.
+Note that if a json message is given, it shall be compact, no ws except inside string.
+The MD5 will generate different hash if whitespace is present or not in otherwise equivalent json.
 
 | arg list |
 |--|
-| `<response-code> <policy-type-id> [<schema-file>]` |
+| `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-msg> )` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<policy-type-id>` |  Id of the policy type |
-| `<schema-file>` |  Path to the schema file for the policy type |
+| `<cr-path-id>` | Variable index for CR  |
+| `<topic-url>` | Topic url  |
+| `EMPTY` | Indicator for no msg  |
+| `data-msg` | msg string to compare with  |
 
-## Function: api_get_policy_schema() ##
+## Function: cr_api_check_single_genric_event_md5_file ##
 
-Test of GET '/policy_schema' and optional check of the returned json schema.
-To test the response code only, provide the expected response code and policy type id.
-To test the contents of the returned json schema, add a path to a schema file to compare with.
+Check a single (oldest) event in md5 format (or none if empty) for path.
+Note that if a file with json message is given, the json shall be compact, no ws except inside string and not newlines.
+The MD5 will generate different hash if ws/newlines is present or not in otherwise equivalent json
 
 | arg list |
 |--|
-| `<response-code> <policy-type-id> [<schema-file>]` |
+| `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-file> )` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<policy-type-id>` |  Id of the policy type |
-| `<schema-file>` |  Path to the schema file for the policy type |
+| `<cr-path-id>` | Variable index for CR  |
+| `<topic-url>` | Topic url  |
+| `EMPTY` | Indicator for no msg  |
+| `data-file` | path to file to compare with  |
 
-## Function: api_get_policy_schemas() ##
+# Description of functions in dmaapadp_api_functions.sh #
 
-Test of GET '/policy_schemas' and optional check of the returned json schemas.
-To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
-To test the contents of the returned json schema, add a path to a schema file to compare with (or NOFILE to represent an empty '{}' type)
+## Function: use_dmaapadp_http ##
+
+Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
 
 | arg list |
 |--|
-| `<response-code>  <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
-| `NORIC` |  No ric id given |
-| `<schema-file>` |  Path to the schema file for the policy type |
-| `NOFILE` |  Indicate the template for an empty type |
+| None |
 
-## Function: api_get_policy_status() ##
+## Function: use_dmaapadp_https ##
 
-Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
+Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
 
 | arg list |
 |--|
-| `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<policy-id>` |  Id of the policy |
-| `STD` |  Indicator of status of Standarized A1 |
-| `STD2` |  Indicator of status of Standarized A1 version 2 |
-| `<enforce-status>` |  Enforcement status |
-| `<reason>` |  Optional reason |
-| `EMPTY` |  Indicator of empty string status or reason |
-| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
-| `<instance-status>` |  Instance status |
-| `<has-been-deleted>` |  Deleted status, true or false |
+| None |
 
-## Function: api_get_policy_types() ##
+## Function: start_dmaapadp ##
 
-Test of GET '/policy_types' or  V2 GET '/v2/policy-types' and optional check of the returned ids.
-To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
-To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
+Start the dmaap adator service container in docker or kube depending on running mode.
 
 | arg list |
 |--|
-| `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
+| (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<ric-id>` |  Id of the ric |
-| `NORIC` |  No ric id given |
-| `<policy-type-id>` |  Id of the policy type |
-| `EMPTY` |  Indicate the empty type |
-
-## Function: api_get_status() ##
+| `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  |
 
-Test of GET /status or V2 GET /status
+## Function: set_dmaapadp_trace ##
 
+Configure the dmaap adaptor service log on trace level. The app must be running.
 | arg list |
 |--|
-| `<response-code>` |
+| None |
 
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
+# Description of functions in dmaapmed_api_functions.sh #
 
-## Function: api_get_ric() ##
+## Function: use_dmaapmed_http ##
 
-Test of GET '/ric' or V2 GET '/v2/rics/ric'
-To test the response code only, provide the expected response code and managed element id.
-To test the returned ric id, provide the expected ric id.
+Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
 
 | arg list |
 |--|
-| `<reponse-code> <managed-element-id> [<ric-id>]` |
-
-| arg list V2 |
-|--|
-| `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<managed-element-id>` |  Id of the managed element |
-| `NOME` |  Indicator for no ME |
-| `ric-id` |  Id of the ric |
-| `NORIC` |  Indicator no RIC |
-| `string-of-ricinfo` |  String of ric info |
+| None |
 
-## Function: api_get_rics() ##
+## Function: use_dmaapmed_https ##
 
-Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
-To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
-To test also the returned payload, add the formatted string of info in the returned payload.
-Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
-Example <br>`<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
+Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
 
 | arg list |
 |--|
-| `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
+| None |
 
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<policy-type-id>` |  Policy type id of the ric |
-| `NOTYPE>` |  No type given |
-| `<space-separate-string-of-ricinfo>` |  A space separated string of ric info - needs to be quoted |
+## Function: start_dmaapmed ##
 
-## Function: api_put_service() ##
+Start the dmaap mediator service container in docker or kube depending on running mode.
 
-Test of PUT '/service' or V2 PUT '/service'.
 | arg list |
 |--|
-| `<response-code>  <service-name> <keepalive-timeout> <callbackurl>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<service-name>` |  Service name |
-| `<keepalive-timeout>` |  Timeout value |
-| `<callbackurl>` |  Callback url |
+| None |
 
-## Function: api_get_services() ##
+# Description of functions in httpproxy_api_functions.sh #
 
-Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
-To test only the response code, omit all parameters except the expected response code.
-To test the returned json, provide the parameters after the response code.
+## Function: use_http_proxy_http ##
 
+Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
 | arg list |
 |--|
-| `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<query-service-name>` |  Service name for the query |
-| `<target-service-name>` |  Target service name|
-| `<keepalive-timeout>` |  Timeout value |
-| `<callbackurl>` |  Callback url |
-| `NOSERVICE` |  Indicator of no target service name |
-
-## Function: api_get_service_ids() ##
+| None |
 
-Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
+## Function: use_http_proxy_https ##
 
+Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
 | arg list |
 |--|
-| `<response-code> [<service-name>]*` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<service-name>` |  Service name |
-
-## Function: api_delete_services() ##
+| None |
 
-Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
+## Function: start_http_proxy ##
 
+Start the http proxy container in docker or kube depending on running mode.
 | arg list |
 |--|
-| `<response-code> [<service-name>]*` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<service-name>` |  Service name |
+| None |
 
-## Function: api_put_services_keepalive() ##
+# Description of functions in ics_api_functions.sh #
 
-Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
+## Function: use_ics_rest_http ##
 
+Use http for all API calls to the ICS. This is the default protocol.
 | arg list |
 |--|
-| `<response-code> <service-name>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<service-name>` |  Service name |
-
-## Function: api_put_configuration() ##
+| None |
 
-Test of PUT '/v2/configuration'
+## Function: use_ics_rest_https ##
 
+Use https for all API calls to the ICS.
 | arg list |
 |--|
-| `<response-code> <config-file>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<config-file>` |  Path json config file |
-
-## Function: api_get_configuration() ##
+| None |
 
-Test of GET '/v2/configuration'
+## Function: use_ics_dmaap_http ##
 
+Send and recieve all API calls to the ICS over Dmaap via the MR using http.
 | arg list |
 |--|
-| `<response-code> [<config-file>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<config-file>` |  Path json config file to compare the retrieved config with |
-
-# Description of functions in consul_cbs_function.sh #
-
-## Function: consul_config_app ##
+| None |
 
-Function to load a json config from a file into consul for the Policy Agent
+## Function: use_ics_dmaap_https ##
 
+Send and recieve all API calls to the ICS over Dmaap via the MR using https.
 | arg list |
 |--|
-| `<json-config-file>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
+| None |
 
-## Function: prepare_consul_config ##
+## Function: start_ics ##
 
-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')
+Start the ICS container in docker or kube depending on running mode.
 | arg list |
 |--|
-| `<deviation-message-to-print>` |
+| `PROXY|NOPROXY <config-file>` |
 
 | 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'  |
+| `PROXY` | Configure with http proxy, if proxy is started  |
+| `NOPROXY` | Configure without http proxy  |
+| `<config-file>`| Path to application.yaml  |
 
-## Function: start_consul_cbs ##
+## Function: stop_ics ##
 
-Start the Consul and CBS containers
+Stop the ICS container.
 | arg list |
 |--|
 | None |
 
-# Description of functions in control_panel_api_function.sh #
-
-## Function: use_control_panel_http ##
+## Function: start_stopped_ics ##
 
-Set http as the protocol to use for all communication to the Control Panel
+Start a previously stopped ics.
 | arg list |
 |--|
 | None |
 
-## Function: use_control_panel_https ##
+## Function: set_ics_debug ##
 
-Set https as the protocol to use for all communication to the Control Panel
+Configure the ICS log on debug level. The ICS must be running.
 | arg list |
 |--|
 | None |
 
-## Function: start_control_panel ##
+## Function: set_ics_trace ##
 
-Start the Control Panel container
+Configure the ICS log on trace level. The ICS must be running.
 | 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 ##
+## Function: use_ics_retries ##
 
-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.
+Perform curl retries when making direct call to ICS for the specified http response codes
+Speace separated list of http response codes
 | arg list |
 |--|
-| None |
-
-## Function: use_sdnc_https ##
+| `[<response-code>]*` |
 
-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 |
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code to make retry for  |
 
-## Function: start_sdnc ##
+## Function: check_ics_logs ##
 
-Start the SDNC A1 Controller container and its database container
+Check the ICS log for any warnings and errors and print the count of each.
 | arg list |
 |--|
 | None |
 
-## Function: check_sdnc_logs ##
+## Function: ics_equal ##
+
+Tests if a variable value in the ICS 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.
 
-Check the SDNC log for any warnings and errors and print the count of each.
 | arg list |
 |--|
-| None |
-
-## Function: controller_api_get_A1_policy_ids ##
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
 
-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'
-To test the response payload, include the ids of the expexted response.
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in ics  |
+| `<target-value>` | Target value for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
+
+## Function: ics_api_a1_get_job_ids ##
+
+Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs' and optional check of the array of returned job ids.
+To test the response code only, provide the response code parameter as well as a type id and an owner id.
+To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
 
 | arg list |
 |--|
-| `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
+| `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
-| `<ric-id>` | Id of the ric  |
-| `policy-type-id>` |  Id of the policy type |
-| `<policy-id>` |  Id of the policy |
-| `STD` |  Indicator of status of Standarized A1 |
+| `<type-id>` | Id of the EI type  |
+| `<owner-id>` | Id of the job owner  |
+| `NOOWNER` | No owner is given  |
+| `<job-id>` | Id of the expected job  |
+| `EMPTY` | The expected list of job id shall be empty  |
 
-## Function: controller_api_get_A1_policy_type ##
+## Function: ics_api_a1_get_type ##
 
-Test of GET a policy type (OSC only)
+Test of GET '/A1-EI/v1/eitypes/{eiTypeId}' and optional check of the returned schema.
+To test the response code only, provide the response code parameter as well as the type-id.
+To also test the response payload add a path to the expected schema file.
 
 | arg list |
 |--|
-| `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
+| `<response-code> <type-id> [<schema-file>]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
-| `<ric-id>` | Id of the ric  |
-| `policy-type-id>` |  Id of the policy type |
-| `policy-type-file>` |  Optional schema file to compare the returned type with |
+| `<type-id>` | Id of the EI type  |
+| `<schema-file>` | Path to a schema file to compare with the returned schema  |
 
-## Function: controller_api_delete_A1_policy ##
+## Function: ics_api_a1_get_type_ids ##
 
-Deletes a policy instance
+Test of GET '/A1-EI/v1/eitypes' and optional check of returned list of type ids.
+To test the response code only, provide the response only.
+To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
 
 | arg list |
 |--|
-| `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
+| `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `STD` |  Indicator of status of Standarized A1 |
-| `<ric-id>` | Id of the ric  |
-| `<policy-id>` |  Id of the policy |
-| `policy-type-id>` |  Id of the policy type |
-| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
-| `policy-type-file>` |  Optional schema file to compare the returned type with |
+| `EMPTY` | The expected list of type ids shall be empty  |
+| `<type-id>` | Id of the EI type  |
 
-## Function: controller_api_put_A1_policy ##
+## Function: ics_api_a1_get_job_status ##
 
-Creates a policy instance
+Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}/status' and optional check of the returned status.
+To test the response code only, provide the response code, type id and job id.
+To also test the response payload add the expected status.
 
 | arg list |
 |--|
-| `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
+| `<response-code> <type-id> <job-id> [<status>]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `STD` |  Indicator of status of Standarized A1 |
-| `<ric-id>` | Id of the ric  |
-| `<policy-id>` |  Id of the policy |
-| `<template-file>` |  Path to the template file of the policy|
-| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
-| `<policy-type-id>` |  Id of the policy type |
+| `<type-id>` | Id of the EI type  |
+| `<job-id>` | Id of the job  |
+| `<status>` | Expected status  |
 
-## Function: controller_api_get_A1_policy_status ##
+## Function: ics_api_a1_get_job ##
 
-Checks the status of a policy
+Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}' and optional check of the returned job.
+To test the response code only, provide the response code, type id and job id.
+To also test the response payload add the remaining parameters.
 
- arg list |
+| arg list |
 |--|
-| `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
+| `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `STD` |  Indicator of status of Standarized A1 |
-| `<ric-id>` | Id of the ric  |
-| `<policy-id>` |  Id of the policy |
-| `<enforce-status>` |  Enforcement status |
-| `<reason>` |  Optional reason |
-| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
-| `<policy-type-id>` |  Id of the policy type |
-| `<instance-status>` |  Instance status |
-| `<has-been-deleted>` |  Deleted status, true or false |
-
-# Description of functions in cr_api_functions.sh #
-
-## Function: use_cr_http ##
+| `<type-id>` | Id of the EI type  |
+| `<job-id>` | Id of the job  |
+| `<target-url>` | Expected target url for the job  |
+| `<owner-id>` | Expected owner for the job  |
+| `<template-job-file>` | Path to a job template for job parameters of the job  |
 
-Use http for getting event from CR.  The admin API is not affected. This is the default.
-| arg list |
-|--|
-| None |
+## Function: ics_api_a1_delete_job ##
 
-## Function: use_cr_https ##
+Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
+To test, provide all the specified parameters.
 
-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 |
+| `<response-code> <type-id> <job-id>` |
 
-## Function: start_cr ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<type-id>` | Id of the EI type  |
+| `<job-id>` | Id of the job  |
 
-Start the Callback Receiver container in docker or kube depending on start mode.
-| arg list |
-|--|
-| None |
+## Function: ics_api_a1_put_job ##
 
-## Function: cr_equal ##
+Test of PUT '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
+To test, provide all the specified parameters.
 
-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> ]` |
+| `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
 
 | 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  |
+| `<response-code>` | Expected http response code |
+| `<type-id>` | Id of the EI type  |
+| `<job-id>` | Id of the job  |
+| `<target-url>` | Target url for the job  |
+| `<owner-id>` | Owner of the job  |
+| `<template-job-file>` | Path to a job template for job parameters of the job  |
 
-## Function: cr_api_check_all_sync_events() ##
+## Function: ics_api_edp_get_type_ids ##
 
-Check the contents of all ric events received for a callback id.
+Test of GET '/ei-producer/v1/eitypes' or '/data-producer/v1/info-types' depending on ics version and an optional check of the returned list of type ids.
+To test the response code only, provide the response code.
+To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
 
 | arg list |
 |--|
-| `<response-code> <id> [ EMPTY \| ( <ric-id> )+ ]` |
+| `<response-code> [ EMPTY \| <type-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  |
+| `<type-id>` | Id of the type  |
+| `EMPTY` | The expected list of type ids shall be empty  |
 
-## Function: cr_api_check_all_ics_events() ##
+## Function: ics_api_edp_get_producer_status ##
 
-Check the contents of all current status events for one id from ICS
+Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ics version and optional check of the returned status.
+To test the response code only, provide the response code and producer id.
+To also test the response payload add the expected status.
 
 | arg list |
 |--|
-| `<response-code> <id> [ EMPTY \| ( <status> )+ ]` |
+| `<response-code> <producer-id> [<status>]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<id>` | Id of the callback destination  |
-| `EMPTY` | Indicator for an empty list  |
-| `<status>` | Status string  |
+| `<producer-id>` | Id of the producer  |
+| `<status>` | The expected status string  |
 
-## Function: cr_api_check_all_ics_subscription_events() ##
+## Function: ics_api_edp_get_producer_ids ##
 
-Check the contents of all current subscription events for one id from ICS
+Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
+To test the response code only, provide the response.
+To also test the response payload add the list of expected producer-ids (or EMPTY if the list of ids is expected to be empty).
 
 | arg list |
 |--|
-| `<response-code> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
+| `<response-code> [ EMPTY \| <producer-id>+]` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
-| `<id>` | Id of the callback destination  |
-| `EMPTY` | Indicator for an empty list  |
-| `<type-id>` | Id of the data type  |
-| `<schema>` | Path to typeschema file  |
-| `<registration-status>` | Status string  |
-
+| `<producer-id>` | Id of the producer  |
+| `EMPTY` | The expected list of type ids shall be empty  |
 
-## Function: cr_api_reset() ##
+## Function: ics_api_edp_get_producer_ids_2 ##
 
-Reset the callback receiver
+Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ics version and optional check of the returned producer ids.
+To test the response code only, provide the response.
+To also test the response payload add the type (if any) and a list of expected producer-ids (or EMPTY if the list of ids is expected to be empty).
 
 | arg list |
 |--|
-| - |
+| `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
 
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<type-id>` | Id of the type  |
+| `EMPTY` | No type given  |
+| `<producer-id>` | Id of the producer  |
+| `EMPTY` | The expected list of type ids shall be empty  |
 
-# Description of functions in ics_api_functions.sh #
+## Function: ics_api_edp_get_type ##
 
-## Function: use_ics_rest_http ##
+Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
+To test the response code only, provide the response and the type-id.
+To also test the response payload add a path to a job schema file and a list expected producer-id (or EMPTY if the list of ids is expected to be empty).
 
-Use http for all API calls to the ICS. This is the default protocol.
 | arg list |
 |--|
-| None |
+| `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
 
-## Function: use_ics_rest_https ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<type-id>` | Id of the type  |
+| `<job-schema-file>` | Path to a job schema file  |
+| `<producer-id>` | Id of the producer  |
+| `EMPTY` | The expected list of type ids shall be empty  |
 
-Use https for all API calls to the ICS.
-| arg list |
-|--|
-| None |
+## Function: ics_api_edp_get_type_2 ##
 
-## Function: use_ics_dmaap_http ##
+Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
+To test the response code only, provide the response and the type-id.
+To also test the response payload add a path to a job schema file.
 
-Send and recieve all API calls to the ICS over Dmaap via the MR using http.
 | arg list |
 |--|
-| None |
+| `<response-code> <type-id> [<job-schema-file>]` |
 
-## Function: use_ics_dmaap_https ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<type-id>` | Id of the type  |
+| `<job-schema-file>` | Path to a job schema file  |
+| `EMPTY` | The expected list of type ids shall be empty  |
 
-Send and recieve all API calls to the ICS over Dmaap via the MR using https.
-| arg list |
-|--|
-| None |
+## Function: ics_api_edp_put_type_2 ##
 
-## Function: start_ics ##
+Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
 
-Start the ICS container in docker or kube depending on running mode.
 | arg list |
 |--|
-| None |
+| `<response-code> <type-id> [<job-schema-file>]` |
 
-## Function: stop_ics ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<type-id>` | Id of the type  |
+| `<job-schema-file>` | Path to a job schema file  |
+| `EMPTY` | The expected list of type ids shall be empty  |
 
-Stop the ICS container.
-| arg list |
-|--|
-| None |
+## Function: ics_api_edp_delete_type_2 ##
 
-## Function: start_stopped_ics ##
+Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
 
-Start a previously stopped ics.
 | arg list |
 |--|
-| None |
+| `<response-code> <type-id>` |
 
-## Function: set_ics_debug ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<type-id>` | Id of the type  |
 
-Configure the ICS log on debug level. The ICS must be running.
-| arg list |
-|--|
-| None |
+## Function: ics_api_edp_get_producer ##
 
-## Function: set_ics_trace ##
+Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
+To test the response code only, provide the response and the producer-id.
+To also test the response payload add the remaining parameters defining thee producer.
 
-Configure the ICS log on trace level. The ICS must be running.
 | arg list |
 |--|
-| None |
-
-## Function: check_ics_logs ##
-
-Check the ICS log for any warnings and errors and print the count of each.
-| arg list |
-|--|
-| None |
-
-## Function: ics_equal ##
-
-Tests if a variable value in the ICS 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 ics  |
-| `<target-value>` | Target value for the variable  |
-| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
-
-## Function: ics_api_a1_get_job_ids() ##
-
-Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
-To test the response code only, provide the response code parameter as well as a type id and an owner id.
-To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
-
-| arg list |
-|--|
-| `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the EI type  |
-| `<owner-id>` | Id of the job owner  |
-| `NOOWNER` | No owner is given  |
-| `<job-id>` | Id of the expected job  |
-| `EMPTY` | The expected list of job id shall be empty  |
-
-## Function: ics_api_a1_get_type() ##
-
-Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
-To test the response code only, provide the response code parameter as well as the type-id.
-To also test the response payload add a path to the expected schema file.
-
-| arg list |
-|--|
-| `<response-code> <type-id> [<schema-file>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the EI type  |
-| `<schema-file>` | Path to a schema file to compare with the returned schema  |
-
-## Function: ics_api_a1_get_type_ids() ##
-
-Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
-To test the response code only, provide the response only.
-To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
-
-| arg list |
-|--|
-| `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `EMPTY` | The expected list of type ids shall be empty  |
-| `<type-id>` | Id of the EI type  |
-
-## Function: ics_api_a1_get_job_status() ##
-
-Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
-To test the response code only, provide the response code, type id and job id.
-To also test the response payload add the expected status.
-
-| arg list |
-|--|
-| `<response-code> <type-id> <job-id> [<status>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the EI type  |
-| `<job-id>` | Id of the job  |
-| `<status>` | Expected status  |
-
-## Function: ics_api_a1_get_job() ##
-
-Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
-To test the response code only, provide the response code, type id and job id.
-To also test the response payload add the remaining parameters.
-
-| arg list |
-|--|
-| `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the EI type  |
-| `<job-id>` | Id of the job  |
-| `<target-url>` | Expected target url for the job  |
-| `<owner-id>` | Expected owner for the job  |
-| `<template-job-file>` | Path to a job template for job parameters of the job  |
-
-## Function: ics_api_a1_delete_job() ##
-
-Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
-To test, provide all the specified parameters.
-
-| arg list |
-|--|
-| `<response-code> <type-id> <job-id>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the EI type  |
-| `<job-id>` | Id of the job  |
-
-## Function: ics_api_a1_put_job() ##
-
-Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
-To test, provide all the specified parameters.
-
-| arg list |
-|--|
-| `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the EI type  |
-| `<job-id>` | Id of the job  |
-| `<target-url>` | Target url for the job  |
-| `<owner-id>` | Owner of the job  |
-| `<template-job-file>` | Path to a job template for job parameters of the job  |
-
-## Function: ics_api_edp_get_type_ids() ##
-
-Test of GET '/ei-producer/v1/eitypes' or '/data-producer/v1/info-types' depending on ics version and an optional check of the returned list of type ids.
-To test the response code only, provide the response code.
-To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
-
-| arg list |
-|--|
-| `<response-code> [ EMPTY \| <type-id>+]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the type  |
-| `EMPTY` | The expected list of type ids shall be empty  |
-
-## Function: ics_api_edp_get_producer_status() ##
-
-Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ics version and optional check of the returned status.
-To test the response code only, provide the response code and producer id.
-To also test the response payload add the expected status.
-
-| arg list |
-|--|
-| `<response-code> <producer-id> [<status>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<producer-id>` | Id of the producer  |
-| `<status>` | The expected status string  |
-
-## Function: ics_api_edp_get_producer_ids() ##
-
-Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
-To test the response code only, provide the response.
-To also test the response payload add the list of expected producer-ids (or EMPTY if the list of ids is expected to be empty).
-
-| arg list |
-|--|
-| `<response-code> [ EMPTY \| <producer-id>+]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<producer-id>` | Id of the producer  |
-| `EMPTY` | The expected list of type ids shall be empty  |
-
-## Function: ics_api_edp_get_producer_ids_2() ##
-
-Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ics version and optional check of the returned producer ids.
-To test the response code only, provide the response.
-To also test the response payload add the type (if any) and a list of expected producer-ids (or EMPTY if the list of ids is expected to be empty).
-
-| arg list |
-|--|
-| `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the type  |
-| `EMPTY` | No type given  |
-| `<producer-id>` | Id of the producer  |
-| `EMPTY` | The expected list of type ids shall be empty  |
-
-## Function: ics_api_edp_get_type() ##
-
-Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
-To test the response code only, provide the response and the type-id.
-To also test the response payload add a path to a job schema file and a list expected producer-id (or EMPTY if the list of ids is expected to be empty).
-
-| arg list |
-|--|
-| `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the type  |
-| `<job-schema-file>` | Path to a job schema file  |
-| `<producer-id>` | Id of the producer  |
-| `EMPTY` | The expected list of type ids shall be empty  |
-
-## Function: ics_api_edp_get_type_2() ##
-
-Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
-To test the response code only, provide the response and the type-id.
-To also test the response payload add a path to a job schema file.
-
-| arg list |
-|--|
-| `<response-code> <type-id> [<job-schema-file>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the type  |
-| `<job-schema-file>` | Path to a job schema file  |
-| `EMPTY` | The expected list of type ids shall be empty  |
-
-## Function: ics_api_edp_put_type_2() ##
-
-Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
-
-| arg list |
-|--|
-| `<response-code> <type-id> [<job-schema-file>]` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the type  |
-| `<job-schema-file>` | Path to a job schema file  |
-| `EMPTY` | The expected list of type ids shall be empty  |
-
-## Function: ics_api_edp_delete_type_2() ##
-
-Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
-
-| arg list |
-|--|
-| `<response-code> <type-id>` |
-
-| parameter | description |
-| --------- | ----------- |
-| `<response-code>` | Expected http response code |
-| `<type-id>` | Id of the type  |
-
-## Function: ics_api_edp_get_producer() ##
-
-Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
-To test the response code only, provide the response and the producer-id.
-To also test the response payload add the remaining parameters defining thee producer.
-
-| arg list |
-|--|
-| `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
+| `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
 
 | parameter | description |
 | --------- | ----------- |
@@ -1431,7 +1000,7 @@ To also test the response payload add the remaining parameters defining thee pro
 | `<schema-file>` | Path to a schema file  |
 | `EMPTY` | The expected list of type schema pairs shall be empty  |
 
-## Function: ics_api_edp_get_producer_2() ##
+## Function: ics_api_edp_get_producer_2 ##
 
 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version and optional check of the returned producer.
 To test the response code only, provide the response and the producer-id.
@@ -1450,7 +1019,7 @@ To also test the response payload add the remaining parameters defining thee pro
 | `<type-id>` | Id of the type  |
 | `EMPTY` | The expected list of types shall be empty  |
 
-## Function: ics_api_edp_delete_producer() ##
+## Function: ics_api_edp_delete_producer ##
 
 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
 To test, provide all parameters.
@@ -1464,7 +1033,7 @@ To test, provide all parameters.
 | `<response-code>` | Expected http response code |
 | `<producer-id>` | Id of the producer  |
 
-## Function: ics_api_edp_put_producer() ##
+## Function: ics_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.
@@ -1483,7 +1052,7 @@ To test, provide all parameters. The list of type/schema pair may be empty.
 | `<schema-file>` | Path to a schema file  |
 | `EMPTY` | The list of type/schema pairs is empty  |
 
-## Function: ics_api_edp_put_producer_2() ##
+## Function: ics_api_edp_put_producer_2 ##
 
 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
 To test, provide all parameters. The list of type/schema pair may be empty.
@@ -1501,7 +1070,7 @@ To test, provide all parameters. The list of type/schema pair may be empty.
 | `<type-id>` | Id of the type  |
 | `NOTYPE` | The list of types is empty  |
 
-## Function: ics_api_edp_get_producer_jobs() ##
+## Function: ics_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.
@@ -1522,7 +1091,7 @@ To also test the response payload add the remaining parameters.
 | `<template-job-file>` | Path to a job template file  |
 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
 
-## Function: ics_api_edp_get_producer_jobs_2() ##
+## Function: ics_api_edp_get_producer_jobs_2 ##
 
 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' or '/data-producer/v1/info-producers/{infoProducerId}/info-jobs' depending on ics version and optional check of the returned producer job.
 To test the response code only, provide the response and the producer-id.
@@ -1543,7 +1112,7 @@ To also test the response payload add the remaining parameters.
 | `<template-job-file>` | Path to a job template file  |
 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
 
-## Function: ics_api_service_status() ##
+## Function: ics_api_service_status ##
 
 Test of GET '/status'.
 
@@ -1555,7 +1124,7 @@ Test of GET '/status'.
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
 
-## Function: ics_api_idc_get_type_ids() ##
+## Function: ics_api_idc_get_type_ids ##
 
 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
 To test the response code only, provide the response code.
@@ -1571,7 +1140,7 @@ To also test the response payload add list of expected type ids (or EMPTY if the
 | `<type-id>` | Id of the Info type  |
 | `EMPTY` | The expected list of type ids shall be empty  |
 
-## Function: ics_api_idc_get_job_ids() ##
+## Function: ics_api_idc_get_job_ids ##
 
 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
 To test the response code only, provide the response code parameter as well as a type id and an owner id.
@@ -1590,7 +1159,7 @@ To also test the response payload add the 'EMPTY' for an expected empty array or
 | `<job-id>` | Id of the expected job  |
 | `EMPTY` | The expected list of job id shall be empty  |
 
-## Function: ics_api_idc_get_job() ##
+## Function: ics_api_idc_get_job ##
 
 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
 To test the response code only, provide the response code, type id and job id.
@@ -1609,9 +1178,9 @@ To also test the response payload add the remaining parameters.
 | `<owner-id>` | Expected owner for the job  |
 | `<template-job-file>` | Path to a job template for job parameters of the job  |
 
-## Function: ics_api_idc_put_job() ##
+## Function: ics_api_idc_put_job ##
 
-Test of PUT '​/data-consumer/v1/info-jobs/{infoJobId}'.
+Test of PUT '/data-consumer/v1/info-jobs/{infoJobId}'.
 To test, provide all the specified parameters.
 
 | arg list |
@@ -1628,9 +1197,9 @@ To test, provide all the specified parameters.
 | `<template-job-file>` | Path to a job template for job parameters of the job  |
 | `VALIIDATE` | Indicator to preform type validation at creation  |
 
-## Function: ics_api_idc_delete_job() ##
+## Function: ics_api_idc_delete_job ##
 
-Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
+Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
 To test, provide all the specified parameters.
 
 | arg list |
@@ -1643,7 +1212,7 @@ To test, provide all the specified parameters.
 | `<type-id>` | Id of the type  |
 | `<job-id>` | Id of the job  |
 
-## Function: ics_api_idc_get_type() ##
+## Function: ics_api_idc_get_type ##
 
 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
 To test the response code only, provide the response code parameter as well as the type-id.
@@ -1659,7 +1228,7 @@ To also test the response payload add a path to the expected schema file.
 | `<type-id>` | Id of the Info type  |
 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
 
-## Function: ics_api_idc_get_job_status() ##
+## Function: ics_api_idc_get_job_status ##
 
 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
 To test the response code only, provide the response code and job id.
@@ -1676,7 +1245,7 @@ To also test the response payload add the expected status.
 | `<status>` | Expected status  |
 | `<timeout>` | Timeout |
 
-## Function: ics_api_idc_get_job_status2() ##
+## Function: ics_api_idc_get_job_status2 ##
 
 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
 To test the response code only, provide the response code and job id.
@@ -1697,7 +1266,7 @@ To also test the response payload add the expected status.
 | `<timeout>` | Timeout |
 
 
-## Function: ics_api_idc_get_subscription_ids() ##
+## Function: ics_api_idc_get_subscription_ids ##
 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
 
 | arg list |
@@ -1712,7 +1281,7 @@ Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of
 | `<EMPTY>` | Indicated for empty list of subscription ids  |
 | `<subscription-id>` |Id of the subscription  |
 
-## Function: ics_api_idc_get_subscription() ##
+## Function: ics_api_idc_get_subscription ##
 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
 
 | arg list |
@@ -1727,7 +1296,7 @@ Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the
 | `<status-uri>` | Url for status notifications  |
 
 
-## Function: ics_api_idc_put_subscription() ##
+## Function: ics_api_idc_put_subscription ##
 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
 
 | arg list |
@@ -1741,7 +1310,7 @@ Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the
 | `<owner-id>` | Id of the owner  |
 | `<status-uri>` | Url for status notifications  |
 
-## Function: ics_api_idc_delete_subscription() ##
+## Function: ics_api_idc_delete_subscription ##
 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
 
 | arg list |
@@ -1754,7 +1323,7 @@ Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
 | `<subscription-id>` |Id of the subscription  |
 
 
-## Function: ics_api_admin_reset() ##
+## Function: ics_api_admin_reset ##
 
 Test of GET '/status'.
 
@@ -1767,191 +1336,1007 @@ Test of GET '/status'.
 | `<response-code>` | Expected http response code |
 | `<type>` | Type id, if the interface supports type in url |
 
-# Description of functions in gateway_api_functions.sh #
+## Function: ics_kube_pvc_reset ##
 
-## Function: use_gateway_http ##
+Admin reset to remove all data in ics; jobs, producers etc
+NOTE - only works in kubernetes and the pod should not be running
 
-Use http for all calls to the gateway. This is set by default.
 | arg list |
 |--|
 | None |
 
-## Function: use_gateway_https ##
+# Description of functions in kafkapc_api_functions.sh #
 
-Use https for all calls to the gateway.
+## Function: use_kafkapc_http ##
+
+Use http for all calls to the KAFKAPC.
 | arg list |
 |--|
 | None |
 
-## Function: set_gateway_debug ##
+## Function: use_kafkapc_https ##
 
-Set debug level logging in the gateway
+Use https for all calls to the KAFKAPC.
 | arg list |
 |--|
 | None |
 
-## Function: set_gateway_trace ##
+## Function: start_kafkapc ##
 
-Set debug level logging in the trace
+Start the KAFKAPC container in docker or kube depending on start mode
 | arg list |
 |--|
 | None |
 
-## Function: start_gateway ##
+## Function: kafkapc_equal ##
 
-Start the the gateway container in docker or kube depending on start mode
+Tests if a variable value in the KAFKAPC 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 KAFKAPC  |
+| `<target-value>` | Target value for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
+
+## Function: kafkapc_api_reset ##
+
+Deep reset of KAFKAPC. Note that kafka itself is not affected, i.e. created topic still exist in kafka.
 | arg list |
 |--|
 | None |
 
-## Function: gateway_pms_get_status ##
+## Function: kafkapc_api_create_topic ##
 
-Sample test of pms api (status)
+Create a topic in kafka via kafkapc.
+| `<response-code> <topic-name>  <mime-type>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic-name>` | Name of the topic  |
+| `<mime-type>` | Mime type of the data to send to the topic. Data on the topic is expected to be of this type  |
+
+## Function: kafkapc_api_get_topic ##
+
+Create a from kafkapc.
+| `<response-code> <topic-name>  <mime-type>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic-name>` | Name of the topic  |
+| `<mime-type>` | Mime type of the topic  |
+
+## Function: kafkapc_api_start_sending ##
+
+Start sending msg from the msg queue to kafka for a topic.
+| `<response-code> <topic-name>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic-name>` | Name of the topic  |
+
+## Function: kafkapc_api_start_receiving ##
+
+Start receiving msg from a kafka topic to the msg queue in kafkapc.
+| `<response-code> <topic-name>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic-name>` | Name of the topic  |
+
+## Function: kafkapc_api_stop_sending ##
+
+Stop sending msg from the msg queue to kafka for a topic.
+| `<response-code> <topic-name>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic-name>` | Name of the topic  |
+
+## Function: kafkapc_api_stop_receiving ##
+
+Stop receiving msg from a kafka topic to the msg queue in kafkapc.
+| `<response-code> <topic-name>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic-name>` | Name of the topic  |
+
+## Function: kafkapc_api_post_msg ##
+
+Send a message on a topic.
 | arg list |
 |--|
-| `<response-code>` |
+| `<response-code> <topic> <mime-type> <msg>` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
+| `<response-code>` | Http response code  |
+| `<topic>` | Topic name  |
+| `<mime-type>` | Mime type of the msg  |
+| `<msg>` | String msg to send  |
 
-## Function: gateway_ics_get_types ##
+## Function: kafkapc_api_get_msg ##
 
-Sample test of ics api (get types)
-Only response code tested - not payload
+Get a message on a topic.
 | arg list |
 |--|
-| `<response-code>` |
+| `<response-code> <topic>  ([ <mime-type>  <msg> ] | NOMSG )` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<response-code>` | Expected http response code |
+| `<response-code>` | Http response code  |
+| `<topic>` | Topic name  |
+| `<mime-type>` | Mime type of the msg  |
+| `<msg>` | String msg to receive  |
+| `NOMSG` | Indicated for no msg  |
 
-# Description of functions in http_proxy_api_functions.sh #
+## Function: kafkapc_api_post_msg_from_file ##
 
-## Function: use_http_proxy_http ##
+Send a message in a file on a topic.
+| arg list |
+|--|
+| `<response-code> <topic> <mime-type> <file>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic>` | Topic name  |
+| `<mime-type>` | Mime type of the msg  |
+| `<file>` | Filepath to the string msg to send  |
+
+## Function: kafkapc_api_get_msg_from_file ##
+
+Get a message on a topic.
+| arg list |
+|--|
+| `<response-code> <topic>  <mime-type>  <file> ` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Http response code  |
+| `<topic>` | Topic name  |
+| `<mime-type>` | Mime type of the msg  |
+| `<file>` | Filepath to the string msg to receive  |
+
+## Function: kafkapc_api_generate_json_payload_file ##
+
+Create json file with dummy data for payload.
+| arg list |
+|--|
+| `<size-in-kb> <filename>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<size-in-kb>` | Generated size in kb  |
+| `<filename>` | Path to output file  |
+
+## Function: kafkapc_api_generate_text_payload_file ##
+
+Create file with dummy text data for payload.
+| arg list |
+|--|
+| `<size-in-kb> <filename>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<size-in-kb>` | Generated size in kb  |
+| `<filename>` | Path to output file  |
+
+# Description of functions in kubeproxy_api_functions.sh #
+
+## Function: use_kube_proxy_http ##
 
 Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
 | arg list |
 |--|
 | None |
 
-## Function: use_http_proxy_https ##
+## Function: use_kube_proxy_https ##
+
+Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
+| arg list |
+|--|
+| None |
+
+## Function: start_kube_proxy ##
+
+Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
+No proxy is started if the function is called in docker 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: dmaap_api_print_topics ##
+
+Prints the current list of topics in DMAAP MR
+
+| 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 |
+| --------- | ----------- |
+| `<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 |
+|--|
+| `<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>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in the MR  |
+
+## Function: mr_api_send_json ##
+
+Send json to topic in mr-stub.
+| arg list |
+|--|
+| `<topic-url> <json-msg>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<topic-url>` | Topic url  |
+| `<json-msg>` | Json msg as string  |
+
+## Function: mr_api_send_text ##
+
+Send text to topic in mr-stub.
+| arg list |
+|--|
+| `<topic-url> <text-msg>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<topic-url>` | Topic url  |
+| `<text-msg>` | Text (string) msg  |
+
+
+
+## Function: mr_api_send_json_file ##
+
+Send json to topic in mr-stub.
+| arg list |
+|--|
+| `<topic-url> <json-file>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<topic-url>` | Topic url  |
+| `<json-file>` | Path to file with json msg as string  |
+
+## Function: mr_api_send_text_file ##
+
+Send text to topic in mr-stub.
+| arg list |
+|--|
+| `<topic-url> <text-file>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<topic-url>` | Topic url  |
+| `<text-file>` | Path to file with text msg as string  |
+
+## Function: mr_api_generate_json_payload_file ##
+
+Create json file with dummy data for payload.
+| arg list |
+|--|
+| `<size-in-kb> <filename>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<size-in-kb>` | Generated size in kb  |
+| `<filename>` | Path to output file  |
+
+## Function: mr_api_generate_text_payload_file ##
+
+Create file with dummy text data for payload.
+| arg list |
+|--|
+| `<size-in-kb> <filename>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<size-in-kb>` | Generated size in kb  |
+| `<filename>` | Path to output file  |
+
+# Description of functions in ngw_api_functions.sh #
+
+## Function: use_gateway_http ##
+
+Use http for all calls to the gateway. This is set by default.
+| arg list |
+|--|
+| None |
+
+## Function: use_gateway_https ##
+
+Use https for all calls to the gateway.
+| arg list |
+|--|
+| None |
+
+## Function: set_gateway_debug ##
+
+Set debug level logging in the gateway
+| arg list |
+|--|
+| None |
+
+## Function: set_gateway_trace ##
+
+Set debug level logging in the trace
+| arg list |
+|--|
+| None |
+
+## Function: start_gateway ##
+
+Start the the gateway container in docker or kube depending on start mode
+| arg list |
+|--|
+| None |
+
+## Function: gateway_pms_get_status ##
+
+Sample test of pms api (status)
+Only response code tested - not payload
+| arg list |
+|--|
+| `<response-code>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+
+## Function: gateway_ics_get_types ##
+
+Sample test of ics api (get types)
+Only response code tested - not payload
+| arg list |
+|--|
+| `<response-code>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+
+# Description of functions in pa_api_functions.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.
+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.
+| arg list |
+|--|
+| None |
+
+## Function: use_agent_rest_https ##
+
+Use https for all API calls to the Policy Agent.
+| arg list |
+|--|
+| None |
+
+## Function: use_agent_dmaap_http ##
+
+Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
+| arg list |
+|--|
+| None |
+
+## Function: use_agent_dmaap_https ##
+
+Send and recieve all API callss to the Policy Agent over Dmaap via the MR over https.
+| arg list |
+|--|
+| None |
+
+## Function: start_policy_agent ##
+
+Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
+| arg list |
+|--|
+| `<logfile-prefix>` |
+| (docker) `PROXY\|NOPROXY <config-file>` |
+| (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `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: stop_policy_agent ##
+
+Stop the pms container (docker) or scale it to zero (kubernetes).
+| arg list |
+|--|
+|  None |
+
+## Function: start_stopped_policy_agent ##
+
+Start a previousely stopped pms container (docker) or scale it to 1 (kubernetes).
+| arg list |
+|--|
+|  None |
+
+## 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 |
+|--|
+| `SDNC|NOSDNC <output-file>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `SDNC` | Configure with controller |
+| `NOSDNC` | Configure without controller |
+| `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app'  |
+
+## Function: agent_load_config ##
+
+Load the config into a config map (kubernetes only).
+| arg list |
+|--|
+|  `<data-file>` |
+
+| parameter | description |
+| --------- | ----------- |
+|  `<data-file>` | Path to application_configuration.json  |
+
+## 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>]*` |
+
+## 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: api_equal ##
+
+Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
+Without the timeout, the test sets pass or fail immediately depending on if the array length 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 array length 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>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types  |
+| `<target-value>` | Target value for the length  |
+| `<timeout-in-sec>` | Max time to wait for the length to reach the target value  |
+
+## Function: api_get_policies ##
+
+Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
+To test the response code only, provide the response code parameter as well as the following three parameters.
+To also test the response payload add the 'NOID' for an expected empty array or repeat the last five/seven parameters for each expected policy.
+
+| arg list |
+|--|
+| `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <policy-type-id>\|NOTYPE [ NOID \| [<policy-id> <ric-id> <service-id> EMPTY\|<policy-type-id> <template-file>]*]` |
+
+| arg list V2 |
+|--|
+| `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <policy-type-id>\|NOTYPE [ NOID \| [<policy-id> <ric-id> <service-id> EMPTY\|<policy-type-id> <transient> <notification-url> <template-file>]*]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` | Id of the ric  |
+| `NORIC` | Indicator that no ric is provided  |
+| `<service-id>` | Id of the service  |
+| `NOSERVICE` | Indicator that no service id is provided  |
+| `<policy-type-id>` |  Id of the policy type |
+| `NOTYPE` | Indicator that no type id is provided  |
+| `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
+| `<policy-id>` |  Id of the policy |
+| `EMPTY` |  Indicate for the special empty policy type |
+| `transient` |  Transient, true or false |
+| `notification-url` |  Url for notifications |
+| `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
+
+## Function: api_get_policy ##
+
+Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
+To test the the response code only, provide the expected response code and policy id.
+To test the contents of the returned json payload, add a path to the template file used when creating the policy.
+
+| arg list |
+|--|
+| `<response-code>  <policy-id> [<template-file>]` |
+
+| arg list V2|
+|--|
+| `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<policy-id>` |  Id of the policy |
+| `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
+| `<service-id>` | Id of the service  |
+| `<ric-id>` | Id of the ric  |
+| `<policy-type-id>` |  Id of the policy type |
+| `NOTYPE` | Indicator that no type id is provided  |
+| `transient` |  Transient, true or false |
+| `notification-url` |  Url for notifications |
+
+## Function: api_put_policy ##
+
+Test of PUT '/policy' or V2 PUT '/policies'.
+If more than one policy shall be created, add a count value to indicate the number of policies to create. Note that if more than one policy shall be created the provided policy-id must be numerical (will be used as the starting id).
+
+| arg list |
+|--|
+| `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
+
+| arg list V2 |
+|--|
+| `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-id>` | Id of the service  |
+| `<ric-id>` | Id of the ric  |
+| `<policy-type-id>` |  Id of the policy type |
+| `<policy-id>` |  Id of the policy. This value shall be a numeric value if more than one policy shall be created |
+| `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
+| `notification-url` |  Url for notifications |
+|`NOURL`| Indicator for no url |
+| `<template-file>` |  Path to the template file for the policy |
+| `<count>` |  An optional count (default is 1). If a value greater than 1 is given, the policy ids will use the given policy id as the first id and add 1 to that id for each new policy |
+
+## Function: api_put_policy_batch ##
+
+This tests the same as function 'api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
+If the agent api is not configured to use dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
+For arg list and parameters, see 'api_put_policy'.
+
+## Function: api_put_policy_parallel ##
+
+This tests the same as function 'api_put_policy' except that the policy create is spread out over a number of processes and it only uses the agent rest API. The total number of policies created is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the creation of all the policies in one ric.
+
+| arg list |
+|--|
+| `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
+
+| arg list |
+|--|
+| `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <notification-url>\|NOURL <template-file> <count-per-ric> <number-of-threads>`
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-id>` | Id of the service  |
+| `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
+| `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id  |
+| `<policy-type-id>` |  Id of the policy type |
+| `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
+| `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
+| `notification-url` |  Url for notifications |
+| `<template-file>` |  Path to the template file for the policy |
+| `<count-per-ric>` |  Number of policies per ric |
+| `<number-of-threads>` |  Number of threads (processes) to run in parallel |
+
+## Function: api_delete_policy ##
+
+This tests the DELETE '/policy' or V2 DELETE '/v2/policies/{policy_id}'. Removes the indicated policy or a 'count' number of policies starting with 'policy-id' as the first id.
+
+| arg list |
+|--|
+| `<response-code> <policy-id> [<count>]`
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<policy-id>` |  Id of the policy |
+| `<count>` |  An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
+
+## Function: api_delete_policy_batch ##
+
+This tests the same as function 'api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
+If the agent api is not configured to used dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
+For arg list and parameters, see 'api_delete_policy'.
+
+## Function: api_delete_policy_parallel ##
+
+This tests the same as function 'api_delete_policy' except that the policy delete is spread out over a number of processes and it only uses the agent rest API. The total number of policies deleted is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the deletion of all the policies in one ric.
+
+| arg list |
+|--|
+| `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
+| `<number-of-rics>` | The number of rics, assuming the first index is '1'  |
+| `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
+| `<count-per-ric>` |  Number of policies per ric |
+| `<number-of-threads>` |  Number of threads (processes) to run in parallel |
+
+## Function: api_get_policy_ids ##
+
+Test of GET '/policy_ids' or V2 GET '/v2/policies'.
+To test response code only, provide the response code parameter as well as the following three parameters.
+To also test the response payload add the 'NOID' for an expected empty array or repeat the 'policy-instance-id' for each expected policy id.
+
+| arg list |
+|--|
+| `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` | Id of the ric  |
+| `NORIC` | Indicator that no ric is provided  |
+| `<service-id>` | Id of the service  |
+| `NOSERVICE` | Indicator that no service id is provided  |
+| `type-id>` |  Id of the policy type |
+| `NOTYPE` | Indicator that no type id is provided  |
+| `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
+| `<policy-instance-id>` |  Id of the policy |
+
+## Function: api_get_policy_schema ##
+
+Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
+To test the response code only, provide the expected response code and policy type id.
+To test the contents of the returned json schema, add a path to a schema file to compare with.
+
+| arg list |
+|--|
+| `<response-code> <policy-type-id> [<schema-file>]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<policy-type-id>` |  Id of the policy type |
+| `<schema-file>` |  Path to the schema file for the policy type |
+
+## Function: api_get_policy_schema ##
+
+Test of GET '/policy_schema' and optional check of the returned json schema.
+To test the response code only, provide the expected response code and policy type id.
+To test the contents of the returned json schema, add a path to a schema file to compare with.
+
+| arg list |
+|--|
+| `<response-code> <policy-type-id> [<schema-file>]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<policy-type-id>` |  Id of the policy type |
+| `<schema-file>` |  Path to the schema file for the policy type |
+
+## Function: api_get_policy_schemas ##
+
+Test of GET '/policy_schemas' and optional check of the returned json schemas.
+To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
+To test the contents of the returned json schema, add a path to a schema file to compare with (or NOFILE to represent an empty '{}' type)
+
+| arg list |
+|--|
+| `<response-code>  <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+| `NORIC` |  No ric id given |
+| `<schema-file>` |  Path to the schema file for the policy type |
+| `NOFILE` |  Indicate the template for an empty type |
+
+## Function: api_get_policy_status ##
+
+Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
+
+| arg list |
+|--|
+| `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<policy-id>` |  Id of the policy |
+| `STD` |  Indicator of status of Standarized A1 |
+| `STD2` |  Indicator of status of Standarized A1 version 2 |
+| `<enforce-status>` |  Enforcement status |
+| `<reason>` |  Optional reason |
+| `EMPTY` |  Indicator of empty string status or reason |
+| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
+| `<instance-status>` |  Instance status |
+| `<has-been-deleted>` |  Deleted status, true or false |
+
+## Function: api_get_policy_types ##
+
+Test of GET '/policy_types' or  V2 GET '/v2/policy-types' and optional check of the returned ids.
+To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
+To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
+
+| arg list |
+|--|
+| `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<ric-id>` |  Id of the ric |
+| `NORIC` |  No ric id given |
+| `<policy-type-id>` |  Id of the policy type |
+| `EMPTY` |  Indicate the empty type |
+
+## Function: api_get_status ##
+
+Test of GET /status or V2 GET /status
+
+| arg list |
+|--|
+| `<response-code>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+
+## Function: api_get_ric ##
+
+Test of GET '/ric' or V2 GET '/v2/rics/ric'
+To test the response code only, provide the expected response code and managed element id.
+To test the returned ric id, provide the expected ric id.
+
+| arg list |
+|--|
+| `<reponse-code> <managed-element-id> [<ric-id>]` |
+
+| arg list V2 |
+|--|
+| `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<managed-element-id>` |  Id of the managed element |
+| `NOME` |  Indicator for no ME |
+| `ric-id` |  Id of the ric |
+| `NORIC` |  Indicator no RIC |
+| `string-of-ricinfo` |  String of ric info |
 
-Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
-| arg list |
-|--|
-| None |
+## Function: api_get_rics ##
 
-## Function: start_http_proxy ##
+Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
+To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
+To test also the returned payload, add the formatted string of info in the returned payload.
+Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
+Example <br>`<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
 
-Start the http proxy container in docker or kube depending on running mode.
 | arg list |
 |--|
-| None |
+| `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
 
-# Description of functions in kube_proxy_api_functions.sh #
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<policy-type-id>` |  Policy type id of the ric |
+| `NOTYPE>` |  No type given |
+| `<space-separate-string-of-ricinfo>` |  A space separated string of ric info - needs to be quoted |
 
-## Function: use_kube_proxy_http ##
+## Function: api_put_service ##
 
-Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
+Test of PUT '/service' or V2 PUT '/service'.
 | arg list |
 |--|
-| None |
+| `<response-code>  <service-name> <keepalive-timeout> <callbackurl>` |
 
-## Function: use_kube_proxy_https ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-name>` |  Service name |
+| `<keepalive-timeout>` |  Timeout value |
+| `<callbackurl>` |  Callback url |
 
-Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
-| arg list |
-|--|
-| None |
+## Function: api_get_services ##
 
-## Function: start_kube_proxy ##
+Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
+To test only the response code, omit all parameters except the expected response code.
+To test the returned json, provide the parameters after the response code.
 
-Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
-No proxy is started if the function is called in docker mode.
 | arg list |
 |--|
-| None |
+| `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
 
-# Description of functions in mr_api_functions.sh #
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<query-service-name>` |  Service name for the query |
+| `<target-service-name>` |  Target service name|
+| `<keepalive-timeout>` |  Timeout value |
+| `<callbackurl>` |  Callback url |
+| `NOSERVICE` |  Indicator of no target service name |
 
-## Function: use_mr_http ##
+## Function: api_get_service_ids ##
+
+Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
 
-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 |
+| `<response-code> [<service-name>]*` |
 
-## Function: use_mr_https ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-name>` |  Service name |
 
-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: api_delete_services ##
 
-## Function: start_mr ##
+Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
 
-Start the Message Router stub interface container in docker or kube depending on start mode
 | arg list |
 |--|
-| None |
+| `<response-code> [<service-name>]*` |
 
-## Function: mr_equal ##
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-name>` |  Service name |
+
+## Function: api_put_services_keepalive ##
+
+Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
 
-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> ]` |
+| `<response-code> <service-name>` |
 
 | 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  |
+| `<response-code>` | Expected http response code |
+| `<service-name>` |  Service name |
 
-## Function: mr_greater ##
+## Function: api_put_configuration ##
+
+Test of PUT '/v2/configuration'
 
-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> ]` |
+| `<response-code> <config-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  |
+| `<response-code>` | Expected http response code |
+| `<config-file>` |  Path json config file |
 
-## Function: mr_read ##
+## Function: api_get_configuration ##
+
+Test of GET '/v2/configuration'
 
-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 |
 |--|
-| `<variable-name>` |
+| `<response-code> [<config-file>]` |
 
 | parameter | description |
 | --------- | ----------- |
-| `<variable-name>` | Variable name in the MR  |
+| `<response-code>` | Expected http response code |
+| `<config-file>` |  Path json config file to compare the retrieved config with |
 
-## Function: mr_print ##
+## Function: pms_kube_pvc_reset ##
+Admin reset to remove all policies and services
+All types and instances etc are removed - types and instances in a1 sims need to be removed separately
+NOTE - only works in kubernetes and the pod should not be running
 
-Prints the value of a variable in the Message Router (MR) simulator.
-See the 'mrstub' dir for more details.
 | arg list |
 |--|
-| `<variable-name>` |
+| None |
 
-| parameter | description |
-| --------- | ----------- |
-| `<variable-name>` | Variable name in the MR  |
 
 # Description of functions in prodstub_api_functions.sh #
 
@@ -1976,7 +2361,7 @@ Start the Producer stub container in docker or kube depending on start mode
 |--|
 | None |
 
-## Function: prodstub_arm_producer() ##
+## 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.
 
@@ -1990,7 +2375,7 @@ Preconfigure the prodstub with a producer. The producer supervision response cod
 | `<producer-id>` | Id of the producer  |
 | `<forced_response_code>` | Forced response code for the producer callback url |
 
-## Function: prodstub_arm_job_create() ##
+## Function: prodstub_arm_job_create ##
 
 Preconfigure the prodstub with a job or update an existing job. Optional create/update job response code, if not given the response code will be set to 200/201 depending on if the job has been previously created or not.
 
@@ -2004,7 +2389,7 @@ Preconfigure the prodstub with a job or update an existing job. Optional create/
 | `<job-id>` | Id of the job  |
 | `<forced_response_code>` | Forced response code for the create callback url |
 
-## Function: prodstub_arm_job_delete() ##
+## Function: prodstub_arm_job_delete ##
 
 Preconfigure the prodstub with a job. Optional delete job response code, if not given the response code will be set to 204/404 depending on if the job exists or not.
 
@@ -2018,7 +2403,7 @@ Preconfigure the prodstub with a job. Optional delete job response code, if not
 | `<job-id>` | Id of the job  |
 | `<forced_response_code>` | Forced response code for the delete callback url |
 
-## Function: prodstub_arm_type() ##
+## Function: prodstub_arm_type ##
 
 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
 
@@ -2032,7 +2417,7 @@ Preconfigure the prodstub with a type for a producer. Can be called multiple tim
 | `<producer-id>` | Id of the producer  |
 | `<type-id>` | Id of the type  |
 
-## Function: prodstub_disarm_type() ##
+## Function: prodstub_disarm_type ##
 
 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
 
@@ -2046,7 +2431,7 @@ Remove a type for the producer in the rodstub. Can be called multiple times to r
 | `<producer-id>` | Id of the producer  |
 | `<type-id>` | Id of the type  |
 
-## Function: prodstub_check_jobdata() ##
+## Function: prodstub_check_jobdata ##
 
 Check a job in the prodstub towards the list of provided parameters.
 
@@ -2064,7 +2449,7 @@ Check a job in the prodstub towards the list of provided parameters.
 | `<job-owner>` | Id of the job owner  |
 | `<template-job-file>` | Path to a job template file  |
 
-## Function: prodstub_check_jobdata_2() ##
+## Function: prodstub_check_jobdata_2 ##
 
 Check a job in the prodstub towards the list of provided parameters.
 
@@ -2082,7 +2467,7 @@ Check a job in the prodstub towards the list of provided parameters.
 | `<job-owner>` | Id of the job owner  |
 | `<template-job-file>` | Path to a job template file  |
 
-## Function: prodstub_check_jobdata_3() ##
+## Function: prodstub_check_jobdata_3 ##
 
 Check a job in the prodstub towards the list of provided parameters.
 
@@ -2100,7 +2485,7 @@ Check a job in the prodstub towards the list of provided parameters.
 | `<job-owner>` | Id of the job owner  |
 | `<template-job-file>` | Path to a job template file  |
 
-## Function: prodstub_delete_jobdata() ##
+## Function: prodstub_delete_jobdata ##
 
 Delete the job parameters, job data, for a job.
 
@@ -2130,7 +2515,7 @@ 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 rapp_catalogue_api_function.sh #
+# Description of functions in rc_api_function.sh #
 
 ## Function: use_rapp_catalogue_http ##
 
@@ -2169,7 +2554,7 @@ See the 'cr' dir for more details.
 | `<target-value>` | Target value for the variable  |
 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
 
-## Function: rapp_cat_api_get_services() ##
+## Function: rapp_cat_api_get_services ##
 
 Check all registered services.
 
@@ -2186,7 +2571,7 @@ Check all registered services.
 | `<description>` | Description of the service  |
 | `EMPTY` | Indicator for an empty list  |
 
-## Function: rapp_cat_api_put_service() ##
+## Function: rapp_cat_api_put_service ##
 
 Register a services.
 
@@ -2202,7 +2587,7 @@ Register a services.
 | `<display-name>` | Dislay name of the service  |
 | `<description>` | Description of the service  |
 
-## Function: rapp_cat_api_get_service() ##
+## Function: rapp_cat_api_get_service ##
 
 Check a registered service.
 
@@ -2218,7 +2603,7 @@ Check a registered service.
 | `<display-name>` | Dislay name of the service  |
 | `<description>` | Description of the service  |
 
-## Function: rapp_cat_api_delete_service() ##
+## Function: rapp_cat_api_delete_service ##
 
 Check a registered service.
 
@@ -2231,7 +2616,7 @@ Check a registered service.
 | `<response-code>` | Expected http response code |
 | `<service-id>` | Id of the service  |
 
-# Description of functions in ricsimulator_api_functions.sh #
+# Description of functions in ricsim_api_functions.sh #
 
 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
 
@@ -2413,6 +2798,145 @@ The intention is to delay responses on the A1 interface. Setting remains until r
 | `<ric-id>` |  Id of the ric |
 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
 
+# Description of functions in sdnc_api_functions.sh #
+
+The file contains a selection of the possible API tests towards the SDNC (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_https ##
+
+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: stop_sdnc ##
+
+Stop the SDNC A1 Controller container and its database container
+| arg list |
+|--|
+| None |
+
+## Function: start_stopped_sdnc ##
+
+Start a previously stopped SDNC
+| 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: 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'
+To test the response payload, include the ids of the expexted response.
+
+| arg list |
+|--|
+| `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
+| `<ric-id>` | Id of the ric  |
+| `policy-type-id>` |  Id of the policy type |
+| `<policy-id>` |  Id of the policy |
+| `STD` |  Indicator of status of Standarized A1 |
+
+## Function: controller_api_get_A1_policy_type ##
+
+Test of GET a policy type (OSC only)
+
+| arg list |
+|--|
+| `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
+| `<ric-id>` | Id of the ric  |
+| `policy-type-id>` |  Id of the policy type |
+| `policy-type-file>` |  Optional schema file to compare the returned type with |
+
+## Function: controller_api_delete_A1_policy ##
+
+Deletes a policy instance
+
+| arg list |
+|--|
+| `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `STD` |  Indicator of status of Standarized A1 |
+| `<ric-id>` | Id of the ric  |
+| `<policy-id>` |  Id of the policy |
+| `policy-type-id>` |  Id of the policy type |
+| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
+| `policy-type-file>` |  Optional schema file to compare the returned type with |
+
+## Function: controller_api_put_A1_policy ##
+
+Creates a policy instance
+
+| arg list |
+|--|
+| `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `STD` |  Indicator of status of Standarized A1 |
+| `<ric-id>` | Id of the ric  |
+| `<policy-id>` |  Id of the policy |
+| `<template-file>` |  Path to the template file of the policy|
+| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
+| `<policy-type-id>` |  Id of the policy type |
+
+## Function: controller_api_get_A1_policy_status ##
+
+Checks the status of a policy
+
+ arg list |
+|--|
+| `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `STD` |  Indicator of status of Standarized A1 |
+| `<ric-id>` | Id of the ric  |
+| `<policy-id>` |  Id of the policy |
+| `<enforce-status>` |  Enforcement status |
+| `<reason>` |  Optional reason |
+| `OSC` |  Indicator of status of Non-Standarized OSC A1 |
+| `<policy-type-id>` |  Id of the policy type |
+| `<instance-status>` |  Instance status |
+| `<has-been-deleted>` |  Deleted status, true or false |
+
+
 ## License
 
 Copyright (C) 2020 Nordix Foundation. All rights reserved.
index 65dd0af..77b4da2 100755 (executable)
@@ -59,7 +59,7 @@ NEXUS_RELEASE_REPO_ORAN=$NEXUS_RELEASE_REPO
 
 
 # Policy Agent base image and tags
-POLICY_AGENT_IMAGE_BASE="o-ran-sc/nonrtric-policy-agent"
+POLICY_AGENT_IMAGE_BASE="o-ran-sc/nonrtric-a1-policy-management-service"
 POLICY_AGENT_IMAGE_TAG_LOCAL="2.3.0-SNAPSHOT"
 POLICY_AGENT_IMAGE_TAG_REMOTE_SNAPSHOT="2.3.0-SNAPSHOT"
 POLICY_AGENT_IMAGE_TAG_REMOTE="2.3.0"
@@ -83,10 +83,10 @@ CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE="2.3.0"
 
 # Gateway image and tags
 NRT_GATEWAY_IMAGE_BASE="o-ran-sc/nonrtric-gateway"
-NRT_GATEWAY_IMAGE_TAG_LOCAL="1.1.0-SNAPSHOT"
-NRT_GATEWAY_IMAGE_TAG_REMOTE_SNAPSHOT="1.1.0-SNAPSHOT"
-NRT_GATEWAY_IMAGE_TAG_REMOTE="1.1.0"
-NRT_GATEWAY_IMAGE_TAG_REMOTE_RELEASE="1.1.0"
+NRT_GATEWAY_IMAGE_TAG_LOCAL="1.0.0-SNAPSHOT"
+NRT_GATEWAY_IMAGE_TAG_REMOTE_SNAPSHOT="1.0.0-SNAPSHOT"
+NRT_GATEWAY_IMAGE_TAG_REMOTE="1.0.0"
+NRT_GATEWAY_IMAGE_TAG_REMOTE_RELEASE="1.0.0"
 
 
 # SDNC A1 Controller image and tags - Note using released honolulu ONAP image
@@ -116,10 +116,10 @@ SDNC_DB_IMAGE_TAG_REMOTE_PROXY="10.5"
 
 # 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"
+RAPP_CAT_IMAGE_TAG_LOCAL="1.0.1-SNAPSHOT"
+RAPP_CAT_IMAGE_TAG_REMOTE_SNAPSHOT="1.0.1-SNAPSHOT"
+RAPP_CAT_IMAGE_TAG_REMOTE="1.0.1"
+RAPP_CAT_IMAGE_TAG_REMOTE_RELEASE="1.0.1"
 
 
 # Near RT RIC Simulator image and tags - same version as cherry
index 0a25391..39f6284 100755 (executable)
@@ -884,6 +884,8 @@ else
 
                        exit 1
                fi
+               echo " Node(s) and container container runtime config"
+               kubectl get nodes -o wide | indent2
        fi
 fi