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 | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 20 | TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via a1pms REST/DMAAP/DMAAP_BATCH and SDNC using http or https" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 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 | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 23 | DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +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 | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 26 | KUBE_INCLUDED_IMAGES="CP CR MR A1PMS 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 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 30 | #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if |
| 31 | #the image is not configured in the supplied env_file |
| 32 | #Used for images not applicable to all supported profile |
BjornMagnussonXA | 8fbb226 | 2022-01-24 15:20:15 +0100 | [diff] [blame] | 33 | CONDITIONALLY_IGNORED_IMAGES="CBS CONSUL NGW" |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 34 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 35 | #Supported test environment profiles |
BjornMagnussonXA | e60d04e | 2021-12-27 13:38:01 +0100 | [diff] [blame] | 36 | SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ONAP-JAKARTA ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE ORAN-F-RELEASE" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 37 | #Supported run modes |
| 38 | SUPPORTED_RUNMODES="DOCKER KUBE" |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 39 | |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 40 | . ../common/testcase_common.sh $@ |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 41 | |
| 42 | setup_testenvironment |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 43 | |
| 44 | #### TEST BEGIN #### |
| 45 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 46 | generate_policy_uuid |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 47 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 48 | #Local vars in test script |
| 49 | ########################## |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 50 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 51 | # Number of RICs per interface type (OSC and STD) |
| 52 | NUM_RICS=30 |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 53 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 54 | NUM_RICS=20 # 3 A1 interfaces test, less sims per interface. total sims will be same |
| 55 | fi |
| 56 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 57 | # Number of policy instances per RIC |
| 58 | NUM_INSTANCES=5 |
| 59 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 60 | DAYS=3 |
| 61 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 62 | clean_environment |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 63 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 64 | start_kube_proxy |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 65 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 66 | # use HTTP or HTTPS for all apis |
| 67 | HTTPX=HTTPS |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 68 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 69 | if [ $HTTPX == "HTTP" ]; then |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 70 | use_cr_http |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 71 | use_a1pms_rest_http |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 72 | use_sdnc_http |
| 73 | use_simulator_http |
| 74 | else |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 75 | use_cr_https |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 76 | use_a1pms_rest_https |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 77 | use_sdnc_https |
| 78 | use_simulator_https |
| 79 | fi |
| 80 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 81 | start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0 |
| 82 | |
| 83 | start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3 |
| 84 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 85 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 86 | start_ric_simulators ricsim_g3 $NUM_RICS STD_2.0.0 |
| 87 | fi |
| 88 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 89 | start_mr |
| 90 | |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 91 | start_cr 1 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 92 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 93 | start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 94 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 95 | if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then |
| 96 | start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE |
| 97 | fi |
| 98 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 99 | start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 100 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 101 | prepare_consul_config SDNC ".consul_config.json" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 102 | |
| 103 | if [ $RUNMODE == "KUBE" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 104 | a1pms_load_config ".consul_config.json" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 105 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 106 | if [[ "$A1PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then |
| 107 | a1pms_api_put_configuration 200 ".consul_config.json" |
BjornMagnussonXA | 8fbb226 | 2022-01-24 15:20:15 +0100 | [diff] [blame] | 108 | else |
| 109 | start_consul_cbs |
| 110 | consul_config_app ".consul_config.json" |
| 111 | fi |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 112 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 113 | |
| 114 | start_sdnc |
| 115 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 116 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 117 | a1pms_api_get_status 200 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 118 | |
| 119 | echo "Print the interface for group 1 simulators, shall be OSC" |
| 120 | for ((i=1; i<=$NUM_RICS; i++)) |
| 121 | do |
| 122 | sim_print ricsim_g1_$i interface |
| 123 | done |
| 124 | |
| 125 | echo "Print the interface for group 2 simulators, shall be STD" |
| 126 | for ((i=1; i<=$NUM_RICS; i++)) |
| 127 | do |
| 128 | sim_print ricsim_g2_$i interface |
| 129 | done |
| 130 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 131 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 132 | echo "Print the interface for group 2 simulators, shall be STD 2" |
| 133 | for ((i=1; i<=$NUM_RICS; i++)) |
| 134 | do |
| 135 | sim_print ricsim_g3_$i interface |
| 136 | done |
| 137 | fi |
| 138 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 139 | echo "Load policy type in group 1 simulators" |
| 140 | for ((i=1; i<=$NUM_RICS; i++)) |
| 141 | do |
| 142 | sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json |
| 143 | done |
| 144 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 145 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 146 | echo "Load policy type in group 3 simulators" |
| 147 | for ((i=1; i<=$NUM_RICS; i++)) |
| 148 | do |
| 149 | sim_put_policy_type 201 ricsim_g3_$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json |
| 150 | done |
| 151 | fi |
| 152 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 153 | echo "Check the number of instances in group 1 simulators, shall be 0" |
| 154 | for ((i=1; i<=$NUM_RICS; i++)) |
| 155 | do |
| 156 | sim_equal ricsim_g1_$i num_instances 0 |
| 157 | done |
| 158 | |
| 159 | echo "Check the number of instances in group 2 simulators, shall be 0" |
| 160 | for ((i=1; i<=$NUM_RICS; i++)) |
| 161 | do |
| 162 | sim_equal ricsim_g2_$i num_instances 0 |
| 163 | done |
| 164 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 165 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 166 | echo "Check the number of instances in group 3 simulators, shall be 0" |
| 167 | for ((i=1; i<=$NUM_RICS; i++)) |
| 168 | do |
| 169 | sim_equal ricsim_g3_$i num_instances 0 |
| 170 | done |
| 171 | fi |
| 172 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 173 | echo "Wait for the a1pms to refresh types from the simulator" |
| 174 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 175 | a1pms_equal json:policy-types 3 300 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 176 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 177 | a1pms_equal json:policy_types 2 300 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 178 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 179 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 180 | echo "Check the number of types in the a1pms for each ric is 1" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 181 | for ((i=1; i<=$NUM_RICS; i++)) |
| 182 | do |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 183 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 184 | a1pms_equal json:policy-types?ric_id=ricsim_g1_$i 1 120 |
| 185 | a1pms_equal json:policy-types?ric_id=ricsim_g3_$i 1 120 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 186 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 187 | a1pms_equal json:policy_types?ric=ricsim_g1_$i 1 120 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 188 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 189 | done |
| 190 | |
| 191 | echo "Register a service" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 192 | a1pms_api_put_service 201 "serv1" 0 "$CR_SERVICE_APP_PATH_0/1" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 193 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 194 | TEST_DURATION=$((24*3600*$DAYS)) |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 195 | TEST_START=$SECONDS |
| 196 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 197 | A1PMS_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 198 | |
| 199 | MR_MESSAGES=0 |
| 200 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 201 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 202 | notificationurl=$CR_SERVICE_APP_PATH_0"/test" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 203 | else |
| 204 | notificationurl="" |
| 205 | fi |
| 206 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 207 | while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do |
| 208 | |
| 209 | echo "" |
| 210 | echo "#########################################################################################################" |
| 211 | echo -e $BOLD"INFO: Test executed for: "$(($SECONDS-$TEST_START)) "seconds. Target is: "$TEST_DURATION" seconds."$EBOLD |
| 212 | echo "#########################################################################################################" |
| 213 | echo "" |
| 214 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 215 | for interface in $A1PMS_INTERFACES ; do |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 216 | |
| 217 | echo "############################################" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 218 | echo "## Testing using a1pms interface: $interface ##" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 219 | echo "############################################" |
| 220 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 221 | if [ $interface == "REST" ] || [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 222 | if [ $HTTPX == "HTTP" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 223 | use_a1pms_rest_http |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 224 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 225 | use_a1pms_rest_https |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 226 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 227 | else |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 228 | if [ $HTTPX == "HTTPS" ]; then |
| 229 | echo "Using secure ports towards dmaap" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 230 | use_a1pms_dmaap_https |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 231 | else |
| 232 | echo "Using non-secure ports towards dmaap" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 233 | use_a1pms_dmaap_http |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 234 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 235 | fi |
| 236 | |
| 237 | echo "Create $NUM_INSTANCES instances in each OSC RIC" |
| 238 | INSTANCE_ID=200000 |
| 239 | INSTANCES=0 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 240 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 241 | a1pms_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] | 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 | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 246 | a1pms_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] | 247 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 248 | a1pms_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] | 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_g1_$i num_instances $NUM_INSTANCES |
| 254 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 255 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 256 | done |
| 257 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 258 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 259 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 260 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 261 | a1pms_equal json:policy_ids $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 262 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 263 | |
| 264 | echo "Create $NUM_INSTANCES instances in each STD RIC" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 265 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 266 | a1pms_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] | 267 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 268 | for ((i=1; i<=$NUM_RICS; i++)) |
| 269 | do |
| 270 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 271 | a1pms_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] | 272 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 273 | a1pms_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] | 274 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 275 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 276 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 277 | fi |
| 278 | sim_equal ricsim_g2_$i num_instances $NUM_INSTANCES |
| 279 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 280 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 281 | done |
| 282 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 283 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 284 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 285 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 286 | a1pms_equal json:policy_ids $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 287 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 288 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 289 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 290 | echo "Create $NUM_INSTANCES instances in each STD 2 RIC" |
| 291 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 292 | a1pms_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 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 293 | fi |
| 294 | for ((i=1; i<=$NUM_RICS; i++)) |
| 295 | do |
| 296 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 297 | a1pms_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 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 298 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 299 | a1pms_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 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 300 | fi |
| 301 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
| 302 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 303 | fi |
| 304 | sim_equal ricsim_g3_$i num_instances $NUM_INSTANCES |
| 305 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 306 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 307 | done |
| 308 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 309 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 310 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 311 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 312 | a1pms_equal json:policy_ids $INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 313 | fi |
| 314 | fi |
| 315 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 316 | |
| 317 | echo "Delete all instances in each OSC RIC" |
| 318 | |
| 319 | INSTANCE_ID=200000 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 320 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 321 | a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 322 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 323 | for ((i=1; i<=$NUM_RICS; i++)) |
| 324 | do |
| 325 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 326 | a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 327 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 328 | a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 329 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 330 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 331 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 332 | fi |
| 333 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 334 | sim_equal ricsim_g1_$i num_instances 0 |
| 335 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 336 | done |
| 337 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 338 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 339 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 340 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 341 | a1pms_equal json:policy_ids $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 342 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 343 | |
| 344 | echo "Delete all instances in each STD RIC" |
| 345 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 346 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 347 | a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 348 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 349 | for ((i=1; i<=$NUM_RICS; i++)) |
| 350 | do |
| 351 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 352 | a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 353 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 354 | a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 355 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 356 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 357 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 358 | fi |
| 359 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 360 | sim_equal ricsim_g2_$i num_instances 0 |
| 361 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 362 | done |
| 363 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 364 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 365 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 366 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 367 | a1pms_equal json:policy_ids $INSTANCES |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 368 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 369 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 370 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 371 | echo "Delete all instances in each STD 2 RIC" |
| 372 | |
| 373 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 374 | a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 375 | fi |
| 376 | for ((i=1; i<=$NUM_RICS; i++)) |
| 377 | do |
| 378 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 379 | a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 380 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 381 | a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 382 | fi |
| 383 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
| 384 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 385 | fi |
| 386 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 387 | sim_equal ricsim_g3_$i num_instances 0 |
| 388 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 389 | done |
| 390 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 391 | if [ "$A1PMS_VERSION" == "V2" ]; then |
| 392 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 393 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 394 | a1pms_equal json:policy_ids $INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 395 | fi |
| 396 | fi |
| 397 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 398 | mr_equal requests_submitted $MR_MESSAGES |
| 399 | mr_equal requests_fetched $MR_MESSAGES |
| 400 | mr_equal responses_submitted $MR_MESSAGES |
| 401 | mr_equal responses_fetched $MR_MESSAGES |
| 402 | mr_equal current_requests 0 |
| 403 | mr_equal current_responses 0 |
| 404 | |
| 405 | |
| 406 | for ((i=1; i<=$NUM_RICS; i++)) |
| 407 | do |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 408 | sim_contains_str ricsim_g1_$i remote_hosts $SDNC_APP_NAME |
| 409 | sim_contains_str ricsim_g2_$i remote_hosts $SDNC_APP_NAME |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 410 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 411 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 412 | sim_contains_str ricsim_g3_$i remote_hosts $SDNC_APP_NAME |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 413 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 414 | done |
| 415 | |
| 416 | done |
| 417 | |
| 418 | done |
| 419 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 420 | check_a1pms_logs |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 421 | check_sdnc_logs |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 422 | |
| 423 | #### TEST COMPLETE #### |
| 424 | |
| 425 | store_logs END |
| 426 | |
| 427 | print_result |
| 428 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 429 | auto_clean_environment |