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