From: John Keeney Date: Fri, 19 Jun 2020 11:23:36 +0000 (+0000) Subject: Merge "Update Release Notes for Bronze" X-Git-Tag: 2.0.1~18 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=bee5b1771393f08c55011f3ed3efc924a5878e70;hp=76c959ffac35fc207a63e3b8f509ab660db04e6c;p=nonrtric.git Merge "Update Release Notes for Bronze" --- diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index 01b84873..36ae9d22 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -15,21 +15,21 @@ Prerequisites 1. Java development kit (JDK), version 11 2. Maven dependency-management tool, version 3.6 or later -3. Python, version 2 or later +3. Python, version 2 4. Docker, version 19.03.1 or latest 5. Docker Compose, version 1.24.1 or latest Build and run ------------- Go to the northbound directory and run this command :: - mvn clean install -Dmaven.test.skip=true + mvn clean install This will build the project and create artifcats in maven repo Go to oam/installation directory and run this command :: mvn clean install -P docker -This will create the docker images required for a1-controller. +This will create the docker images required for A1 controller. After this step check for the docker images created by the maven build with this command :: docker images | grep a1-controller @@ -37,10 +37,10 @@ After this step check for the docker images created by the maven build with this Go to oam/installation/src/main/yaml and run this command :: docker-compose up -d a1-controller -This will create the docker containers with the a1-controller image, you can check the status of the docker container using :: +This will create the docker containers with the A1 controller image, you can check the status of the docker container using :: docker-compose logs -f a1-controller -The Open Daylight GUI url to access the Northbound API, +The SDNC url to access the Northbound API, http://localhost:8282/apidoc/explorer/index.html Credentials: admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U diff --git a/test/auto-test/FTC1.sh b/test/auto-test/FTC1.sh index d9a88b17..2eaf0f39 100755 --- a/test/auto-test/FTC1.sh +++ b/test/auto-test/FTC1.sh @@ -68,15 +68,8 @@ for __httpx in $TESTED_PROTOCOLS ; do start_mr if [ $__httpx == "HTTPS" ]; then - - deviation "TR17 - agent cannot use https towards MR - test combo $interface and $__httpx" - #This is the intention #echo "Using secure ports between agent and MR" - #use_mr_https - - #Work around until it is fixed - #"Using non-secure ports between agent and MR" - use_mr_http + use_mr_https else #"Using non-secure ports between agent and MR" use_mr_http diff --git a/test/auto-test/FTC100.sh b/test/auto-test/FTC100.sh index 6f90437e..0c4af6bf 100755 --- a/test/auto-test/FTC100.sh +++ b/test/auto-test/FTC100.sh @@ -68,15 +68,8 @@ for __httpx in $TESTED_PROTOCOLS ; do start_mr if [ $__httpx == "HTTPS" ]; then - - deviation "TR17 - agent cannot use https towards MR - test combo $interface and $__httpx" - #This is the intention #echo "Using secure ports between agent and MR" - #use_mr_https - - #Work around until it is fixed - #"Using non-secure ports between agent and MR" - use_mr_http + use_mr_https else #"Using non-secure ports between agent and MR" use_mr_http diff --git a/test/auto-test/FTC300.sh b/test/auto-test/FTC300.sh index 2ab4385b..d9bca7df 100755 --- a/test/auto-test/FTC300.sh +++ b/test/auto-test/FTC300.sh @@ -53,9 +53,13 @@ for __httpx in $TESTED_PROTOCOLS ; do clean_containers if [ $__httpx == "HTTPS" ]; then + #echo "Using secure ports between agent and MR" + use_mr_https echo "Using secure ports towards simulators" use_simulator_https else + #"Using non-secure ports between agent and MR" + use_mr_http echo "Using non-secure ports towards simulators" use_simulator_http fi diff --git a/test/auto-test/FTC800.sh b/test/auto-test/FTC800.sh index e97f3ff6..1bb6578f 100755 --- a/test/auto-test/FTC800.sh +++ b/test/auto-test/FTC800.sh @@ -70,15 +70,8 @@ for __httpx in $TESTED_PROTOCOLS ; do start_mr if [ $__httpx == "HTTPS" ]; then - - deviation "TR17 - agent cannot use https towards MR - test combo $interface and $__httpx" - #This is the intention #echo "Using secure ports between agent and MR" - #use_mr_https - - #Work around until it is fixed - #"Using non-secure ports between agent and MR" - use_mr_http + use_mr_https else #"Using non-secure ports between agent and MR" use_mr_http diff --git a/test/common/README.md b/test/common/README.md index a048c646..9f8af39e 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -47,7 +47,7 @@ A script for executing a curl call with a specific url and optional payload. It -### Descriptions of functions in testcase_common.sh ### +## Descriptions of functions in testcase_common.sh ## #### Script args #### The script can be started with these arguments @@ -326,28 +326,605 @@ Take a snap-shot of all logs for all running containers and stores them in `./lo #### Function: cr_equal #### -TBD +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 | +|--| +| ` [ ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the CR | +| `` | Target value for the variable | +| `` | Max time to wait for the variable to reach the target value | #### Function: mr_equal #### -TBD +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 | +|--| +| ` [ ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the MR | +| `` | Target value for the variable | +| `` | Max time to wait for the variable to reach the target value | #### Function: mr_greater #### -TBD +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 | +|--| +| ` [ ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the MR | +| `` | Target value for the variable | +| `` | Max time to wait for the variable to become grater than the target value | #### Function: mr_read #### -TBD +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 | +|--| +| `` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the MR | #### Function: mr_print #### -TBD - -### Descriptions of functions in testsuite_common.sh ### -TBD -### Descriptions of functions in agent_api_function.sh ### -TBD -### Descriptions of functions in ricsimulator_api_functions.sh ### -TBD -### Descriptions of functions in controller_api_functions.sh ### -TBD +Prints the value of a variable in the Message Router (MR) simulator. +See the 'mrstub' dir for more details. +| arg list | +|--| +| `` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the MR | + +## Descriptions of functions in testsuite_common.sh ## +#### Function: suite_setup #### +Sets up the test suite and prints out a heading. +| arg list | +|--| +| None | + +#### suite_complete #### +Print out the overall result of the executed test cases. +| arg list | +|--| +| None | + +## Descriptions of functions in agent_api_function.sh ## +#### 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 | +|--| +| ` [ ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types | +| `` | Target value for the length | +| `` | Max time to wait for the length to reach the target value | + +#### Function: api_get_policies() #### +Test of GET '/policies' 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 parameters for each expected policy. +| arg list | +|--| +| ` |NORIC |NOSERVICE |NOTYPE [ NOID | [ EMPTY| ]*]` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | +| `NORIC` | Indicator that no ric is provided | +| `` | Id of the service | +| `NOSERVICE` | Indicator that no service id is provided | +| `` | 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| +| `` | Id of the policy | +| `EMPTY` | Indicate for the special empty policy type | +| `` | Path to the template file for the policy (same template used when creating the policy) | + + +#### Function: api_get_policy() #### +Test of GET /policy 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 | +|--| +| ` []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the policy | +| `` | Path to the template file for the policy (same template used when creating the policy) | + +#### Function: api_put_policy() #### +Test of PUT '/policy'. +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 parameters for each expected policy. +| arg list | +|--| +| ` []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the service | +| `` | Id of the ric | +| `` | Id of the policy type | +| `` | 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) | +| `` | Path to the template file for the policy | +| `` | 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 | +|--| +| ` ` + +| `` | Expected http response code | +| `` | Id of the service | +| `` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing | +| `` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id | +| `` | Id of the policy type | +| `` | 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) | +| `` | Path to the template file for the policy | +| `` | Number of policies per ric | +| `` | Number of threads (processes) to run in parallel | + +#### Function: api_delete_policy() #### +This tests the DELETE /policy. Removes the indicated policy or a 'count' number of policies starting with 'policy-id' as the first id. +| arg list | +|--| +| ` []` + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the policy | +| `` | 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 | +|--| +| ` ` + +| `` | Expected http response code | +| `` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing | +| `` | The number of rics, assuming the first index is '1' | +| `` | Id of the policy. This value shall be a numeric value and will be the id of the first policy | +| `` | Number of policies per ric | +| `` | Number of threads (processes) to run in parallel | + + +#### Function: api_get_policy_ids() #### + +Test of GET '/policy_ids'. +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 | +|--| +| ` |NORIC |NOSERVICE |NOTYPE ([` | Expected http response code | +| `` | Id of the ric | +| `NORIC` | Indicator that no ric is provided | +| `` | 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| +| `` | Id of the policy | + +#### 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 | +|--| +| ` []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the policy type | +| `` | 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 | +|--| +| ` |NORIC [|NOFILE]*` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | +| `NORIC` | No ric id given | +| `` | 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. +| arg list | +|--| +| ` (STD [])|(OSC )` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the policy | +| `STD` | Indicator of status of Standarized A1 | +| `` | Enforcement status | +| `` | Optional reason | +| `OSC` | Indicator of status of Non-Standarized OSC A1 | +| `` | Instance status | +| `` | Deleted status, true or false | + +#### Function: api_get_policy_types() #### +Test of GET /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 | +|--| +| ` [|NORIC [|EMPTY []*]]` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | +| `NORIC` | No ric id given | +| `` | Id of the policy type | +| `EMPTY` | Indicate the empty type | + +#### Function: api_get_status() #### +Test of GET /status +| arg list | +|--| +| `` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | + +#### Function: api_get_ric() #### +Test of GET /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 | +|--| +| ` []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the managed element | +| `` | Id of the ric | + +#### Function: api_get_rics() #### +Test of GET /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: '::' +Example ` = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."` +| arg list | +|--| +| ` |NOTYPE []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Policy type id of the ric | +| `NOTYPE>` | No type given | +| `` | A space separated string of ric info - needs to be quoted | + +#### Function: api_put_service() #### +Test of PUT /service +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Service name | +| `` | Timeout value | +| `` | Callback url | + +#### Function: api_get_services() #### +Test of GET /service 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 | +|--| +| ` [ ( ) | (NOSERVICE [ ]* )]` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| ` | Service name for the query | +| ` | Target service name| +| `` | Timeout value | +| `` | Callback url | +| `NOSERVICE` | Indicator of no target service name | + +#### Function: api_get_service_ids() #### +Test of GET /services +| arg list | +|--| +| ` []*` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Service name | + +#### Function: api_delete_services() #### +Test of DELETE /services +| arg list | +|--| +| ` []*` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Service name | + +#### Function: api_put_services_keepalive() #### +Test of PUT /services/keepalive +| arg list | +|--| +| ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Service name | + +## Descriptions of functions in ricsimulator_api_functions.sh ## +The functions below only use the admin interface of the simulator, no usage of the A1 interface. + +#### Function: sim_equal #### +Tests if a variable value in the RIC simulator is equal to a target value. +Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not. +With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not. +See the 'a1-interface' repo for more details. +| arg list | +|--| +| ` [ ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the ric simulator | +| `` | Target value for the variable | +| `` | Max time to wait for the variable to reach the target value | + +#### Function: sim_print #### +Prints the value of a variable in the RIC simulator. +See the 'a1-interface' repo for more details. +| arg list | +|--| +| `` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the RIC simulator | + + +#### Function: sim_contains_str #### +Tests if a variable value in the RIC simulator contains a target string. +Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not. +With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value contains the target string or not. +See the 'a1-interface' repo for more details. +| arg list | +|--| +| ` [ ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Variable name in the ric simulator | +| `` | Target substring for the variable | +| `` | Max time to wait for the variable to reach the target value | + +#### Function: sim_put_policy_type #### +Loads a policy type to the simulator +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | +| `` | Id of the policy type | +| `` | Path to the schema file of the policy type | + +#### Function: sim_delete_policy_type #### +Deletes a policy type from the simulator +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | +| `` | Id of the policy type | + +#### Function: sim_post_delete_instances #### +Deletes all instances (and status), for one ric +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | + + +#### Function: sim_post_delete_all #### +Deletes all types, instances (and status), for one ric +| arg list | +|--| +| ` ` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | + +#### Function: sim_post_forcedresponse #### +Sets (or resets) response code for next (one) A1 message, for one ric. +The intention is to simulate error response on the A1 interface. +| arg list | +|--| +| ` []`| + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | +| `` | Http response code to send | + +#### Function: sim_post_forcedelay #### +Sets (or resets) A1 response delay, for one ric +The intention is to delay responses on the A1 interface. Setting remains until removed. +| arg list | +|--| +| ` []`| + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `` | Id of the ric | +| `` | Delay in seconds. If omitted, the delay is removed | + + +## Descriptions of functions in controller_api_functions.sh ## +The file contains a selection of the possible API tests towards the a1-controller + +#### 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 | +|--| +| ` (OSC [ []* ]) | ( STD [ []* ]` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `OSC` | Indicator of status of Non-Standarized OSC A1 | +| `` | Id of the ric | +| `policy-type-id>` | Id of the policy type | +| `` | 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 | +|--| +| ` OSC []` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `OSC` | Indicator of status of Non-Standarized OSC A1 | +| `` | 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 ) | (OSC )` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `STD` | Indicator of status of Standarized A1 | +| `` | Id of the ric | +| `` | 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 | +|--| +| ` (STD ) | (OSC )` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `STD` | Indicator of status of Standarized A1 | +| `` | Id of the ric | +| `` | Id of the policy | +| `` | Path to the template file of the policy| +| `OSC` | Indicator of status of Non-Standarized OSC A1 | +| `` | Id of the policy type | + +#### Function: controller_api_get_A1_policy_status #### +Checks the status of a policy + arg list | +|--| +| ` (STD []) | (OSC )` | + +| parameter | description | +| --------- | ----------- | +| `` | Expected http response code | +| `STD` | Indicator of status of Standarized A1 | +| `` | Id of the ric | +| `` | Id of the policy | +| `` | Enforcement status | +| `` | Optional reason | +| `OSC` | Indicator of status of Non-Standarized OSC A1 | +| `` | Id of the policy type | +| `` | Instance status | +| `` | Deleted status, true or false | ## License diff --git a/test/common/agent_api_functions.sh b/test/common/agent_api_functions.sh index 550ace0e..1e1077b2 100644 --- a/test/common/agent_api_functions.sh +++ b/test/common/agent_api_functions.sh @@ -382,7 +382,7 @@ api_put_policy() { ((RES_TEST++)) if [ $# -lt 7 ] || [ $# -gt 8 ]; then - __print_err " []" $@ + __print_err " |NOTRANSIENT []" $@ return 1 fi diff --git a/test/common/test_env.sh b/test/common/test_env.sh index 11c3b6d2..a06efe27 100755 --- a/test/common/test_env.sh +++ b/test/common/test_env.sh @@ -112,7 +112,7 @@ export MR_INTERNAL_PORT=3905 # MR stub contai export MR_EXTERNAL_SECURE_PORT=3906 # MR stub container external secure port (host -> container) export MR_INTERNAL_SECURE_PORT=3906 # MR stub container internal secure port (container -> container) export MR_APP_NAME="message-router" # Name for the MR -export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent" # Path to read messages from MR +export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE" # Path write messages to MR export CR_EXTERNAL_PORT=8090 # Callback receiver container external port (host -> container) diff --git a/test/mrstub/app/main.py b/test/mrstub/app/main.py index 5bb09885..8804a044 100644 --- a/test/mrstub/app/main.py +++ b/test/mrstub/app/main.py @@ -211,6 +211,12 @@ def events_write(): try: answer=request.json print(AGENT_WRITE_URL+ " json=" + json.dumps(answer, indent=2)) + if isinstance(answer, dict): + #Create a an array if the answer is a dict (single message) + answer_list=[] + answer_list.append(answer) + answer=answer_list + for item in answer: id=item['correlationId'] if (id is None): diff --git a/test/mrstub/basic_test.sh b/test/mrstub/basic_test.sh index e9ca1d25..8b2347dc 100755 --- a/test/mrstub/basic_test.sh +++ b/test/mrstub/basic_test.sh @@ -72,7 +72,7 @@ RESULT="json:[{\"apiVersion\":\"1.0\",\"operation\":\"PUT\",\"correlationId\":\" do_curl GET '/events/A1-POLICY-AGENT-READ/users/policy-agent' 200 echo "=== Send a json response ===" -# Create minimal accepted response message +# Create minimal accepted response message, array echo "[{\"correlationId\": \""$CORRID"\", \"message\": {\"test\":\"testresponse\"}, \"status\": \"200\"}]" > .tmp.json RESULT="{}" do_curl POST /events/A1-POLICY-AGENT-WRITE 200 .tmp.json @@ -81,6 +81,16 @@ echo "=== Fetch a response ===" RESULT="{\"test\": \"testresponse\"}200" do_curl GET '/receive-response?correlationid='$CORRID 200 +echo "=== Send a json response ===" +# Create minimal accepted response message, single message - no array +echo "{\"correlationId\": \""$CORRID"\", \"message\": {\"test\":\"testresponse2\"}, \"status\": \"200\"}" > .tmp.json +RESULT="{}" +do_curl POST /events/A1-POLICY-AGENT-WRITE 200 .tmp.json + +echo "=== Fetch a response ===" +RESULT="{\"test\": \"testresponse2\"}200" +do_curl GET '/receive-response?correlationid='$CORRID 200 + ### Test with plain text response echo "=== Send a request ==="