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