BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 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 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 20 | TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via agent REST/DMAAP/DMAAP_BATCH and SDNC using http or https" |
| 21 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 22 | #App names to include in the test, space separated list |
| 23 | INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 24 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 25 | #SUPPORTED TEST ENV FILE |
| 26 | SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN" |
| 27 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 28 | . ../common/testcase_common.sh $@ |
| 29 | . ../common/agent_api_functions.sh |
| 30 | . ../common/ricsimulator_api_functions.sh |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 31 | . ../common/cr_api_functions.sh |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 32 | |
| 33 | #### TEST BEGIN #### |
| 34 | |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 35 | generate_uuid |
| 36 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 37 | #Local vars in test script |
| 38 | ########################## |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 39 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 40 | # Number of RICs per interface type (OSC and STD) |
| 41 | NUM_RICS=30 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 42 | if [ "$PMS_VERSION" == "V2" ]; then |
| 43 | NUM_RICS=20 # 3 A1 interfaces test, less sims per interface. total sims will be same |
| 44 | fi |
| 45 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 46 | # Number of policy instances per RIC |
| 47 | NUM_INSTANCES=5 |
| 48 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 49 | DAYS=3 |
| 50 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 51 | clean_containers |
| 52 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 53 | # use HTTP or HTTPS for all apis |
| 54 | HTTPX=HTTPS |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 55 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 56 | if [ $HTTPX == "HTTP" ]; then |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 57 | use_cr_http |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 58 | use_agent_rest_http |
| 59 | use_sdnc_http |
| 60 | use_simulator_http |
| 61 | else |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 62 | use_cr_https |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 63 | use_agent_rest_https |
| 64 | use_sdnc_https |
| 65 | use_simulator_https |
| 66 | fi |
| 67 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 68 | start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0 |
| 69 | |
| 70 | start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3 |
| 71 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 72 | if [ "$PMS_VERSION" == "V2" ]; then |
| 73 | start_ric_simulators ricsim_g3 $NUM_RICS STD_2.0.0 |
| 74 | fi |
| 75 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 76 | start_mr |
| 77 | |
| 78 | start_cr |
| 79 | |
| 80 | start_consul_cbs |
| 81 | |
| 82 | prepare_consul_config SDNC ".consul_config.json" |
| 83 | consul_config_app ".consul_config.json" |
| 84 | |
| 85 | start_sdnc |
| 86 | |
| 87 | start_control_panel |
| 88 | |
| 89 | start_policy_agent |
| 90 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 91 | |
| 92 | api_get_status 200 |
| 93 | |
| 94 | echo "Print the interface for group 1 simulators, shall be OSC" |
| 95 | for ((i=1; i<=$NUM_RICS; i++)) |
| 96 | do |
| 97 | sim_print ricsim_g1_$i interface |
| 98 | done |
| 99 | |
| 100 | echo "Print the interface for group 2 simulators, shall be STD" |
| 101 | for ((i=1; i<=$NUM_RICS; i++)) |
| 102 | do |
| 103 | sim_print ricsim_g2_$i interface |
| 104 | done |
| 105 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 106 | if [ "$PMS_VERSION" == "V2" ]; then |
| 107 | echo "Print the interface for group 2 simulators, shall be STD 2" |
| 108 | for ((i=1; i<=$NUM_RICS; i++)) |
| 109 | do |
| 110 | sim_print ricsim_g3_$i interface |
| 111 | done |
| 112 | fi |
| 113 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 114 | echo "Load policy type in group 1 simulators" |
| 115 | for ((i=1; i<=$NUM_RICS; i++)) |
| 116 | do |
| 117 | sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json |
| 118 | done |
| 119 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 120 | if [ "$PMS_VERSION" == "V2" ]; then |
| 121 | echo "Load policy type in group 3 simulators" |
| 122 | for ((i=1; i<=$NUM_RICS; i++)) |
| 123 | do |
| 124 | sim_put_policy_type 201 ricsim_g3_$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json |
| 125 | done |
| 126 | fi |
| 127 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 128 | echo "Check the number of instances in group 1 simulators, shall be 0" |
| 129 | for ((i=1; i<=$NUM_RICS; i++)) |
| 130 | do |
| 131 | sim_equal ricsim_g1_$i num_instances 0 |
| 132 | done |
| 133 | |
| 134 | echo "Check the number of instances in group 2 simulators, shall be 0" |
| 135 | for ((i=1; i<=$NUM_RICS; i++)) |
| 136 | do |
| 137 | sim_equal ricsim_g2_$i num_instances 0 |
| 138 | done |
| 139 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 140 | if [ "$PMS_VERSION" == "V2" ]; then |
| 141 | echo "Check the number of instances in group 3 simulators, shall be 0" |
| 142 | for ((i=1; i<=$NUM_RICS; i++)) |
| 143 | do |
| 144 | sim_equal ricsim_g3_$i num_instances 0 |
| 145 | done |
| 146 | fi |
| 147 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 148 | echo "Wait for the agent to refresh types from the simulator" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 149 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 150 | api_equal json:policy-types 3 120 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 151 | else |
| 152 | api_equal json:policy_types 2 120 |
| 153 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 154 | |
| 155 | echo "Check the number of types in the agent for each ric is 1" |
| 156 | for ((i=1; i<=$NUM_RICS; i++)) |
| 157 | do |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 158 | if [ "$PMS_VERSION" == "V2" ]; then |
| 159 | api_equal json:policy-types?ric_id=ricsim_g1_$i 1 120 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 160 | api_equal json:policy-types?ric_id=ricsim_g3_$i 1 120 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 161 | else |
| 162 | api_equal json:policy_types?ric=ricsim_g1_$i 1 120 |
| 163 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 164 | done |
| 165 | |
| 166 | echo "Register a service" |
| 167 | api_put_service 201 "serv1" 0 "$CR_PATH/1" |
| 168 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 169 | TEST_DURATION=$((24*3600*$DAYS)) |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 170 | TEST_START=$SECONDS |
| 171 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 172 | AGENT_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 173 | |
| 174 | MR_MESSAGES=0 |
| 175 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 176 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 177 | notificationurl=$CR_PATH"/test" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 178 | else |
| 179 | notificationurl="" |
| 180 | fi |
| 181 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 182 | while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do |
| 183 | |
| 184 | echo "" |
| 185 | echo "#########################################################################################################" |
| 186 | echo -e $BOLD"INFO: Test executed for: "$(($SECONDS-$TEST_START)) "seconds. Target is: "$TEST_DURATION" seconds."$EBOLD |
| 187 | echo "#########################################################################################################" |
| 188 | echo "" |
| 189 | |
| 190 | for interface in $AGENT_INTERFACES ; do |
| 191 | |
| 192 | echo "############################################" |
| 193 | echo "## Testing using agent interface: $interface ##" |
| 194 | echo "############################################" |
| 195 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 196 | if [ $interface == "REST" ] || [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 197 | if [ $HTTPX == "HTTP" ]; then |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 198 | use_agent_rest_http |
| 199 | else |
| 200 | use_agent_rest_https |
| 201 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 202 | else |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 203 | if [ $HTTPX == "HTTPS" ]; then |
| 204 | echo "Using secure ports towards dmaap" |
| 205 | use_agent_dmaap_https |
| 206 | else |
| 207 | echo "Using non-secure ports towards dmaap" |
| 208 | use_agent_dmaap_http |
| 209 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 210 | fi |
| 211 | |
| 212 | echo "Create $NUM_INSTANCES instances in each OSC RIC" |
| 213 | INSTANCE_ID=200000 |
| 214 | INSTANCES=0 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 215 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 216 | api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES 3 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 217 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 218 | for ((i=1; i<=$NUM_RICS; i++)) |
| 219 | do |
| 220 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 221 | api_put_policy_batch 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 222 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 223 | api_put_policy 201 "serv1" ricsim_g1_$i 1 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 224 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 225 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 226 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 227 | fi |
| 228 | sim_equal ricsim_g1_$i num_instances $NUM_INSTANCES |
| 229 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 230 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 231 | done |
| 232 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 233 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 234 | api_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 235 | else |
| 236 | api_equal json:policy_ids $INSTANCES |
| 237 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 238 | |
| 239 | echo "Create $NUM_INSTANCES instances in each STD RIC" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 240 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 241 | api_put_policy_parallel 201 "serv1" ricsim_g2_ $NUM_RICS NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES 3 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 242 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 243 | for ((i=1; i<=$NUM_RICS; i++)) |
| 244 | do |
| 245 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 246 | api_put_policy_batch 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 247 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 248 | api_put_policy 201 "serv1" ricsim_g2_$i NOTYPE $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD/pi1_template.json $NUM_INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 249 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 250 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 251 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 252 | fi |
| 253 | sim_equal ricsim_g2_$i num_instances $NUM_INSTANCES |
| 254 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 255 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 256 | done |
| 257 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 258 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 259 | api_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 260 | else |
| 261 | api_equal json:policy_ids $INSTANCES |
| 262 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 263 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 264 | if [ "$PMS_VERSION" == "V2" ]; then |
| 265 | echo "Create $NUM_INSTANCES instances in each STD 2 RIC" |
| 266 | if [ $interface == "REST_PARALLEL" ]; then |
| 267 | api_put_policy_parallel 201 "serv1" ricsim_g3_ $NUM_RICS STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES 3 |
| 268 | fi |
| 269 | for ((i=1; i<=$NUM_RICS; i++)) |
| 270 | do |
| 271 | if [ $interface == "DMAAP-BATCH" ]; then |
| 272 | api_put_policy_batch 201 "serv1" ricsim_g3_$i STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES |
| 273 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
| 274 | api_put_policy 201 "serv1" ricsim_g3_$i STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES |
| 275 | fi |
| 276 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
| 277 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 278 | fi |
| 279 | sim_equal ricsim_g3_$i num_instances $NUM_INSTANCES |
| 280 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 281 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 282 | done |
| 283 | |
| 284 | if [ "$PMS_VERSION" == "V2" ]; then |
| 285 | api_equal json:policy-instances $INSTANCES |
| 286 | else |
| 287 | api_equal json:policy_ids $INSTANCES |
| 288 | fi |
| 289 | fi |
| 290 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 291 | |
| 292 | echo "Delete all instances in each OSC RIC" |
| 293 | |
| 294 | INSTANCE_ID=200000 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 295 | if [ $interface == "REST_PARALLEL" ]; then |
| 296 | api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
| 297 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 298 | for ((i=1; i<=$NUM_RICS; i++)) |
| 299 | do |
| 300 | if [ $interface == "DMAAP-BATCH" ]; then |
| 301 | api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 302 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 303 | api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
| 304 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 305 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 306 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 307 | fi |
| 308 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 309 | sim_equal ricsim_g1_$i num_instances 0 |
| 310 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 311 | done |
| 312 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 313 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 314 | api_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 315 | else |
| 316 | api_equal json:policy_ids $INSTANCES |
| 317 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 318 | |
| 319 | echo "Delete all instances in each STD RIC" |
| 320 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 321 | if [ $interface == "REST_PARALLEL" ]; then |
| 322 | api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
| 323 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 324 | for ((i=1; i<=$NUM_RICS; i++)) |
| 325 | do |
| 326 | if [ $interface == "DMAAP-BATCH" ]; then |
| 327 | api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 328 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 329 | api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
| 330 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 331 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 332 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 333 | fi |
| 334 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 335 | sim_equal ricsim_g2_$i num_instances 0 |
| 336 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 337 | done |
| 338 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 339 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 340 | api_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 341 | else |
| 342 | api_equal json:policy_ids $INSTANCES |
| 343 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 344 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 345 | if [ "$PMS_VERSION" == "V2" ]; then |
| 346 | echo "Delete all instances in each STD 2 RIC" |
| 347 | |
| 348 | if [ $interface == "REST_PARALLEL" ]; then |
| 349 | api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
| 350 | fi |
| 351 | for ((i=1; i<=$NUM_RICS; i++)) |
| 352 | do |
| 353 | if [ $interface == "DMAAP-BATCH" ]; then |
| 354 | api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
| 355 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
| 356 | api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
| 357 | fi |
| 358 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
| 359 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 360 | fi |
| 361 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 362 | sim_equal ricsim_g3_$i num_instances 0 |
| 363 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 364 | done |
| 365 | |
| 366 | if [ "$PMS_VERSION" == "V2" ]; then |
| 367 | api_equal json:policy-instances $INSTANCES |
| 368 | else |
| 369 | api_equal json:policy_ids $INSTANCES |
| 370 | fi |
| 371 | fi |
| 372 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 373 | mr_equal requests_submitted $MR_MESSAGES |
| 374 | mr_equal requests_fetched $MR_MESSAGES |
| 375 | mr_equal responses_submitted $MR_MESSAGES |
| 376 | mr_equal responses_fetched $MR_MESSAGES |
| 377 | mr_equal current_requests 0 |
| 378 | mr_equal current_responses 0 |
| 379 | |
| 380 | |
| 381 | for ((i=1; i<=$NUM_RICS; i++)) |
| 382 | do |
| 383 | sim_contains_str ricsim_g1_$i remote_hosts "a1-controller" |
| 384 | sim_contains_str ricsim_g2_$i remote_hosts "a1-controller" |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame^] | 385 | |
| 386 | if [ "$PMS_VERSION" == "V2" ]; then |
| 387 | sim_contains_str ricsim_g3_$i remote_hosts "a1-controller" |
| 388 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 389 | done |
| 390 | |
| 391 | done |
| 392 | |
| 393 | done |
| 394 | |
| 395 | check_policy_agent_logs |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 396 | check_sdnc_logs |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 397 | |
| 398 | #### TEST COMPLETE #### |
| 399 | |
| 400 | store_logs END |
| 401 | |
| 402 | print_result |
| 403 | |
| 404 | auto_clean_containers |