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 | |
| 21 | TC_ONELINE_DESCR="Full agent API walk through using agent REST/DMAAP and with/without SDNC A1 Controller" |
| 22 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 23 | #App names to exclude checking pulling images for, space separated list |
| 24 | EXCLUDED_IMAGES="SDNC_ONAP" |
| 25 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 26 | . ../common/testcase_common.sh $@ |
| 27 | . ../common/agent_api_functions.sh |
| 28 | . ../common/ricsimulator_api_functions.sh |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 29 | |
| 30 | #### TEST BEGIN #### |
| 31 | |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 32 | generate_uuid |
| 33 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 34 | # Tested variants of REST/DMAAP/SDNC config |
| 35 | TESTED_VARIANTS="REST DMAAP REST+SDNC DMAAP+SDNC" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 36 | #Test agent and simulator protocol versions (others are http only) |
| 37 | TESTED_PROTOCOLS="HTTP HTTPS" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 38 | for __httpx in $TESTED_PROTOCOLS ; do |
| 39 | for interface in $TESTED_VARIANTS ; do |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 40 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 41 | echo "#####################################################################" |
| 42 | echo "#####################################################################" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 43 | echo "### Testing agent: $interface using $__httpx" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 44 | echo "#####################################################################" |
| 45 | echo "#####################################################################" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 46 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 47 | #Local vars in test script |
| 48 | ########################## |
| 49 | |
| 50 | if [ $__httpx == "HTTPS" ]; then |
| 51 | # Path to callback receiver |
| 52 | CR_PATH="https://$CR_APP_NAME:$CR_EXTERNAL_SECURE_PORT/callbacks" |
| 53 | use_cr_https |
| 54 | else |
| 55 | # Path to callback receiver |
| 56 | CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks" |
| 57 | use_cr_http |
| 58 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 59 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 60 | # Clean container and start all needed containers # |
| 61 | clean_containers |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 62 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 63 | if [ $__httpx == "HTTPS" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 64 | #"Using secure ports towards simulators" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 65 | use_simulator_https |
| 66 | else |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 67 | #"Using non-secure ports towards simulators" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 68 | use_simulator_http |
| 69 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 70 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 71 | start_ric_simulators ricsim_g1 1 OSC_2.1.0 |
| 72 | start_ric_simulators ricsim_g2 1 STD_1.1.3 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 73 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 74 | start_mr |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 75 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 76 | if [ $__httpx == "HTTPS" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 77 | #echo "Using secure ports between agent and MR" |
BjornMagnussonXA | 0f9d517 | 2020-06-17 15:43:39 +0200 | [diff] [blame] | 78 | use_mr_https |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 79 | else |
| 80 | #"Using non-secure ports between agent and MR" |
| 81 | use_mr_http |
| 82 | fi |
| 83 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 84 | start_cr |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 85 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 86 | if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then |
| 87 | |
| 88 | start_sdnc |
| 89 | |
| 90 | if [ $__httpx == "HTTPS" ]; then |
| 91 | # "Using secure ports towards SDNC" |
| 92 | use_sdnc_https |
| 93 | else |
| 94 | #"Using non-secure ports towards SDNC" |
| 95 | use_sdnc_http |
| 96 | fi |
| 97 | fi |
| 98 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 99 | start_consul_cbs |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 100 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 101 | if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then |
| 102 | prepare_consul_config SDNC ".consul_config.json" |
| 103 | else |
| 104 | prepare_consul_config NOSDNC ".consul_config.json" |
| 105 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 106 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 107 | consul_config_app ".consul_config.json" |
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_control_panel |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 110 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 111 | start_policy_agent |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 112 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 113 | set_agent_debug |
| 114 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 115 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP+SDNC" ]; then |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 116 | if [ $__httpx == "HTTPS" ]; then |
| 117 | echo "Using secure ports towards dmaap" |
| 118 | use_agent_dmaap_https |
| 119 | else |
| 120 | echo "Using non-secure ports towards dmaap" |
| 121 | use_agent_dmaap_http |
| 122 | fi |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 123 | else |
| 124 | if [ $__httpx == "HTTPS" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 125 | #"Using secure ports towards the agent" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 126 | use_agent_rest_https |
| 127 | else |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 128 | #"Using non-secure ports towards the agent" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 129 | use_agent_rest_http |
| 130 | fi |
| 131 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 132 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 133 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 134 | cr_equal received_callbacks 0 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 135 | mr_equal requests_submitted 0 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 136 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 137 | sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json |
| 138 | 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] | 139 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 140 | api_equal json:rics 2 60 |
| 141 | |
| 142 | api_equal json:policy_schemas 3 120 |
| 143 | |
| 144 | api_equal json:policy_types 3 |
| 145 | |
| 146 | api_equal json:policies 0 |
| 147 | |
| 148 | api_equal json:policy_ids 0 |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | echo "############################################" |
| 154 | echo "############## Health check ################" |
| 155 | echo "############################################" |
| 156 | |
| 157 | api_get_status 200 |
| 158 | |
| 159 | echo "############################################" |
| 160 | echo "##### Service registry and supervision #####" |
| 161 | echo "############################################" |
| 162 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 163 | api_get_services 404 "service1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 164 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 165 | api_put_service 201 "service1" 1000 "$CR_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 166 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 167 | api_put_service 200 "service1" 2000 "$CR_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 168 | |
| 169 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 170 | api_put_service 400 "service2" -1 "$CR_PATH/2" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 171 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 172 | api_put_service 400 "service2" "wrong" "$CR_PATH/2" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 173 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 174 | api_put_service 400 "service2" 100 "/test" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 175 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 176 | api_put_service 400 "service2" 100 "test-path" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 177 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 178 | api_put_service 201 "service2" 300 "ftp://localhost:80/test" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 179 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 180 | api_get_services 200 "service1" "service1" 2000 "$CR_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 181 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 182 | api_get_service_ids 200 "service1" "service2" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 183 | |
| 184 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 185 | api_put_service 201 "service3" 5000 "$CR_PATH/3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 186 | |
| 187 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 188 | api_get_service_ids 200 "service1" "service2" "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 189 | |
| 190 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 191 | api_get_services 200 "service1" "service1" 2000 "$CR_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 192 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 193 | api_get_services 200 NOSERVICE "service1" 2000 "$CR_PATH/1" "service2" 300 "ftp://localhost:80/test" "service3" 5000 "$CR_PATH/3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 194 | |
| 195 | api_get_services 200 |
| 196 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 197 | deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx" |
| 198 | #The below should work, keept here until fixed or other decision made |
| 199 | #api_put_services_keepalive 201 "service1" |
| 200 | #Using the below until decision |
| 201 | api_put_services_keepalive 200 "service1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 202 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 203 | deviation "TR2 - Keep alive shall return 200/201 according to doc, only 200 works - test combo $interface and $__httpx" |
| 204 | #The below should work, keept here until fixed or other decision made |
| 205 | #api_put_services_keepalive 201 "service3" |
| 206 | #Using the below until decision |
| 207 | api_put_services_keepalive 200 "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 208 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 209 | api_put_services_keepalive 200 "service1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 210 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 211 | api_put_services_keepalive 200 "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 212 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 213 | api_put_services_keepalive 404 "service5" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 214 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 215 | api_get_service_ids 200 "service1" "service2" "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 216 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 217 | api_delete_services 204 "service1" |
| 218 | |
| 219 | api_get_service_ids 200 "service2" "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 220 | |
| 221 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 222 | api_put_service 201 "service1" 50 "$CR_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 223 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 224 | api_get_service_ids 200 "service1" "service2" "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 225 | |
| 226 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 227 | api_delete_services 204 "service1" |
| 228 | api_delete_services 204 "service3" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 229 | |
| 230 | api_equal json:services 1 |
| 231 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 232 | api_delete_services 204 "service2" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 233 | |
| 234 | api_equal json:services 0 |
| 235 | |
| 236 | |
| 237 | echo "############################################" |
| 238 | echo "############## RIC Repository ##############" |
| 239 | echo "############################################" |
| 240 | |
| 241 | 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" |
| 242 | |
| 243 | api_get_rics 200 1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE" |
| 244 | |
| 245 | api_get_rics 404 47 |
| 246 | |
| 247 | api_get_rics 404 "test" |
| 248 | |
| 249 | |
| 250 | api_get_ric 200 me1_ricsim_g1_1 ricsim_g1_1 |
| 251 | |
| 252 | api_get_ric 200 me2_ricsim_g1_1 ricsim_g1_1 |
| 253 | |
| 254 | api_get_ric 200 me1_ricsim_g2_1 ricsim_g2_1 |
| 255 | |
| 256 | api_get_ric 200 me2_ricsim_g2_1 ricsim_g2_1 |
| 257 | |
| 258 | api_get_ric 404 test |
| 259 | |
| 260 | |
| 261 | echo "############################################" |
| 262 | echo "########### A1 Policy Management ###########" |
| 263 | echo "############################################" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 264 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 265 | #Behaviour accepted for now |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 266 | api_get_policy_schema 200 1 testdata/OSC/1-agent-modified.json |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 267 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 268 | #Behaviour accepted for now |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 269 | api_get_policy_schema 200 2 testdata/OSC/2-agent-modified.json |
| 270 | |
| 271 | api_get_policy_schema 404 3 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 272 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 273 | #Behaviour accepted for now |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 274 | api_get_policy_schemas 200 NORIC testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json NOFILE |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 275 | deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx" |
| 276 | #Behaviour accepted for now |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 277 | api_get_policy_schemas 200 ricsim_g1_1 testdata/OSC/1-agent-modified.json testdata/OSC/2-agent-modified.json |
| 278 | |
| 279 | api_get_policy_schemas 200 ricsim_g2_1 NOFILE |
| 280 | |
| 281 | api_get_policy_schemas 404 test |
| 282 | |
| 283 | |
| 284 | |
| 285 | api_get_policy_types 200 NORIC 1 2 EMPTY |
| 286 | |
| 287 | api_get_policy_types 200 ricsim_g1_1 1 2 |
| 288 | |
| 289 | api_get_policy_types 200 ricsim_g2_1 EMPTY |
| 290 | |
| 291 | api_get_policy_types 404 dummy-ric |
| 292 | |
| 293 | |
| 294 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 295 | api_put_service 201 "service10" 3600 "$CR_PATH/1" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 296 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 297 | deviation "TR10 - agent allows policy creation on unregistered service (orig problem) - test combo $interface and $__httpx" |
| 298 | #Kept until decison |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 299 | #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] | 300 | #Allow 201 for now |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 301 | api_put_policy 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 302 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 303 | api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json |
| 304 | api_put_policy 200 "service10" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 305 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 306 | api_put_policy 200 "service10" ricsim_g1_1 1 5000 true testdata/OSC/pi1_template.json |
| 307 | api_put_policy 200 "service10" ricsim_g1_1 1 5000 false testdata/OSC/pi1_template.json |
| 308 | |
| 309 | api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json |
| 310 | api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json |
| 311 | |
| 312 | api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true testdata/STD/pi1_template.json |
| 313 | api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false testdata/STD/pi1_template.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 314 | |
| 315 | VAL='NOT IN EFFECT' |
| 316 | api_get_policy_status 200 5000 OSC "$VAL" "false" |
| 317 | api_get_policy_status 200 5100 STD "UNDEFINED" |
| 318 | |
| 319 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 320 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 321 | #kept until decision |
| 322 | #api_equal json:policies 2 |
| 323 | #Allow 3 for now |
| 324 | api_equal json:policies 3 |
| 325 | |
| 326 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 327 | #kept until decision |
| 328 | #api_equal json:policy_ids 2 |
| 329 | #Allow 3 for now |
| 330 | api_equal json:policy_ids 3 |
| 331 | |
| 332 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 333 | #kept until decision |
| 334 | #api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 |
| 335 | #Allow policy create with unregistered service for now |
| 336 | api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 |
| 337 | |
| 338 | |
| 339 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 340 | #kept until decision |
| 341 | #api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 |
| 342 | #Allow policy create with unregistered service for now |
| 343 | api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 344 | |
| 345 | api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100 |
| 346 | |
| 347 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 348 | api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 |
| 349 | |
| 350 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 351 | #kept until decision |
| 352 | #api_get_policy_ids 200 NORIC NOSERVICE 1 5000 |
| 353 | #Allow policy create with unregistered service for now |
| 354 | api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 355 | |
| 356 | api_get_policy_ids 200 NORIC NOSERVICE 2 NOID |
| 357 | |
| 358 | api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID |
| 359 | |
| 360 | |
| 361 | api_get_policy 200 5000 testdata/OSC/pi1_template.json |
| 362 | |
| 363 | api_get_policy 200 5100 testdata/STD/pi1_template.json |
| 364 | |
| 365 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 366 | api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 testdata/OSC/pi1_template.json |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 367 | |
| 368 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 369 | deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx" |
| 370 | #kept until decision |
| 371 | #api_delete_policy 404 2000 |
| 372 | #Allow policy create with unregistered service for now |
| 373 | api_delete_policy 204 2000 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 374 | |
| 375 | api_delete_policy 404 1500 |
| 376 | |
| 377 | api_delete_policy 204 5000 |
| 378 | |
| 379 | api_equal json:policies 1 |
| 380 | |
| 381 | api_equal json:policy_ids 1 |
| 382 | |
| 383 | api_delete_policy 204 5100 |
| 384 | |
| 385 | api_equal json:policies 0 |
| 386 | |
| 387 | api_equal json:policy_ids 0 |
| 388 | |
| 389 | cr_equal received_callbacks 0 |
| 390 | |
| 391 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP+SDNC" ]; then |
| 392 | mr_greater requests_submitted 0 |
| 393 | VAL=$(mr_read requests_submitted) |
| 394 | mr_equal requests_fetched $VAL |
| 395 | mr_equal responses_submitted $VAL |
| 396 | mr_equal responses_fetched $VAL |
| 397 | mr_equal current_requests 0 |
| 398 | mr_equal current_responses 0 |
| 399 | else |
| 400 | mr_equal requests_submitted 0 |
| 401 | fi |
| 402 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 403 | if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then |
| 404 | sim_contains_str ricsim_g1_1 remote_hosts "a1-controller" |
| 405 | sim_contains_str ricsim_g2_1 remote_hosts "a1-controller" |
| 406 | else |
| 407 | sim_contains_str ricsim_g1_1 remote_hosts "policy-agent" |
| 408 | sim_contains_str ricsim_g2_1 remote_hosts "policy-agent" |
| 409 | fi |
| 410 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 411 | check_policy_agent_logs |
| 412 | check_control_panel_logs |
| 413 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 414 | store_logs "${__httpx}__${interface}" |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 415 | |
| 416 | done |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 417 | |
| 418 | done |
| 419 | |
| 420 | #### TEST COMPLETE #### |
| 421 | |
| 422 | |
| 423 | print_result |
| 424 | |
| 425 | auto_clean_containers |