BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +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 | |
| 20 | TC_ONELINE_DESCR="Change supported policy types and reconfigure rics" |
| 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 | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 24 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 25 | #SUPPORTED TEST ENV FILE |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 26 | SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN ORAN-MASTER" |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 27 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +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 | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 32 | |
| 33 | #### TEST BEGIN #### |
| 34 | |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 35 | generate_uuid |
| 36 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 37 | use_cr_http |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 38 | |
| 39 | NUM_RICS=10 |
| 40 | NUM_RICS_2=$(($NUM_RICS-2)) |
| 41 | |
| 42 | # Tested variants of REST/SDNC config |
| 43 | TESTED_VARIANTS="REST REST+SDNC" |
| 44 | |
| 45 | for interface in $TESTED_VARIANTS ; do |
| 46 | |
| 47 | echo "#####################################################################" |
| 48 | echo "#####################################################################" |
| 49 | echo "### Testing agent: "$interface |
| 50 | echo "#####################################################################" |
| 51 | echo "#####################################################################" |
| 52 | |
| 53 | |
| 54 | # Clean container and start all needed containers # |
| 55 | clean_containers |
| 56 | |
| 57 | #Start simulators and prepare two configs |
| 58 | |
| 59 | start_ric_simulators ricsim_g1 $NUM_RICS_2 OSC_2.1.0 |
| 60 | |
| 61 | start_cr |
| 62 | |
| 63 | start_mr |
| 64 | |
| 65 | start_consul_cbs |
| 66 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 67 | # Create first config |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 68 | if [[ $interface = *"SDNC"* ]]; then |
| 69 | start_sdnc |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 70 | prepare_consul_config SDNC ".consul_config_initial.json" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 71 | else |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 72 | prepare_consul_config NOSDNC ".consul_config_initial.json" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 73 | fi |
| 74 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 75 | # Create 2nd config and save for later |
| 76 | start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0 |
| 77 | |
| 78 | if [[ $interface = *"SDNC"* ]]; then |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 79 | prepare_consul_config SDNC ".consul_config_all.json" |
| 80 | else |
| 81 | prepare_consul_config NOSDNC ".consul_config_all.json" |
| 82 | fi |
| 83 | |
| 84 | start_policy_agent |
| 85 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 86 | set_agent_trace |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 87 | |
| 88 | api_get_status 200 |
| 89 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 90 | # Create service to be able to receive events when rics becomes available |
| 91 | # Must use rest towards the agent since dmaap is not configured yet |
| 92 | api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration" |
| 93 | |
| 94 | #Load first config |
| 95 | consul_config_app ".consul_config_initial.json" |
| 96 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 97 | for ((i=1; i<=${NUM_RICS}; i++)) |
| 98 | do |
| 99 | sim_print ricsim_g1_$i interface |
| 100 | done |
| 101 | |
| 102 | # All sims running but 2 are not configured in consul |
| 103 | api_equal json:rics 8 120 |
| 104 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 105 | if [ "$PMS_VERSION" == "V2" ]; then |
| 106 | cr_equal received_callbacks?id=ric-registration 8 120 |
| 107 | cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8 |
| 108 | fi |
| 109 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 110 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:NOTYPE:???? \ |
| 111 | ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:NOTYPE:???? \ |
| 112 | ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:NOTYPE:???? \ |
| 113 | ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:NOTYPE:???? \ |
| 114 | ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:NOTYPE:???? \ |
| 115 | ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:NOTYPE:???? \ |
| 116 | ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:NOTYPE:???? \ |
| 117 | ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:NOTYPE:???? " |
| 118 | |
| 119 | |
| 120 | sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json |
| 121 | sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json |
| 122 | sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json |
| 123 | sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json |
| 124 | sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json |
| 125 | |
| 126 | sim_put_policy_type 201 ricsim_g1_2 2 testdata/OSC/sim_2.json |
| 127 | sim_put_policy_type 201 ricsim_g1_3 2 testdata/OSC/sim_2.json |
| 128 | sim_put_policy_type 201 ricsim_g1_4 2 testdata/OSC/sim_2.json |
| 129 | sim_put_policy_type 201 ricsim_g1_5 2 testdata/OSC/sim_2.json |
| 130 | sim_put_policy_type 201 ricsim_g1_6 2 testdata/OSC/sim_2.json |
| 131 | |
| 132 | sim_put_policy_type 201 ricsim_g1_3 3 testdata/OSC/sim_3.json |
| 133 | sim_put_policy_type 201 ricsim_g1_4 3 testdata/OSC/sim_3.json |
| 134 | sim_put_policy_type 201 ricsim_g1_5 3 testdata/OSC/sim_3.json |
| 135 | sim_put_policy_type 201 ricsim_g1_6 3 testdata/OSC/sim_3.json |
| 136 | sim_put_policy_type 201 ricsim_g1_7 3 testdata/OSC/sim_3.json |
| 137 | |
| 138 | sim_put_policy_type 201 ricsim_g1_4 4 testdata/OSC/sim_4.json |
| 139 | sim_put_policy_type 201 ricsim_g1_5 4 testdata/OSC/sim_4.json |
| 140 | sim_put_policy_type 201 ricsim_g1_6 4 testdata/OSC/sim_4.json |
| 141 | sim_put_policy_type 201 ricsim_g1_7 4 testdata/OSC/sim_4.json |
| 142 | sim_put_policy_type 201 ricsim_g1_8 4 testdata/OSC/sim_4.json |
| 143 | |
| 144 | sim_put_policy_type 201 ricsim_g1_5 5 testdata/OSC/sim_5.json |
| 145 | sim_put_policy_type 201 ricsim_g1_6 5 testdata/OSC/sim_5.json |
| 146 | sim_put_policy_type 201 ricsim_g1_7 5 testdata/OSC/sim_5.json |
| 147 | sim_put_policy_type 201 ricsim_g1_8 5 testdata/OSC/sim_5.json |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 148 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 149 | if [ "$PMS_VERSION" == "V2" ]; then |
| 150 | api_equal json:policy-types 5 120 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 151 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 152 | echo "Check the number of types in the agent for each ric" |
| 153 | api_equal json:policy-types?ric_id=ricsim_g1_1 1 120 |
| 154 | api_equal json:policy-types?ric_id=ricsim_g1_2 2 120 |
| 155 | api_equal json:policy-types?ric_id=ricsim_g1_3 3 120 |
| 156 | api_equal json:policy-types?ric_id=ricsim_g1_4 4 120 |
| 157 | api_equal json:policy-types?ric_id=ricsim_g1_5 5 120 |
| 158 | api_equal json:policy-types?ric_id=ricsim_g1_6 4 120 |
| 159 | api_equal json:policy-types?ric_id=ricsim_g1_7 3 120 |
| 160 | api_equal json:policy-types?ric_id=ricsim_g1_8 2 120 |
| 161 | else |
| 162 | api_equal json:policy_types 5 120 |
| 163 | |
| 164 | echo "Check the number of types in the agent for each ric" |
| 165 | api_equal json:policy_types?ric=ricsim_g1_1 1 120 |
| 166 | api_equal json:policy_types?ric=ricsim_g1_2 2 120 |
| 167 | api_equal json:policy_types?ric=ricsim_g1_3 3 120 |
| 168 | api_equal json:policy_types?ric=ricsim_g1_4 4 120 |
| 169 | api_equal json:policy_types?ric=ricsim_g1_5 5 120 |
| 170 | api_equal json:policy_types?ric=ricsim_g1_6 4 120 |
| 171 | api_equal json:policy_types?ric=ricsim_g1_7 3 120 |
| 172 | api_equal json:policy_types?ric=ricsim_g1_8 2 120 |
| 173 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 174 | |
| 175 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \ |
| 176 | ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \ |
| 177 | ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \ |
| 178 | ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \ |
| 179 | ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \ |
| 180 | ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \ |
| 181 | ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \ |
| 182 | ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? " |
| 183 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 184 | if [ "$PMS_VERSION" == "V2" ]; then |
| 185 | cr_equal received_callbacks?id=ric-registration 16 120 |
| 186 | cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g1_2 ricsim_g1_3 ricsim_g1_4 ricsim_g1_5 ricsim_g1_6 ricsim_g1_7 ricsim_g1_8 |
| 187 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 188 | |
| 189 | #Load config with all rics |
| 190 | consul_config_app ".consul_config_all.json" |
| 191 | |
| 192 | api_equal json:rics 10 120 |
| 193 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 194 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 195 | cr_equal received_callbacks?id=ric-registration 18 120 |
| 196 | cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9 ricsim_g1_10 |
| 197 | fi |
| 198 | |
| 199 | sim_put_policy_type 201 ricsim_g1_9 5 testdata/OSC/sim_5.json |
| 200 | |
| 201 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 202 | |
| 203 | echo "Check the number of types in the agent for each ric" |
| 204 | api_equal json:policy-types?ric_id=ricsim_g1_1 1 120 |
| 205 | api_equal json:policy-types?ric_id=ricsim_g1_2 2 120 |
| 206 | api_equal json:policy-types?ric_id=ricsim_g1_3 3 120 |
| 207 | api_equal json:policy-types?ric_id=ricsim_g1_4 4 120 |
| 208 | api_equal json:policy-types?ric_id=ricsim_g1_5 5 120 |
| 209 | api_equal json:policy-types?ric_id=ricsim_g1_6 4 120 |
| 210 | api_equal json:policy-types?ric_id=ricsim_g1_7 3 120 |
| 211 | api_equal json:policy-types?ric_id=ricsim_g1_8 2 120 |
| 212 | api_equal json:policy-types?ric_id=ricsim_g1_9 1 120 |
| 213 | api_equal json:policy-types?ric_id=ricsim_g1_10 0 120 |
| 214 | else |
| 215 | |
| 216 | echo "Check the number of types in the agent for each ric" |
| 217 | api_equal json:policy_types?ric=ricsim_g1_1 1 120 |
| 218 | api_equal json:policy_types?ric=ricsim_g1_2 2 120 |
| 219 | api_equal json:policy_types?ric=ricsim_g1_3 3 120 |
| 220 | api_equal json:policy_types?ric=ricsim_g1_4 4 120 |
| 221 | api_equal json:policy_types?ric=ricsim_g1_5 5 120 |
| 222 | api_equal json:policy_types?ric=ricsim_g1_6 4 120 |
| 223 | api_equal json:policy_types?ric=ricsim_g1_7 3 120 |
| 224 | api_equal json:policy_types?ric=ricsim_g1_8 2 120 |
| 225 | api_equal json:policy_types?ric=ricsim_g1_9 1 120 |
| 226 | api_equal json:policy_types?ric=ricsim_g1_10 0 120 |
| 227 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 228 | |
| 229 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \ |
| 230 | ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \ |
| 231 | ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \ |
| 232 | ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \ |
| 233 | ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \ |
| 234 | ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \ |
| 235 | ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \ |
| 236 | ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \ |
| 237 | ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \ |
| 238 | ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? " |
| 239 | |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 240 | if [ "$PMS_VERSION" == "V2" ]; then |
| 241 | cr_equal received_callbacks?id=ric-registration 19 120 |
| 242 | cr_api_check_all_sync_events 200 ric-registration ricsim_g1_9 |
| 243 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 244 | |
| 245 | #No policy type in sim #10 |
| 246 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 247 | if [ "$PMS_VERSION" == "V2" ]; then |
| 248 | api_equal json:policy-types 5 |
| 249 | else |
| 250 | api_equal json:policy_types 5 |
| 251 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 252 | |
| 253 | api_put_service 201 "serv1" 3600 "$CR_PATH/serv1" |
| 254 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 255 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 256 | notificationurl=$CR_PATH"/test" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 257 | else |
| 258 | notificationurl="" |
| 259 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 260 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 261 | sleep_wait 120 |
| 262 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 263 | # Load config with reduced number of rics |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 264 | consul_config_app ".consul_config_initial.json" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 265 | |
| 266 | api_equal json:rics 8 120 |
| 267 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 268 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 269 | cr_equal received_callbacks?id=ric-registration 19 120 |
| 270 | cr_api_check_all_sync_events 200 ric-registration EMPTY |
| 271 | fi |
| 272 | |
| 273 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 274 | echo "Check the number of types in the agent for each ric" |
| 275 | api_equal json:policy-types?ric_id=ricsim_g1_1 1 120 |
| 276 | api_equal json:policy-types?ric_id=ricsim_g1_2 2 120 |
| 277 | api_equal json:policy-types?ric_id=ricsim_g1_3 3 120 |
| 278 | api_equal json:policy-types?ric_id=ricsim_g1_4 4 120 |
| 279 | api_equal json:policy-types?ric_id=ricsim_g1_5 5 120 |
| 280 | api_equal json:policy-types?ric_id=ricsim_g1_6 4 120 |
| 281 | api_equal json:policy-types?ric_id=ricsim_g1_7 3 120 |
| 282 | api_equal json:policy-types?ric_id=ricsim_g1_8 2 120 |
| 283 | else |
| 284 | echo "Check the number of types in the agent for each ric" |
| 285 | api_equal json:policy_types?ric=ricsim_g1_1 1 120 |
| 286 | api_equal json:policy_types?ric=ricsim_g1_2 2 120 |
| 287 | api_equal json:policy_types?ric=ricsim_g1_3 3 120 |
| 288 | api_equal json:policy_types?ric=ricsim_g1_4 4 120 |
| 289 | api_equal json:policy_types?ric=ricsim_g1_5 5 120 |
| 290 | api_equal json:policy_types?ric=ricsim_g1_6 4 120 |
| 291 | api_equal json:policy_types?ric=ricsim_g1_7 3 120 |
| 292 | api_equal json:policy_types?ric=ricsim_g1_8 2 120 |
| 293 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 294 | |
| 295 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \ |
| 296 | ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \ |
| 297 | ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \ |
| 298 | ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \ |
| 299 | ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \ |
| 300 | ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \ |
| 301 | ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \ |
| 302 | ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? " |
| 303 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 304 | sleep_wait 120 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 305 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 306 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 307 | api_equal json:policy-instances 0 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 308 | else |
| 309 | api_equal json:policy_ids 0 |
| 310 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 311 | |
| 312 | api_get_policy_types 404 ricsim_g1_9 |
| 313 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 314 | # Load config with all rics |
| 315 | consul_config_app ".consul_config_all.json" |
| 316 | |
| 317 | api_equal json:rics 10 120 |
| 318 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 319 | if [ "$PMS_VERSION" == "V2" ]; then |
| 320 | echo "Check the number of types in the agent for each ric" |
| 321 | api_equal json:policy-types?ric_id=ricsim_g1_1 1 120 |
| 322 | api_equal json:policy-types?ric_id=ricsim_g1_2 2 120 |
| 323 | api_equal json:policy-types?ric_id=ricsim_g1_3 3 120 |
| 324 | api_equal json:policy-types?ric_id=ricsim_g1_4 4 120 |
| 325 | api_equal json:policy-types?ric_id=ricsim_g1_5 5 120 |
| 326 | api_equal json:policy-types?ric_id=ricsim_g1_6 4 120 |
| 327 | api_equal json:policy-types?ric_id=ricsim_g1_7 3 120 |
| 328 | api_equal json:policy-types?ric_id=ricsim_g1_8 2 120 |
| 329 | api_equal json:policy-types?ric_id=ricsim_g1_9 1 120 |
| 330 | api_equal json:policy-types?ric_id=ricsim_g1_10 0 120 |
| 331 | else |
| 332 | echo "Check the number of types in the agent for each ric" |
| 333 | api_equal json:policy_types?ric=ricsim_g1_1 1 120 |
| 334 | api_equal json:policy_types?ric=ricsim_g1_2 2 120 |
| 335 | api_equal json:policy_types?ric=ricsim_g1_3 3 120 |
| 336 | api_equal json:policy_types?ric=ricsim_g1_4 4 120 |
| 337 | api_equal json:policy_types?ric=ricsim_g1_5 5 120 |
| 338 | api_equal json:policy_types?ric=ricsim_g1_6 4 120 |
| 339 | api_equal json:policy_types?ric=ricsim_g1_7 3 120 |
| 340 | api_equal json:policy_types?ric=ricsim_g1_8 2 120 |
| 341 | api_equal json:policy_types?ric=ricsim_g1_9 1 120 |
| 342 | api_equal json:policy_types?ric=ricsim_g1_10 0 120 |
| 343 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 344 | |
| 345 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \ |
| 346 | ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \ |
| 347 | ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \ |
| 348 | ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3,4:???? \ |
| 349 | ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,4,5:???? \ |
| 350 | ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,4,5:???? \ |
| 351 | ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,4,5:???? \ |
| 352 | ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \ |
| 353 | ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \ |
| 354 | ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? " |
| 355 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 356 | sleep_wait 120 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 357 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 358 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 359 | api_equal json:policy-instances 0 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 360 | else |
| 361 | api_equal json:policy_ids 0 |
| 362 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 363 | |
| 364 | sim_equal ricsim_g1_9 num_instances 0 |
| 365 | |
| 366 | |
| 367 | sim_delete_policy_type 204 ricsim_g1_4 4 |
| 368 | sim_delete_policy_type 204 ricsim_g1_5 4 |
| 369 | sim_delete_policy_type 204 ricsim_g1_6 4 |
| 370 | sim_delete_policy_type 204 ricsim_g1_7 4 |
| 371 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 372 | sleep_wait 120 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 373 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 374 | if [ "$PMS_VERSION" == "V2" ]; then |
| 375 | api_equal json:policy-types?ric_id=ricsim_g1_1 1 120 |
| 376 | api_equal json:policy-types?ric_id=ricsim_g1_2 2 120 |
| 377 | api_equal json:policy-types?ric_id=ricsim_g1_3 3 120 |
| 378 | api_equal json:policy-types?ric_id=ricsim_g1_4 3 120 |
| 379 | api_equal json:policy-types?ric_id=ricsim_g1_5 4 120 |
| 380 | api_equal json:policy-types?ric_id=ricsim_g1_6 3 120 |
| 381 | api_equal json:policy-types?ric_id=ricsim_g1_7 2 120 |
| 382 | api_equal json:policy-types?ric_id=ricsim_g1_8 2 120 |
| 383 | api_equal json:policy-types?ric_id=ricsim_g1_9 1 120 |
| 384 | api_equal json:policy-types?ric_id=ricsim_g1_10 0 120 |
| 385 | else |
| 386 | api_equal json:policy_types?ric=ricsim_g1_1 1 120 |
| 387 | api_equal json:policy_types?ric=ricsim_g1_2 2 120 |
| 388 | api_equal json:policy_types?ric=ricsim_g1_3 3 120 |
| 389 | api_equal json:policy_types?ric=ricsim_g1_4 3 120 |
| 390 | api_equal json:policy_types?ric=ricsim_g1_5 4 120 |
| 391 | api_equal json:policy_types?ric=ricsim_g1_6 3 120 |
| 392 | api_equal json:policy_types?ric=ricsim_g1_7 2 120 |
| 393 | api_equal json:policy_types?ric=ricsim_g1_8 2 120 |
| 394 | api_equal json:policy_types?ric=ricsim_g1_9 1 120 |
| 395 | api_equal json:policy_types?ric=ricsim_g1_10 0 120 |
| 396 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 397 | |
| 398 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \ |
| 399 | ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \ |
| 400 | ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \ |
| 401 | ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \ |
| 402 | ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \ |
| 403 | ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \ |
| 404 | ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \ |
| 405 | ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:4,5:???? \ |
| 406 | ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \ |
| 407 | ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? " |
| 408 | |
| 409 | sim_delete_policy_type 204 ricsim_g1_8 4 |
| 410 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 411 | if [ "$PMS_VERSION" == "V2" ]; then |
| 412 | api_equal json:policy-types?ric_id=ricsim_g1_8 1 120 |
| 413 | else |
| 414 | api_equal json:policy_types?ric=ricsim_g1_8 1 120 |
| 415 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 416 | |
| 417 | api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:???? \ |
| 418 | ricsim_g1_2:me1_ricsim_g1_2,me2_ricsim_g1_2:1,2:???? \ |
| 419 | ricsim_g1_3:me1_ricsim_g1_3,me2_ricsim_g1_3:1,2,3:???? \ |
| 420 | ricsim_g1_4:me1_ricsim_g1_4,me2_ricsim_g1_4:1,2,3:???? \ |
| 421 | ricsim_g1_5:me1_ricsim_g1_5,me2_ricsim_g1_5:1,2,3,5:???? \ |
| 422 | ricsim_g1_6:me1_ricsim_g1_6,me2_ricsim_g1_6:2,3,5:???? \ |
| 423 | ricsim_g1_7:me1_ricsim_g1_7,me2_ricsim_g1_7:3,5:???? \ |
| 424 | ricsim_g1_8:me1_ricsim_g1_8,me2_ricsim_g1_8:5:???? \ |
| 425 | ricsim_g1_9:me1_ricsim_g1_9,me2_ricsim_g1_9:5:???? \ |
| 426 | ricsim_g1_10:me1_ricsim_g1_10,me2_ricsim_g1_10:NOTYPE:???? " |
| 427 | |
| 428 | |
| 429 | |
| 430 | check_policy_agent_logs |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 431 | if [[ $interface = *"SDNC"* ]]; then |
| 432 | check_sdnc_logs |
| 433 | fi |
| 434 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 435 | store_logs ${interface} |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 436 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 437 | done |
| 438 | |
| 439 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 440 | #### TEST COMPLETE #### |
| 441 | |
| 442 | |
| 443 | print_result |
| 444 | |
| 445 | auto_clean_containers |