BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [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 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 21 | TC_ONELINE_DESCR="ECS Create 10000 jobs and restart, test job persistency" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [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 | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 24 | DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR CP NGW" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [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 | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 27 | KUBE_INCLUDED_IMAGES="ECS PRODSTUB CP CR KUBEPROXY NGW" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 28 | #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list |
| 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 |
| 34 | CONDITIONALLY_IGNORED_IMAGES="NGW" |
| 35 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 36 | #Supported test environment profiles |
BjornMagnussonXA | 674793d | 2021-05-06 19:49:17 +0200 | [diff] [blame^] | 37 | SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 38 | #Supported run modes |
| 39 | SUPPORTED_RUNMODES="DOCKER KUBE" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 40 | |
| 41 | . ../common/testcase_common.sh $@ |
| 42 | . ../common/ecs_api_functions.sh |
| 43 | . ../common/prodstub_api_functions.sh |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 44 | . ../common/control_panel_api_functions.sh |
| 45 | . ../common/controller_api_functions.sh |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 46 | . ../common/cr_api_functions.sh |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 47 | . ../common/kube_proxy_api_functions.sh |
| 48 | . ../common/gateway_api_functions.sh |
| 49 | |
| 50 | setup_testenvironment |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 51 | |
| 52 | #### TEST BEGIN #### |
| 53 | |
| 54 | FLAT_A1_EI="1" |
| 55 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 56 | clean_environment |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 57 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 58 | if [ $RUNMODE == "KUBE" ]; then |
| 59 | start_kube_proxy |
| 60 | fi |
| 61 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 62 | use_ecs_rest_http |
| 63 | |
| 64 | use_prod_stub_http |
| 65 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 66 | start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 67 | |
| 68 | start_prod_stub |
| 69 | |
| 70 | set_ecs_trace |
| 71 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 72 | start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE |
| 73 | |
| 74 | if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then |
| 75 | start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE |
| 76 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 77 | |
| 78 | start_cr |
| 79 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 80 | CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK" |
| 81 | CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 82 | TARGET="http://localhost:80/target" # Dummy target |
| 83 | |
| 84 | NUM_JOBS=10000 |
| 85 | |
| 86 | # Setup prodstub sim to accept calls for producers, types and jobs |
| 87 | prodstub_arm_producer 200 prod-a |
| 88 | prodstub_arm_producer 200 prod-b |
| 89 | prodstub_arm_producer 200 prod-c |
| 90 | prodstub_arm_producer 200 prod-d |
| 91 | |
| 92 | prodstub_arm_type 200 prod-a type1 |
| 93 | |
| 94 | prodstub_arm_type 200 prod-b type1 |
| 95 | prodstub_arm_type 200 prod-b type2 |
| 96 | |
| 97 | prodstub_arm_type 200 prod-c type1 |
| 98 | prodstub_arm_type 200 prod-c type2 |
| 99 | prodstub_arm_type 200 prod-c type3 |
| 100 | |
| 101 | prodstub_arm_type 200 prod-d type4 |
| 102 | prodstub_arm_type 200 prod-d type5 |
| 103 | |
| 104 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 105 | do |
| 106 | if [ $(($i%5)) -eq 0 ]; then |
| 107 | prodstub_arm_job_create 200 prod-a job$i |
| 108 | prodstub_arm_job_create 200 prod-b job$i |
| 109 | prodstub_arm_job_create 200 prod-c job$i |
| 110 | fi |
| 111 | if [ $(($i%5)) -eq 1 ]; then |
| 112 | prodstub_arm_job_create 200 prod-b job$i |
| 113 | prodstub_arm_job_create 200 prod-c job$i |
| 114 | fi |
| 115 | if [ $(($i%5)) -eq 2 ]; then |
| 116 | prodstub_arm_job_create 200 prod-c job$i |
| 117 | fi |
| 118 | if [ $(($i%5)) -eq 3 ]; then |
| 119 | prodstub_arm_job_create 200 prod-d job$i |
| 120 | fi |
| 121 | if [ $(($i%5)) -eq 4 ]; then |
| 122 | prodstub_arm_job_create 200 prod-d job$i |
| 123 | fi |
| 124 | done |
| 125 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 126 | if [ $ECS_VERSION == "V1-1" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 127 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 128 | ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 129 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 130 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 131 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 132 | ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json type3 testdata/ecs/ei-type-3.json |
| 133 | |
| 134 | ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json type5 testdata/ecs/ei-type-5.json |
| 135 | |
| 136 | else |
| 137 | |
| 138 | ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json |
| 139 | ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json |
| 140 | ecs_api_edp_put_type_2 201 type3 testdata/ecs/ei-type-3.json |
| 141 | ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json |
| 142 | ecs_api_edp_put_type_2 201 type5 testdata/ecs/ei-type-5.json |
| 143 | |
| 144 | ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 145 | |
| 146 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 |
| 147 | |
| 148 | ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 |
| 149 | |
| 150 | ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 |
| 151 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 152 | |
| 153 | ecs_equal json:ei-producer/v1/eiproducers 4 |
| 154 | |
| 155 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 156 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 157 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 158 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 159 | |
| 160 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 161 | do |
| 162 | if [ $(($i%5)) -eq 0 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 163 | ecs_api_a1_put_job 201 job$i type1 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 164 | if [ -z "$FLAT_A1_EI" ]; then |
| 165 | ecs_api_a1_get_job_status 200 type1 job$i ENABLED |
| 166 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 167 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 168 | fi |
| 169 | fi |
| 170 | if [ $(($i%5)) -eq 1 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 171 | ecs_api_a1_put_job 201 job$i type2 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 172 | if [ -z "$FLAT_A1_EI" ]; then |
| 173 | ecs_api_a1_get_job_status 200 type2 job$i ENABLED |
| 174 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 175 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 176 | fi |
| 177 | fi |
| 178 | if [ $(($i%5)) -eq 2 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 179 | ecs_api_a1_put_job 201 job$i type3 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 180 | if [ -z "$FLAT_A1_EI" ]; then |
| 181 | ecs_api_a1_get_job_status 200 type3 job$i ENABLED |
| 182 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 183 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 184 | fi |
| 185 | fi |
| 186 | if [ $(($i%5)) -eq 3 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 187 | ecs_api_a1_put_job 201 job$i type4 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 188 | if [ -z "$FLAT_A1_EI" ]; then |
| 189 | ecs_api_a1_get_job_status 200 type4 job$i ENABLED |
| 190 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 191 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 192 | fi |
| 193 | fi |
| 194 | if [ $(($i%5)) -eq 4 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 195 | ecs_api_a1_put_job 201 job$i type5 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 196 | if [ -z "$FLAT_A1_EI" ]; then |
| 197 | ecs_api_a1_get_job_status 200 type5 job$i ENABLED |
| 198 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 199 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 200 | fi |
| 201 | fi |
| 202 | done |
| 203 | |
| 204 | if [ -z "$FLAT_A1_EI" ]; then |
| 205 | ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5)) |
| 206 | ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5)) |
| 207 | ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5)) |
| 208 | ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5)) |
| 209 | ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5)) |
| 210 | else |
| 211 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 212 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 213 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 214 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 215 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 216 | fi |
| 217 | |
BjornMagnussonXA | a69cd90 | 2021-04-22 23:46:10 +0200 | [diff] [blame] | 218 | stop_ecs |
| 219 | |
| 220 | start_stopped_ecs |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 221 | |
| 222 | set_ecs_trace |
| 223 | |
| 224 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 225 | do |
| 226 | if [ $(($i%5)) -eq 0 ]; then |
| 227 | prodstub_delete_jobdata 204 prod-a job$i |
| 228 | prodstub_delete_jobdata 204 prod-b job$i |
| 229 | prodstub_delete_jobdata 204 prod-c job$i |
| 230 | fi |
| 231 | if [ $(($i%5)) -eq 1 ]; then |
| 232 | prodstub_delete_jobdata 204 prod-b job$i |
| 233 | prodstub_delete_jobdata 204 prod-c job$i |
| 234 | fi |
| 235 | if [ $(($i%5)) -eq 2 ]; then |
| 236 | prodstub_delete_jobdata 204 prod-c job$i |
| 237 | fi |
| 238 | if [ $(($i%5)) -eq 3 ]; then |
| 239 | prodstub_delete_jobdata 204 prod-d job$i |
| 240 | fi |
| 241 | if [ $(($i%5)) -eq 4 ]; then |
| 242 | prodstub_delete_jobdata 204 prod-d job$i |
| 243 | fi |
| 244 | done |
| 245 | |
| 246 | ecs_api_edp_get_producer_status 404 prod-a |
| 247 | ecs_api_edp_get_producer_status 404 prod-b |
| 248 | ecs_api_edp_get_producer_status 404 prod-c |
| 249 | ecs_api_edp_get_producer_status 404 prod-d |
| 250 | |
| 251 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 252 | do |
| 253 | if [ $(($i%5)) -eq 0 ]; then |
| 254 | if [ -z "$FLAT_A1_EI" ]; then |
| 255 | ecs_api_a1_get_job_status 200 type1 job$i DISABLED |
| 256 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 257 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 258 | fi |
| 259 | fi |
| 260 | if [ $(($i%5)) -eq 1 ]; then |
| 261 | if [ -z "$FLAT_A1_EI" ]; then |
| 262 | ecs_api_a1_get_job_status 200 type2 job$i DISABLED |
| 263 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 264 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 265 | fi |
| 266 | fi |
| 267 | if [ $(($i%5)) -eq 2 ]; then |
| 268 | if [ -z "$FLAT_A1_EI" ]; then |
| 269 | ecs_api_a1_get_job_status 200 type3 job$i DISABLED |
| 270 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 271 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 272 | fi |
| 273 | fi |
| 274 | if [ $(($i%5)) -eq 3 ]; then |
| 275 | if [ -z "$FLAT_A1_EI" ]; then |
| 276 | ecs_api_a1_get_job_status 200 type4 job$i DISABLED |
| 277 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 278 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 279 | fi |
| 280 | fi |
| 281 | if [ $(($i%5)) -eq 4 ]; then |
| 282 | if [ -z "$FLAT_A1_EI" ]; then |
| 283 | ecs_api_a1_get_job_status 200 type5 job$i DISABLED |
| 284 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 285 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 286 | fi |
| 287 | fi |
| 288 | done |
| 289 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 290 | if [ $ECS_VERSION == "V1-1" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 291 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 292 | ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 293 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 294 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 295 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 296 | ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json type3 testdata/ecs/ei-type-3.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 297 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 298 | ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json type5 testdata/ecs/ei-type-5.json |
| 299 | |
| 300 | else |
| 301 | ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 302 | |
| 303 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 |
| 304 | |
| 305 | ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 |
| 306 | |
| 307 | ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 |
| 308 | |
| 309 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 310 | |
| 311 | ecs_equal json:ei-producer/v1/eiproducers 4 |
| 312 | |
| 313 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 314 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 315 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 316 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 317 | |
| 318 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 319 | do |
| 320 | if [ $(($i%5)) -eq 0 ]; then |
| 321 | if [ -z "$FLAT_A1_EI" ]; then |
| 322 | ecs_api_a1_get_job_status 200 type1 job$i ENABLED |
| 323 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 324 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 325 | fi |
| 326 | fi |
| 327 | if [ $(($i%5)) -eq 1 ]; then |
| 328 | if [ -z "$FLAT_A1_EI" ]; then |
| 329 | ecs_api_a1_get_job_status 200 type2 job$i ENABLED |
| 330 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 331 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 332 | fi |
| 333 | fi |
| 334 | if [ $(($i%5)) -eq 2 ]; then |
| 335 | if [ -z "$FLAT_A1_EI" ]; then |
| 336 | ecs_api_a1_get_job_status 200 type3 job$i ENABLED |
| 337 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 338 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 339 | fi |
| 340 | fi |
| 341 | if [ $(($i%5)) -eq 3 ]; then |
| 342 | if [ -z "$FLAT_A1_EI" ]; then |
| 343 | ecs_api_a1_get_job_status 200 type4 job$i ENABLED |
| 344 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 345 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 346 | fi |
| 347 | fi |
| 348 | if [ $(($i%5)) -eq 4 ]; then |
| 349 | if [ -z "$FLAT_A1_EI" ]; then |
| 350 | ecs_api_a1_get_job_status 200 type5 job$i ENABLED |
| 351 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 352 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 353 | fi |
| 354 | fi |
| 355 | done |
| 356 | |
| 357 | |
| 358 | if [ -z "$FLAT_A1_EI" ]; then |
| 359 | ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5)) |
| 360 | ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5)) |
| 361 | ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5)) |
| 362 | ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5)) |
| 363 | ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5)) |
| 364 | else |
| 365 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 366 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 367 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 368 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 369 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
| 370 | fi |
| 371 | |
| 372 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 373 | do |
| 374 | if [ $(($i%5)) -eq 0 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 375 | if [ $ECS_VERSION == "V1-1" ]; then |
| 376 | prodstub_check_jobdata 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 377 | prodstub_check_jobdata 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 378 | prodstub_check_jobdata 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 379 | else |
| 380 | prodstub_check_jobdata_2 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 381 | prodstub_check_jobdata_2 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 382 | prodstub_check_jobdata_2 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 383 | fi |
| 384 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 385 | fi |
| 386 | if [ $(($i%5)) -eq 1 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 387 | if [ $ECS_VERSION == "V1-1" ]; then |
| 388 | prodstub_check_jobdata 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 389 | prodstub_check_jobdata 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 390 | else |
| 391 | prodstub_check_jobdata_2 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 392 | prodstub_check_jobdata_2 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 393 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 394 | fi |
| 395 | if [ $(($i%5)) -eq 2 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 396 | if [ $ECS_VERSION == "V1-1" ]; then |
| 397 | prodstub_check_jobdata 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json |
| 398 | else |
| 399 | prodstub_check_jobdata_2 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json |
| 400 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 401 | fi |
| 402 | if [ $(($i%5)) -eq 3 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 403 | if [ $ECS_VERSION == "V1-1" ]; then |
| 404 | prodstub_check_jobdata 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json |
| 405 | else |
| 406 | prodstub_check_jobdata_2 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json |
| 407 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 408 | fi |
| 409 | if [ $(($i%5)) -eq 4 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 410 | if [ $ECS_VERSION == "V1-1" ]; then |
| 411 | prodstub_check_jobdata 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json |
| 412 | else |
| 413 | prodstub_check_jobdata_2 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json |
| 414 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 415 | fi |
| 416 | done |
| 417 | |
| 418 | |
| 419 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 420 | do |
| 421 | if [ $(($i%5)) -eq 0 ]; then |
| 422 | ecs_api_a1_delete_job 204 job$i |
| 423 | fi |
| 424 | if [ $(($i%5)) -eq 1 ]; then |
| 425 | ecs_api_a1_delete_job 204 job$i |
| 426 | fi |
| 427 | if [ $(($i%5)) -eq 2 ]; then |
| 428 | ecs_api_a1_delete_job 204 job$i |
| 429 | fi |
| 430 | if [ $(($i%5)) -eq 3 ]; then |
| 431 | ecs_api_a1_delete_job 204 job$i |
| 432 | fi |
| 433 | if [ $(($i%5)) -eq 4 ]; then |
| 434 | ecs_api_a1_delete_job 204 job$i |
| 435 | fi |
| 436 | done |
| 437 | |
| 438 | ecs_equal json:ei-producer/v1/eiproducers 4 |
| 439 | |
| 440 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 441 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 442 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 443 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 444 | |
| 445 | if [ -z "$FLAT_A1_EI" ]; then |
| 446 | ecs_equal json:A1-EI/v1/eitypes/type1/eijobs 0 |
| 447 | ecs_equal json:A1-EI/v1/eitypes/type2/eijobs 0 |
| 448 | ecs_equal json:A1-EI/v1/eitypes/type3/eijobs 0 |
| 449 | ecs_equal json:A1-EI/v1/eitypes/type4/eijobs 0 |
| 450 | ecs_equal json:A1-EI/v1/eitypes/type5/eijobs 0 |
| 451 | else |
| 452 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0 |
| 453 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0 |
| 454 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0 |
| 455 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0 |
| 456 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0 |
| 457 | fi |
| 458 | |
| 459 | check_ecs_logs |
| 460 | |
| 461 | store_logs END |
| 462 | |
| 463 | #### TEST COMPLETE #### |
| 464 | |
| 465 | |
| 466 | print_result |
| 467 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 468 | auto_clean_environment |