BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # ============LICENSE_START=============================================== |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 4 | # Copyright (C) 2020-2023 Nordix Foundation. All rights reserved. |
rohithrajneesh | 927c17e | 2023-12-01 14:26:03 +0000 | [diff] [blame^] | 5 | # Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved. |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 6 | # ======================================================================== |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # ============LICENSE_END================================================= |
| 19 | # |
| 20 | |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 21 | TC_ONELINE_DESCR="Repeatedly create and delete policies in each RICs for 24h (or configured number of days). Via a1pms REST and with SDNC using http or https" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 22 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 23 | #App names to include in the test when running docker, space separated list |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 24 | DOCKER_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC NGW KUBEPROXY" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 25 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 26 | #App names to include in the test when running kubernetes, space separated list |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 27 | KUBE_INCLUDED_IMAGES="CP CR MR A1PMS RICSIM SDNC KUBEPROXY NGW" |
BjornMagnussonXA | d54225b | 2023-04-19 14:03:49 +0200 | [diff] [blame] | 28 | #Pre-started app (not started by script) to include in the test when running kubernetes, space separated list |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 29 | KUBE_PRESTARTED_IMAGES="" |
| 30 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 31 | #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if |
| 32 | #the image is not configured in the supplied env_file |
| 33 | #Used for images not applicable to all supported profile |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 34 | CONDITIONALLY_IGNORED_IMAGES="NGW" |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 35 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 36 | #Supported test environment profiles |
rohithrajneesh | 927c17e | 2023-12-01 14:26:03 +0000 | [diff] [blame^] | 37 | SUPPORTED_PROFILES="ONAP-KOHN ONAP-LONDON ONAP-MONTREAL ORAN-G-RELEASE ORAN-H-RELEASE ORAN-I-RELEASE" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 38 | #Supported run modes |
| 39 | SUPPORTED_RUNMODES="DOCKER KUBE" |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 40 | |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 41 | . ../common/testcase_common.sh $@ |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 42 | |
| 43 | setup_testenvironment |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 44 | |
| 45 | #### TEST BEGIN #### |
| 46 | |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 47 | sim_generate_policy_uuid |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 48 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 49 | #Local vars in test script |
| 50 | ########################## |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 51 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 52 | # Number of RICs per interface type (OSC and STD x 2) |
| 53 | NUM_RICS=20 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 54 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 55 | # Number of policy instances per RIC |
| 56 | NUM_INSTANCES=5 |
| 57 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 58 | DAYS=3 |
| 59 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 60 | clean_environment |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 61 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 62 | start_kube_proxy |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 63 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 64 | # use HTTP or HTTPS for all apis |
| 65 | HTTPX=HTTPS |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 66 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 67 | if [ $HTTPX == "HTTP" ]; then |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 68 | use_cr_http |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 69 | use_a1pms_rest_http |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 70 | use_sdnc_http |
| 71 | use_simulator_http |
| 72 | else |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 73 | use_cr_https |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 74 | use_a1pms_rest_https |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 75 | if [[ "$SDNC_FEATURE_LEVEL" == *"NO_NB_HTTPS"* ]]; then |
| 76 | deviation "SDNC does not support NB https" |
| 77 | use_sdnc_http |
| 78 | else |
| 79 | use_sdnc_https |
| 80 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 81 | use_simulator_https |
| 82 | fi |
| 83 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 84 | start_ric_simulators ricsim_g1 $NUM_RICS OSC_2.1.0 |
| 85 | |
| 86 | start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3 |
| 87 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 88 | start_ric_simulators ricsim_g3 $NUM_RICS STD_2.0.0 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 89 | |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 90 | if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then |
| 91 | : |
| 92 | else |
| 93 | start_mr |
| 94 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 95 | |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 96 | start_cr 1 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 97 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 98 | start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 99 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 100 | if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then |
| 101 | start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE |
| 102 | fi |
| 103 | |
BjornMagnussonXA | f4a7e42 | 2022-09-01 16:35:17 +0200 | [diff] [blame] | 104 | A1PMS_RETRY_CODES=423 |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 105 | start_a1pms NORPOXY $SIM_GROUP/$A1PMS_COMPOSE_DIR/$A1PMS_CONFIG_FILE |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 106 | |
BjornMagnussonXA | f81090f | 2022-08-24 09:17:44 +0200 | [diff] [blame] | 107 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 108 | |
| 109 | prepare_a1pms_config SDNC ".a1pms_config.json" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 110 | |
| 111 | if [ $RUNMODE == "KUBE" ]; then |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 112 | a1pms_load_config ".a1pms_config.json" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 113 | else |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 114 | a1pms_api_put_configuration 200 ".a1pms_config.json" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 115 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 116 | |
| 117 | start_sdnc |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 118 | controller_api_wait_for_status_ok 200 ricsim_g1_1 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 119 | |
BjornMagnussonXA | d54225b | 2023-04-19 14:03:49 +0200 | [diff] [blame] | 120 | sleep_wait 120 "Let A1PMS configuration take effect" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 121 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 122 | a1pms_api_get_status 200 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 123 | |
| 124 | echo "Print the interface for group 1 simulators, shall be OSC" |
| 125 | for ((i=1; i<=$NUM_RICS; i++)) |
| 126 | do |
| 127 | sim_print ricsim_g1_$i interface |
| 128 | done |
| 129 | |
| 130 | echo "Print the interface for group 2 simulators, shall be STD" |
| 131 | for ((i=1; i<=$NUM_RICS; i++)) |
| 132 | do |
| 133 | sim_print ricsim_g2_$i interface |
| 134 | done |
| 135 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 136 | echo "Print the interface for group 2 simulators, shall be STD 2" |
| 137 | for ((i=1; i<=$NUM_RICS; i++)) |
| 138 | do |
| 139 | sim_print ricsim_g3_$i interface |
| 140 | done |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 141 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 142 | echo "Load policy type in group 1 simulators" |
| 143 | for ((i=1; i<=$NUM_RICS; i++)) |
| 144 | do |
| 145 | sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json |
| 146 | done |
| 147 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 148 | echo "Load policy type in group 3 simulators" |
| 149 | for ((i=1; i<=$NUM_RICS; i++)) |
| 150 | do |
| 151 | sim_put_policy_type 201 ricsim_g3_$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json |
| 152 | done |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 153 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 154 | echo "Check the number of instances in group 1 simulators, shall be 0" |
| 155 | for ((i=1; i<=$NUM_RICS; i++)) |
| 156 | do |
| 157 | sim_equal ricsim_g1_$i num_instances 0 |
| 158 | done |
| 159 | |
| 160 | echo "Check the number of instances in group 2 simulators, shall be 0" |
| 161 | for ((i=1; i<=$NUM_RICS; i++)) |
| 162 | do |
| 163 | sim_equal ricsim_g2_$i num_instances 0 |
| 164 | done |
| 165 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +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 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 171 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 172 | echo "Wait for the a1pms to refresh types from the simulator" |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 173 | a1pms_equal json:policy-types 3 300 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 174 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 175 | 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] | 176 | for ((i=1; i<=$NUM_RICS; i++)) |
| 177 | do |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 178 | a1pms_equal json:policy-types?ric_id=ricsim_g1_$i 1 120 |
| 179 | a1pms_equal json:policy-types?ric_id=ricsim_g3_$i 1 120 |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 180 | done |
| 181 | |
| 182 | echo "Register a service" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 183 | a1pms_api_put_service 201 "serv1" 0 "$CR_SERVICE_APP_PATH_0/1" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 184 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 185 | TEST_DURATION=$((24*3600*$DAYS)) |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 186 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 187 | TEST_START=$SECONDS |
| 188 | |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 189 | if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then |
| 190 | A1PMS_INTERFACES="REST REST_PARALLEL" |
| 191 | else |
| 192 | A1PMS_INTERFACES="REST REST_PARALLEL DMAAP DMAAP-BATCH" |
| 193 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 194 | |
| 195 | MR_MESSAGES=0 |
| 196 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 197 | notificationurl=$CR_SERVICE_APP_PATH_0"/test" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 198 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 199 | while [ $(($SECONDS-$TEST_START)) -lt $TEST_DURATION ]; do |
| 200 | |
| 201 | echo "" |
| 202 | echo "#########################################################################################################" |
| 203 | echo -e $BOLD"INFO: Test executed for: "$(($SECONDS-$TEST_START)) "seconds. Target is: "$TEST_DURATION" seconds."$EBOLD |
| 204 | echo "#########################################################################################################" |
| 205 | echo "" |
| 206 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 207 | for interface in $A1PMS_INTERFACES ; do |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 208 | |
| 209 | echo "############################################" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 210 | echo "## Testing using a1pms interface: $interface ##" |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 211 | echo "############################################" |
| 212 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 213 | if [ $interface == "REST" ] || [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 214 | if [ $HTTPX == "HTTP" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 215 | use_a1pms_rest_http |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 216 | else |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 217 | use_a1pms_rest_https |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 218 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 219 | else |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 220 | if [ $HTTPX == "HTTPS" ]; then |
| 221 | echo "Using secure ports towards dmaap" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 222 | use_a1pms_dmaap_https |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 223 | else |
| 224 | echo "Using non-secure ports towards dmaap" |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 225 | use_a1pms_dmaap_http |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 226 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 227 | fi |
| 228 | |
| 229 | echo "Create $NUM_INSTANCES instances in each OSC RIC" |
| 230 | INSTANCE_ID=200000 |
| 231 | INSTANCES=0 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 232 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 233 | 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] | 234 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 235 | for ((i=1; i<=$NUM_RICS; i++)) |
| 236 | do |
| 237 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 238 | 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] | 239 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 240 | 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] | 241 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 242 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 243 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 244 | fi |
| 245 | sim_equal ricsim_g1_$i num_instances $NUM_INSTANCES |
| 246 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 247 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 248 | done |
| 249 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 250 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 251 | |
| 252 | echo "Create $NUM_INSTANCES instances in each STD RIC" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 253 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 254 | 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] | 255 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 256 | for ((i=1; i<=$NUM_RICS; i++)) |
| 257 | do |
| 258 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 259 | 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] | 260 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 261 | 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] | 262 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 263 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 264 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 265 | fi |
| 266 | sim_equal ricsim_g2_$i num_instances $NUM_INSTANCES |
| 267 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 268 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 269 | done |
| 270 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 271 | a1pms_equal json:policy-instances $INSTANCES |
| 272 | |
| 273 | echo "Create $NUM_INSTANCES instances in each STD 2 RIC" |
| 274 | if [ $interface == "REST_PARALLEL" ]; then |
| 275 | 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 | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 276 | fi |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 277 | for ((i=1; i<=$NUM_RICS; i++)) |
| 278 | do |
| 279 | if [ $interface == "DMAAP-BATCH" ]; then |
| 280 | 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 |
| 281 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
| 282 | 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] | 283 | fi |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 284 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
| 285 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 286 | fi |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 287 | sim_equal ricsim_g3_$i num_instances $NUM_INSTANCES |
| 288 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 289 | INSTANCES=$(($INSTANCES+$NUM_INSTANCES)) |
| 290 | done |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 291 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 292 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 293 | |
| 294 | echo "Delete all instances in each OSC RIC" |
| 295 | |
| 296 | INSTANCE_ID=200000 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 297 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 298 | a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 299 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 300 | for ((i=1; i<=$NUM_RICS; i++)) |
| 301 | do |
| 302 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 303 | a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 304 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 305 | a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 306 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 307 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 308 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 309 | fi |
| 310 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 311 | sim_equal ricsim_g1_$i num_instances 0 |
| 312 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 313 | done |
| 314 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 315 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 316 | |
| 317 | echo "Delete all instances in each STD RIC" |
| 318 | |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 319 | if [ $interface == "REST_PARALLEL" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 320 | a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 321 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 322 | for ((i=1; i<=$NUM_RICS; i++)) |
| 323 | do |
| 324 | if [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 325 | a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 326 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 327 | a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 328 | fi |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 329 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 330 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
| 331 | fi |
| 332 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 333 | sim_equal ricsim_g2_$i num_instances 0 |
| 334 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 335 | done |
| 336 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 337 | a1pms_equal json:policy-instances $INSTANCES |
| 338 | |
| 339 | echo "Delete all instances in each STD 2 RIC" |
| 340 | |
| 341 | if [ $interface == "REST_PARALLEL" ]; then |
| 342 | a1pms_api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 343 | fi |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 344 | for ((i=1; i<=$NUM_RICS; i++)) |
| 345 | do |
| 346 | if [ $interface == "DMAAP-BATCH" ]; then |
| 347 | a1pms_api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES |
| 348 | elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then |
| 349 | a1pms_api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 350 | fi |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 351 | if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then |
| 352 | MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES)) |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 353 | fi |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 354 | INSTANCES=$(($INSTANCES-$NUM_INSTANCES)) |
| 355 | sim_equal ricsim_g3_$i num_instances 0 |
| 356 | INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES)) |
| 357 | done |
| 358 | |
| 359 | a1pms_equal json:policy-instances $INSTANCES |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 360 | |
BjornMagnussonXA | 7d7cb5f | 2023-04-11 10:32:56 +0200 | [diff] [blame] | 361 | if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then |
| 362 | : |
| 363 | else |
| 364 | mr_equal requests_submitted $MR_MESSAGES |
| 365 | mr_equal requests_fetched $MR_MESSAGES |
| 366 | mr_equal responses_submitted $MR_MESSAGES |
| 367 | mr_equal responses_fetched $MR_MESSAGES |
| 368 | mr_equal current_requests 0 |
| 369 | mr_equal current_responses 0 |
| 370 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 371 | |
| 372 | |
| 373 | for ((i=1; i<=$NUM_RICS; i++)) |
| 374 | do |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 375 | sim_contains_str ricsim_g1_$i remote_hosts $SDNC_APP_NAME |
| 376 | sim_contains_str ricsim_g2_$i remote_hosts $SDNC_APP_NAME |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 377 | |
BjornMagnussonXA | f83c362 | 2023-02-28 10:05:51 +0100 | [diff] [blame] | 378 | sim_contains_str ricsim_g3_$i remote_hosts $SDNC_APP_NAME |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 379 | done |
| 380 | |
| 381 | done |
| 382 | |
| 383 | done |
| 384 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame] | 385 | check_a1pms_logs |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 386 | check_sdnc_logs |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 387 | |
| 388 | #### TEST COMPLETE #### |
| 389 | |
| 390 | store_logs END |
| 391 | |
| 392 | print_result |
| 393 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 394 | auto_clean_environment |