BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 1 | #!/bin/bash |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 2 | |
| 3 | # ============LICENSE_START=============================================== |
| 4 | # Copyright (C) 2020 Nordix Foundation. All rights reserved. |
| 5 | # ======================================================================== |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # ============LICENSE_END================================================= |
| 18 | # |
| 19 | |
| 20 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 21 | TC_ONELINE_DESCR="Full agent API walkthrough using agent REST/DMAAP and with/without SDNC A1 Controller" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 22 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 23 | #App names to include in the test when running docker, space separated list |
| 24 | DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 25 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 26 | #App names to include in the test when running kubernetes, space separated list |
| 27 | KUBE_INCLUDED_IMAGES="CP CR MR PA RICSIM SDNC" |
| 28 | #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list |
| 29 | KUBE_PRESTARTED_IMAGES="" |
| 30 | |
| 31 | #Supported test environment profiles |
BjornMagnussonXA | 89b64ab | 2020-12-16 09:21:01 +0100 | [diff] [blame] | 32 | SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 33 | #Supported run modes |
| 34 | SUPPORTED_RUNMODES="DOCKER KUBE" |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 35 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 36 | . ../common/testcase_common.sh $@ |
| 37 | . ../common/agent_api_functions.sh |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 38 | . ../common/consul_cbs_functions.sh |
| 39 | . ../common/control_panel_api_functions.sh |
| 40 | . ../common/controller_api_functions.sh |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 41 | . ../common/cr_api_functions.sh |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 42 | . ../common/mr_api_functions.sh |
| 43 | . ../common/ricsimulator_api_functions.sh |
| 44 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 45 | |
| 46 | #### TEST BEGIN #### |
| 47 | |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 48 | generate_uuid |
| 49 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 50 | # Tested variants of REST/DMAAP/SDNC config |
| 51 | TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 52 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 53 | #Test agent and simulator protocol versions (others are http only) |
| 54 | TESTED_PROTOCOLS="HTTP HTTPS" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 55 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 56 | for __httpx in $TESTED_PROTOCOLS ; do |
| 57 | for interface in $TESTED_VARIANTS ; do |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 58 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 59 | echo "#####################################################################" |
| 60 | echo "#####################################################################" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 61 | echo "### Testing agent: $interface using $__httpx" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 62 | echo "#####################################################################" |
| 63 | echo "#####################################################################" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 64 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 65 | # Clean container and start all needed containers # |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 66 | clean_environment |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 67 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 68 | if [ $__httpx == "HTTPS" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 69 | use_cr_https |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 70 | use_agent_rest_https |
| 71 | else |
| 72 | use_agent_rest_http |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 73 | use_cr_http |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 74 | fi |
| 75 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 76 | start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/application.yaml |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 77 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 78 | set_agent_debug |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 79 | |
| 80 | # Create service to be able to receive events when rics becomes available |
| 81 | # Must use rest towards the agent since dmaap is not configured yet |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 82 | api_put_service 201 "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration" |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 83 | |
| 84 | |
| 85 | if [ $__httpx == "HTTPS" ]; then |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 86 | use_simulator_https |
| 87 | use_mr_https |
| 88 | if [[ $interface = *"SDNC"* ]]; then |
| 89 | use_sdnc_https |
| 90 | fi |
| 91 | if [[ $interface = *"DMAAP"* ]]; then |
| 92 | use_agent_dmaap_https |
| 93 | else |
| 94 | use_agent_rest_https |
| 95 | fi |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 96 | else |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 97 | use_simulator_http |
| 98 | use_mr_http |
| 99 | if [[ $interface = *"SDNC"* ]]; then |
| 100 | use_sdnc_http |
| 101 | fi |
| 102 | if [[ $interface = *"DMAAP"* ]]; then |
| 103 | use_agent_dmaap_http |
| 104 | else |
| 105 | use_agent_rest_http |
| 106 | fi |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 107 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 108 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 109 | start_ric_simulators ricsim_g1 1 OSC_2.1.0 |
| 110 | start_ric_simulators ricsim_g2 1 STD_1.1.3 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 111 | if [ "$PMS_VERSION" == "V2" ]; then |
| 112 | start_ric_simulators ricsim_g3 1 STD_2.0.0 |
| 113 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 114 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 115 | start_mr |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 116 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 117 | start_cr |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 118 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 119 | start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 120 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 121 | if [ $RUNMODE == "DOCKER" ]; then |
| 122 | start_consul_cbs |
| 123 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 124 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 125 | if [[ $interface = *"SDNC"* ]]; then |
| 126 | start_sdnc |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 127 | prepare_consul_config SDNC ".consul_config.json" |
| 128 | else |
| 129 | prepare_consul_config NOSDNC ".consul_config.json" |
| 130 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 131 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 132 | if [ $RUNMODE == "KUBE" ]; then |
| 133 | agent_load_config ".consul_config.json" |
| 134 | else |
| 135 | consul_config_app ".consul_config.json" |
| 136 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 137 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 138 | sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json |
| 139 | sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 140 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 141 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 142 | sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json |
| 143 | sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json |
| 144 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 145 | api_equal json:rics 3 300 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 146 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 147 | api_equal json:policy-types 5 120 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 148 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 149 | api_equal json:policies 0 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 150 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 151 | api_equal json:policy-instances 0 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 152 | else |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 153 | api_equal json:rics 2 300 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 154 | |
| 155 | api_equal json:policy_schemas 3 120 |
| 156 | |
| 157 | api_equal json:policy_types 3 |
| 158 | |
| 159 | api_equal json:policies 0 |
| 160 | |
| 161 | api_equal json:policy_ids 0 |
| 162 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 163 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 164 | if [ "$PMS_VERSION" == "V2" ]; then |
| 165 | cr_equal received_callbacks 3 120 |
| 166 | cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1 |
| 167 | fi |
| 168 | mr_equal requests_submitted 0 |
| 169 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 170 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 171 | echo "############################################" |
| 172 | echo "############## Health check ################" |
| 173 | echo "############################################" |
| 174 | |
| 175 | api_get_status 200 |
| 176 | |
| 177 | echo "############################################" |
| 178 | echo "##### Service registry and supervision #####" |
| 179 | echo "############################################" |
| 180 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 181 | api_get_services 404 "service1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 182 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 183 | api_put_service 201 "service1" 1000 "$CR_SERVICE_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 184 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 185 | api_put_service 200 "service1" 2000 "$CR_SERVICE_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 186 | |
| 187 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 188 | api_put_service 400 "service2" -1 "$CR_SERVICE_PATH/2" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 189 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 190 | api_put_service 400 "service2" "wrong" "$CR_SERVICE_PATH/2" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 191 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 192 | api_put_service 400 "service2" 100 "/test" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 193 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 194 | api_put_service 400 "service2" 100 "test-path" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 195 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 196 | api_put_service 201 "service2" 300 "ftp://localhost:80/test" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 197 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 198 | api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 199 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 200 | api_get_service_ids 200 "service1" "service2" "ric-registration" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 201 | |
| 202 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 203 | api_put_service 201 "service3" 5000 "$CR_SERVICE_PATH/3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 204 | |
| 205 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 206 | api_get_service_ids 200 "service1" "service2" "service3" "ric-registration" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 207 | |
| 208 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 209 | api_get_services 200 "service1" "service1" 2000 "$CR_SERVICE_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 210 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 211 | api_get_services 200 NOSERVICE "service1" 2000 "$CR_SERVICE_PATH/1" "service2" 300 "ftp://localhost:80/test" "service3" 5000 "$CR_SERVICE_PATH/3" "ric-registration" 0 "$CR_SERVICE_PATH/ric-registration" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 212 | |
| 213 | api_get_services 200 |
| 214 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 215 | deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx" |
| 216 | #The below should work, keept here until fixed or other decision made |
| 217 | #api_put_services_keepalive 201 "service1" |
| 218 | #Using the below until decision |
| 219 | api_put_services_keepalive 200 "service1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 220 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 221 | deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx" |
| 222 | #The below should work, keept here until fixed or other decision made |
| 223 | #api_put_services_keepalive 201 "service3" |
| 224 | #Using the below until decision |
| 225 | api_put_services_keepalive 200 "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 226 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 227 | api_put_services_keepalive 200 "service1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 228 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 229 | api_put_services_keepalive 200 "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 230 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 231 | api_put_services_keepalive 404 "service5" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 232 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 233 | api_get_service_ids 200 "service1" "service2" "service3" "ric-registration" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 234 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 235 | api_delete_services 204 "service1" |
| 236 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 237 | api_get_service_ids 200 "service2" "service3" "ric-registration" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 238 | |
| 239 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 240 | api_put_service 201 "service1" 50 "$CR_SERVICE_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 241 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 242 | api_get_service_ids 200 "service1" "service2" "service3" "ric-registration" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 243 | |
| 244 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 245 | api_delete_services 204 "service1" |
| 246 | api_delete_services 204 "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 247 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 248 | api_equal json:services 2 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 249 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 250 | api_delete_services 204 "service2" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 251 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 252 | api_equal json:services 1 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 253 | |
| 254 | |
| 255 | echo "############################################" |
| 256 | echo "############## RIC Repository ##############" |
| 257 | echo "############################################" |
| 258 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 259 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 260 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 261 | else |
| 262 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE" |
| 263 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 264 | api_get_rics 200 1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE" |
| 265 | |
| 266 | api_get_rics 404 47 |
| 267 | |
| 268 | api_get_rics 404 "test" |
| 269 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 270 | if [ "$PMS_VERSION" == "V2" ]; then |
| 271 | api_get_ric 200 me1_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 272 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 273 | api_get_ric 200 me2_ricsim_g1_1 NORIC "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 274 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 275 | api_get_ric 200 me1_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 276 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 277 | api_get_ric 200 me2_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 278 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 279 | api_get_ric 200 me1_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE" |
| 280 | |
| 281 | api_get_ric 200 me2_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE" |
| 282 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 283 | api_get_ric 200 NOME ricsim_g1_1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 284 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 285 | api_get_ric 200 NOME ricsim_g2_1 "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 286 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 287 | api_get_ric 200 NOME ricsim_g3_1 "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE" |
| 288 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 289 | api_get_ric 404 NOME test1 |
| 290 | |
| 291 | api_get_ric 404 test NORIC |
| 292 | |
| 293 | api_get_ric 400 me1_ricsim_g1_1 ricsim_g1_1 |
| 294 | |
| 295 | api_get_ric 400 me1_ricsim_g1_1 TESTRIC |
| 296 | |
| 297 | api_get_ric 400 TESTME ricsim_g1_1 |
| 298 | |
| 299 | else |
| 300 | api_get_ric 200 me1_ricsim_g1_1 ricsim_g1_1 |
| 301 | |
| 302 | api_get_ric 200 me2_ricsim_g1_1 ricsim_g1_1 |
| 303 | |
| 304 | api_get_ric 200 me1_ricsim_g2_1 ricsim_g2_1 |
| 305 | |
| 306 | api_get_ric 200 me2_ricsim_g2_1 ricsim_g2_1 |
| 307 | |
| 308 | api_get_ric 404 test |
| 309 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 310 | |
| 311 | echo "############################################" |
| 312 | echo "########### A1 Policy Management ###########" |
| 313 | echo "############################################" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 314 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 315 | if [ "$PMS_VERSION" == "V2" ]; then |
| 316 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 317 | #Behaviour accepted for now |
| 318 | api_get_policy_type 200 1 testdata/OSC/1-agent-modified.json |
| 319 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 320 | #Behaviour accepted for now |
| 321 | api_get_policy_type 200 2 testdata/OSC/2-agent-modified.json |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 322 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 323 | #Behaviour accepted for now |
| 324 | api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-agent-modified.json |
| 325 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 326 | #Behaviour accepted for now |
| 327 | api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-agent-modified.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 328 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 329 | api_get_policy_type 404 3 |
| 330 | else |
| 331 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 332 | #Behaviour accepted for now |
| 333 | api_get_policy_schema 200 1 testdata/OSC/1-agent-modified.json |
| 334 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 335 | #Behaviour accepted for now |
| 336 | api_get_policy_schema 200 2 testdata/OSC/2-agent-modified.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 337 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 338 | api_get_policy_schema 404 3 |
| 339 | fi |
| 340 | |
| 341 | if [ "$PMS_VERSION" == "V2" ]; then |
| 342 | api_get_policy_schemas 404 |
| 343 | else |
| 344 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 345 | #Behaviour accepted for now |
| 346 | api_get_policy_schemas 200 NORIC testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json NOFILE |
| 347 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 348 | #Behaviour accepted for now |
| 349 | api_get_policy_schemas 200 ricsim_g1_1 testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json |
| 350 | |
| 351 | api_get_policy_schemas 200 ricsim_g2_1 NOFILE |
| 352 | |
| 353 | api_get_policy_schemas 404 test |
| 354 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 355 | |
| 356 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 357 | if [ "$PMS_VERSION" == "V2" ]; then |
| 358 | api_get_policy_types 200 NORIC 1 2 EMPTY STD_QOS_0_2_0 STD_QOS2_0.1.0 |
| 359 | else |
| 360 | api_get_policy_types 200 NORIC 1 2 EMPTY |
| 361 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 362 | |
| 363 | api_get_policy_types 200 ricsim_g1_1 1 2 |
| 364 | |
| 365 | api_get_policy_types 200 ricsim_g2_1 EMPTY |
| 366 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 367 | if [ "$PMS_VERSION" == "V2" ]; then |
| 368 | api_get_policy_types 200 ricsim_g3_1 STD_QOS_0_2_0 STD_QOS2_0.1.0 |
| 369 | fi |
| 370 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 371 | api_get_policy_types 404 dummy-ric |
| 372 | |
| 373 | |
| 374 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 375 | api_put_service 201 "service10" 3600 "$CR_SERVICE_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 376 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 377 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 378 | notificationurl=$CR_SERVICE_PATH"/test" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 379 | else |
| 380 | notificationurl="" |
| 381 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 382 | deviation "TR10 - agent allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx" |
| 383 | #Kept until decison |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 384 | #api_put_policy 400 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 385 | #Allow 201 for now |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 386 | api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 387 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 388 | api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json |
| 389 | api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 390 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 391 | api_put_policy 200 "service10" ricsim_g1_1 1 5000 true $notificationurl testdata/OSC/pi1_template.json |
| 392 | api_put_policy 200 "service10" ricsim_g1_1 1 5000 false $notificationurl testdata/OSC/pi1_template.json |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 393 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 394 | api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json |
| 395 | api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 396 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 397 | api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json |
| 398 | api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 399 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 400 | if [ "$PMS_VERSION" == "V2" ]; then |
| 401 | api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json |
| 402 | api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json |
| 403 | |
| 404 | api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 true $notificationurl testdata/STD2/pi_qos2_template.json |
| 405 | api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 false $notificationurl testdata/STD2/pi_qos2_template.json |
| 406 | fi |
| 407 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 408 | VAL='NOT IN EFFECT' |
| 409 | api_get_policy_status 200 5000 OSC "$VAL" "false" |
| 410 | api_get_policy_status 200 5100 STD "UNDEFINED" |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 411 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 412 | api_get_policy_status 200 5200 STD2 EMPTY EMPTY |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 413 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 414 | |
| 415 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 416 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 417 | #kept until decision |
| 418 | #api_equal json:policies 2 |
| 419 | #Allow 3 for now |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 420 | if [ "$PMS_VERSION" == "V2" ]; then |
| 421 | api_equal json:policies 4 |
| 422 | else |
| 423 | api_equal json:policies 3 |
| 424 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 425 | |
| 426 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 427 | #kept until decision |
| 428 | #api_equal json:policy_ids 2 |
| 429 | #Allow 3 for now |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 430 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 431 | api_equal json:policy-instances 4 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 432 | else |
| 433 | api_equal json:policy_ids 3 |
| 434 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 435 | |
| 436 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 437 | #kept until decision |
| 438 | #api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 |
| 439 | #Allow policy create with unregistered service for now |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 440 | if [ "$PMS_VERSION" == "V2" ]; then |
| 441 | api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 5200 |
| 442 | else |
| 443 | api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 |
| 444 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 445 | |
| 446 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 447 | #kept until decision |
| 448 | #api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 |
| 449 | #Allow policy create with unregistered service for now |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 450 | if [ "$PMS_VERSION" == "V2" ]; then |
| 451 | api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 452 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 453 | api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100 |
| 454 | |
| 455 | api_get_policy_ids 200 ricsim_g3_1 NOSERVICE NOTYPE 5200 |
| 456 | |
| 457 | api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 5200 |
| 458 | else |
| 459 | api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000 |
| 460 | |
| 461 | api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 462 | |
| 463 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 464 | api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 |
| 465 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 466 | |
| 467 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 468 | #kept until decision |
| 469 | #api_get_policy_ids 200 NORIC NOSERVICE 1 5000 |
| 470 | #Allow policy create with unregistered service for now |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 471 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 472 | api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 473 | |
| 474 | api_get_policy_ids 200 NORIC NOSERVICE 2 NOID |
| 475 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 476 | if [ "$PMS_VERSION" == "V2" ]; then |
| 477 | api_get_policy_ids 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200 |
| 478 | fi |
| 479 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 480 | api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID |
| 481 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 482 | if [ "$PMS_VERSION" == "V2" ]; then |
| 483 | api_get_policy 200 5000 testdata/OSC/pi1_template.json "service10" ricsim_g1_1 1 false $notificationurl |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 484 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 485 | api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 486 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 487 | api_get_policy 200 5200 testdata/STD2/pi_qos2_template.json "service10" ricsim_g3_1 STD_QOS2_0.1.0 false $notificationurl |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 488 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 489 | api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 490 | else |
| 491 | api_get_policy 200 5000 testdata/OSC/pi1_template.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 492 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 493 | api_get_policy 200 5100 testdata/STD/pi1_template.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 494 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 495 | api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 testdata/OSC/pi1_template.json |
| 496 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 497 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 498 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 499 | #kept until decision |
| 500 | #api_delete_policy 404 2000 |
| 501 | #Allow policy create with unregistered service for now |
| 502 | api_delete_policy 204 2000 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 503 | |
| 504 | api_delete_policy 404 1500 |
| 505 | |
| 506 | api_delete_policy 204 5000 |
| 507 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 508 | if [ "$PMS_VERSION" == "V2" ]; then |
| 509 | |
| 510 | api_delete_policy 204 5200 |
| 511 | fi |
| 512 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 513 | api_equal json:policies 1 |
| 514 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 515 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 516 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 517 | api_equal json:policy-instances 1 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 518 | else |
| 519 | api_equal json:policy_ids 1 |
| 520 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 521 | |
| 522 | api_delete_policy 204 5100 |
| 523 | |
| 524 | api_equal json:policies 0 |
| 525 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 526 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 527 | api_equal json:policy-instances 0 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 528 | else |
| 529 | api_equal json:policy_ids 0 |
| 530 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 531 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 532 | if [ "$PMS_VERSION" == "V2" ]; then |
| 533 | cr_equal received_callbacks 3 |
| 534 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 535 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 536 | if [[ $interface = *"DMAAP"* ]]; then |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 537 | mr_greater requests_submitted 0 |
| 538 | VAL=$(mr_read requests_submitted) |
| 539 | mr_equal requests_fetched $VAL |
| 540 | mr_equal responses_submitted $VAL |
| 541 | mr_equal responses_fetched $VAL |
| 542 | mr_equal current_requests 0 |
| 543 | mr_equal current_responses 0 |
| 544 | else |
| 545 | mr_equal requests_submitted 0 |
| 546 | fi |
| 547 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 548 | if [[ $interface = *"SDNC"* ]]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 549 | sim_contains_str ricsim_g1_1 remote_hosts $SDNC_APP_NAME |
| 550 | sim_contains_str ricsim_g2_1 remote_hosts $SDNC_APP_NAME |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 551 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 552 | sim_contains_str ricsim_g3_1 remote_hosts $SDNC_APP_NAME |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 553 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 554 | else |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 555 | sim_contains_str ricsim_g1_1 remote_hosts $POLICY_AGENT_APP_NAME |
| 556 | sim_contains_str ricsim_g2_1 remote_hosts $POLICY_AGENT_APP_NAME |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 557 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 558 | sim_contains_str ricsim_g3_1 remote_hosts $POLICY_AGENT_APP_NAME |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 559 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 560 | fi |
| 561 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 562 | check_policy_agent_logs |
| 563 | check_control_panel_logs |
| 564 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 565 | if [[ $interface = *"SDNC"* ]]; then |
| 566 | check_sdnc_logs |
| 567 | fi |
| 568 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 569 | store_logs "${__httpx}__${interface}" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 570 | |
| 571 | done |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 572 | |
| 573 | done |
| 574 | |
| 575 | #### TEST COMPLETE #### |
| 576 | |
| 577 | |
| 578 | print_result |
| 579 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 580 | auto_clean_environment |