Enhanced ECS function tests
[nonrtric.git] / test / common / README.md
index 75b16b5..4cde532 100644 (file)
@@ -16,7 +16,7 @@ The included functions are described in detail further below.
 Common functions for running two or more auto test scripts as a suite.
 
 `api_curl.sh` \
-A common curl based function for the agent and ecs apis.
+A common curl based function for the agent and ecs apis. Also partly used for the Callback receiver api.
 
 `agent_api_functions.sh` \
 Contains functions for adapting towards the Policy Agent API, also via dmaap (using a message-router stub interface)
@@ -54,6 +54,8 @@ A python script to extract the information from an sdnc (A1 Controller) reply js
 `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)
 
+`cr_api_functions.sh` \
+Contains functions for adapting towards the Callback receiver for checking received callback event.
 
 
 # Description of functions in testcase_common.sh #
@@ -344,6 +346,12 @@ Start the ECS container.
 |--|
 | None |
 
+## Function: restart_ecs ##
+Restart the ECS container.
+| arg list |
+|--|
+| None |
+
 ## Function: use_ecs_rest_http ##
 Use http for all API calls to the ECS. This is the default protocol.
 | arg list |
@@ -415,21 +423,6 @@ Take a snap-shot of all logs for all running containers and stores them in `./lo
 | `<logfile-prefix>` | Log file prefix  |
 
 
-## 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: 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.
@@ -531,7 +524,7 @@ See the 'cr' dir for more details.
 | `<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.
+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.
 
@@ -749,15 +742,17 @@ Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
 
 | arg list |
 |--|
-| `<response-code> <policy-id> (STD <enforce-status> [<reason>])|(OSC <instance-status> <has-been-deleted>)` |
+| `<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 |
@@ -897,6 +892,30 @@ Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive
 | `<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 |
+
 # Description of functions in ricsimulator_api_functions.sh #
 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
 
@@ -1122,6 +1141,22 @@ Checks the status of a policy
 
 # Description of functions in ecs_api_function.sh #
 
+## Function: ecs_equal ##
+Tests if a variable value in the ECS 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 ecs  |
+| `<target-value>` | Target value for the variable  |
+| `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
+
 ## Function: ecs_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.
@@ -1336,14 +1371,13 @@ To test, provide all parameters. The list of type/schema pair may be empty.
 
 | arg list |
 |--|
-| `<response-code> <producer-id> <create-callback> <delete-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
+| `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
 
 | parameter | description |
 | --------- | ----------- |
 | `<response-code>` | Expected http response code |
 | `<producer-id>` | Id of the producer  |
-| `<create-callback>` | Callback for create job  |
-| `<delete-callback>` | Callback for delete job  |
+| `<job-callback>` | Callback for create/delete job  |
 | `<supervision-callback>` | Callback for producer supervision  |
 | `<type-id>` | Id of the EI type  |
 | `<schema-file>` | Path to a schema file  |
@@ -1463,6 +1497,20 @@ Check a job in the prodstub towards the list of provided parameters.
 | `<target-url>` | Target url for data delivery  |
 | `<template-job-file>` | Path to a job template file  |
 
+## Function: prodstub_delete_jobdata() ##
+Delete the job parameters, job data, for a job.
+
+| arg list |
+|--|
+| `<response-code> <producer-id> <job-id>` |
+
+| parameter | description |
+| --------- | ----------- |
+| `<response-code>` | Expected http response code |
+| `<producer-id>` | Id of the producer  |
+| `<job-id>` | Id of the job  |
+
+
 ## Function: prodstub_equal ##
 Tests if a variable value in the prodstub 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.
@@ -1478,6 +1526,39 @@ With the timeout, the test waits up to the timeout seconds before setting pass o
 | `<target-value>` | Target value for the variable  |
 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
 
+# Description of functions in cr_api_function.sh #
+
+
+
+## Function: cr_equal ##
+Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
+Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
+With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
+See the 'cr' dir for more details.
+| 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  |
+
 
 ## License