+## 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 |
+
+## Function: api_get_rics() ##
+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: '<ric-id>:<list-of-mes>:<list-of-policy-type-ids>'
+Example `<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
+
+| arg list |
+|--|
+| `<reponse-code> <policy-type-id>|NOTYPE [<space-separate-string-of-ricinfo>]` |
+
+| 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: api_put_service() ##
+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 |
+
+## Function: api_get_services() ##
+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.
+
+| 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() ##
+Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
+
+| arg list |
+|--|
+| `<response-code> [<service-name>]*` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-name>` | Service name |
+
+## Function: api_delete_services() ##
+Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
+
+| arg list |
+|--|
+| `<response-code> [<service-name>]*` |
+
+| 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'
+
+| arg list |
+|--|
+| <response-code> <service-name>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<service-name>` | Service name |
+
+## Function: api_put_configuration() ##
+Test of PUT '/v2/configuration'
+
+| arg list |
+|--|
+| <response-code> <config-file>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<config-file>` | Path json config file |
+
+## Function: api_get_configuration() ##
+Test of GET '/v2/configuration'
+
+| 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 |
+| parameter | description |
+| --------- | ----------- |
+| `[<response-code>]*` | A space separated list of http response codes, may be empty to reset to 'no codes'. |
+
+
+# Description of functions in consul_cbs_function.sh #
+
+
+## Function: consul_config_app ##
+Function to load a json config from a file into consul for the Policy Agent
+
+| arg list |
+|--|
+| `<json-config-file>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
+
+## Function: prepare_consul_config ##
+Function to prepare a Consul config based on the previously configured (and started simulators). Note that all simulator must be running and the test script has to configure if http or https shall be used for the components (this is done by the functions 'use_simulator_http', 'use_simulator_https', 'use_sdnc_http', 'use_sdnc_https', 'use_mr_http', 'use_mr_https')
+| arg list |
+|--|
+| `<deviation-message-to-print>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `SDNC|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
+| `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
+
+## Function: start_consul_cbs ##
+Start the Consul and CBS containers
+| arg list |
+|--|
+| None |
+
+# Description of functions in control_panel_api_function.sh #
+
+## Function: use_control_panel_http ##
+Set http as the protocol to use for all communication to the Control Panel
+| arg list |
+|--|
+| None |
+
+## Function: use_control_panel_https ##
+Set https as the protocol to use for all communication to the Control Panel
+| arg list |
+|--|
+| None |
+
+## Function: start_control_panel ##
+Start the Control Panel container
+| arg list |
+|--|
+| None |
+
+# Description of functions in controller_api_functions.sh #
+The file contains a selection of the possible API tests towards the a1-controller
+
+## Function: use_sdnc_http ##
+Use http for all API calls towards the SDNC A1 Controller. This is the default. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: use_sdnc_http ##
+Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
+| arg list |
+|--|
+| None |
+
+## Function: start_sdnc ##
+Start the SDNC A1 Controller container and its database container
+| arg list |
+|--|
+| None |
+
+## Function: 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 |
+
+
+# Description of functions in cr_api_functions.sh #
+
+## Function: use_cr_http ##
+Use http for getting event from CR. The admin API is not affected. This is the default.
+| arg list |
+|--|
+| None |
+
+## Function: use_cr_https ##
+Use https for getting event from CR. The admin API is not affected.
+Note: Not yet used as callback event is not fully implemented/deciced.
+| arg list |
+|--|
+| None |
+
+## Function: start_cr ##
+Start the Callback Receiver container in docker or kube depending on start mode.
+| arg list |
+|--|
+| None |
+
+## Function: cr_equal ##
+Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
+Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
+With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
+See the 'cr' dir for more details.
+| arg list |
+|--|
+| `<variable-name> <target-value> [ <timeout-in-sec> ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<variable-name>` | Variable name in the CR |
+| `<target-value>` | Target value for the variable |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
+
+## Function: cr_api_check_all_sync_events() ##
+Check the contents of all ric events received for a callback id.
+
+| arg list |
+|--|
+| `<response-code> <id> [ EMPTY | ( <ric-id> )+ ]` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<id>` | Id of the callback destination |
+| `EMPTY` | Indicator for an empty list |
+| `<ric-id>` | Id of the ric |
+
+# Description of functions in ecs_api_functions.sh #
+
+## Function: use_ecs_rest_http ##
+Use http for all API calls to the ECS. This is the default protocol.
+| arg list |
+|--|
+| None |
+
+## Function: use_ecs_rest_https ##
+Use https for all API calls to the ECS.
+| arg list |
+|--|
+| None |
+
+## Function: use_ecs_dmaap_http ##
+Send and recieve all API calls to the ECS over Dmaap via the MR using http.
+| arg list |
+|--|
+| None |
+
+## Function: use_ecs_dmaap_https ##
+Send and recieve all API calls to the ECS over Dmaap via the MR using https.
+| arg list |
+|--|
+| None |
+
+## Function: start_ecs ##
+Start the ECS container in docker or kube depending on running mode.
+| arg list |
+|--|
+| None |
+
+## Function: stop_ecs ##
+Stop the ECS container.
+| arg list |
+|--|
+| None |
+
+## Function: start_stopped_ecs ##
+Start a previously stopped ecs.
+| arg list |
+|--|
+| None |
+
+## Function: set_ecs_debug ##
+Configure the ECS log on debug level. The ECS must be running.
+| arg list |
+|--|
+| None |