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