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