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 | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 21 | TC_ONELINE_DESCR="ECS Create 10000 jobs (ei and info) 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 | |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 86 | use_info_jobs=false #Set flag if interface supporting info-types is used |
| 87 | if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then |
| 88 | use_info_jobs=true |
| 89 | NUM_JOBS=5000 # 5K ei jobs and 5K info jobs |
| 90 | fi |
| 91 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 92 | # Setup prodstub sim to accept calls for producers, types and jobs |
| 93 | prodstub_arm_producer 200 prod-a |
| 94 | prodstub_arm_producer 200 prod-b |
| 95 | prodstub_arm_producer 200 prod-c |
| 96 | prodstub_arm_producer 200 prod-d |
| 97 | |
| 98 | prodstub_arm_type 200 prod-a type1 |
| 99 | |
| 100 | prodstub_arm_type 200 prod-b type1 |
| 101 | prodstub_arm_type 200 prod-b type2 |
| 102 | |
| 103 | prodstub_arm_type 200 prod-c type1 |
| 104 | prodstub_arm_type 200 prod-c type2 |
| 105 | prodstub_arm_type 200 prod-c type3 |
| 106 | |
| 107 | prodstub_arm_type 200 prod-d type4 |
| 108 | prodstub_arm_type 200 prod-d type5 |
| 109 | |
| 110 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 111 | do |
| 112 | if [ $(($i%5)) -eq 0 ]; then |
| 113 | prodstub_arm_job_create 200 prod-a job$i |
| 114 | prodstub_arm_job_create 200 prod-b job$i |
| 115 | prodstub_arm_job_create 200 prod-c job$i |
| 116 | fi |
| 117 | if [ $(($i%5)) -eq 1 ]; then |
| 118 | prodstub_arm_job_create 200 prod-b job$i |
| 119 | prodstub_arm_job_create 200 prod-c job$i |
| 120 | fi |
| 121 | if [ $(($i%5)) -eq 2 ]; then |
| 122 | prodstub_arm_job_create 200 prod-c job$i |
| 123 | fi |
| 124 | if [ $(($i%5)) -eq 3 ]; then |
| 125 | prodstub_arm_job_create 200 prod-d job$i |
| 126 | fi |
| 127 | if [ $(($i%5)) -eq 4 ]; then |
| 128 | prodstub_arm_job_create 200 prod-d job$i |
| 129 | fi |
| 130 | done |
| 131 | |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 132 | if [ $use_info_jobs ]; then |
| 133 | prodstub_arm_producer 200 prod-a |
| 134 | prodstub_arm_producer 200 prod-b |
| 135 | prodstub_arm_producer 200 prod-c |
| 136 | prodstub_arm_producer 200 prod-d |
| 137 | |
| 138 | prodstub_arm_type 200 prod-a type101 |
| 139 | |
| 140 | prodstub_arm_type 200 prod-b type101 |
| 141 | prodstub_arm_type 200 prod-b type102 |
| 142 | |
| 143 | prodstub_arm_type 200 prod-c type101 |
| 144 | prodstub_arm_type 200 prod-c type102 |
| 145 | prodstub_arm_type 200 prod-c type103 |
| 146 | |
| 147 | prodstub_arm_type 200 prod-d type104 |
| 148 | prodstub_arm_type 200 prod-d type105 |
| 149 | |
| 150 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 151 | do |
| 152 | if [ $(($i%5)) -eq 0 ]; then |
| 153 | prodstub_arm_job_create 200 prod-a job$(($i+$NUM_JOBS)) |
| 154 | prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS)) |
| 155 | prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS)) |
| 156 | fi |
| 157 | if [ $(($i%5)) -eq 1 ]; then |
| 158 | prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS)) |
| 159 | prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS)) |
| 160 | fi |
| 161 | if [ $(($i%5)) -eq 2 ]; then |
| 162 | prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS)) |
| 163 | fi |
| 164 | if [ $(($i%5)) -eq 3 ]; then |
| 165 | prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS)) |
| 166 | fi |
| 167 | if [ $(($i%5)) -eq 4 ]; then |
| 168 | prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS)) |
| 169 | fi |
| 170 | done |
| 171 | fi |
| 172 | |
| 173 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 174 | if [ $ECS_VERSION == "V1-1" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 175 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 176 | 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] | 177 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 178 | 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] | 179 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 180 | 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 |
| 181 | |
| 182 | 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 |
| 183 | |
| 184 | else |
| 185 | |
| 186 | ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json |
| 187 | ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json |
| 188 | ecs_api_edp_put_type_2 201 type3 testdata/ecs/ei-type-3.json |
| 189 | ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json |
| 190 | ecs_api_edp_put_type_2 201 type5 testdata/ecs/ei-type-5.json |
| 191 | |
| 192 | ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 193 | |
| 194 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 |
| 195 | |
| 196 | ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 |
| 197 | |
| 198 | ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 199 | |
| 200 | if [ $use_info_jobs ]; then |
| 201 | ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json |
| 202 | ecs_api_edp_put_type_2 201 type102 testdata/ecs/info-type-2.json |
| 203 | ecs_api_edp_put_type_2 201 type103 testdata/ecs/info-type-3.json |
| 204 | ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json |
| 205 | ecs_api_edp_put_type_2 201 type105 testdata/ecs/info-type-5.json |
| 206 | |
| 207 | ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 type101 |
| 208 | |
| 209 | ecs_api_edp_put_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 type101 type102 |
| 210 | |
| 211 | ecs_api_edp_put_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 type101 type102 type103 |
| 212 | |
| 213 | ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105 |
| 214 | fi |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 215 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 216 | |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 217 | if [ $use_info_jobs ]; then |
| 218 | ecs_equal json:data-producer/v1/info-producers 4 |
| 219 | else |
| 220 | ecs_equal json:ei-producer/v1/eiproducers 4 |
| 221 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 222 | |
| 223 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 224 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 225 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 226 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 227 | |
| 228 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 229 | do |
| 230 | if [ $(($i%5)) -eq 0 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 231 | 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] | 232 | if [ -z "$FLAT_A1_EI" ]; then |
| 233 | ecs_api_a1_get_job_status 200 type1 job$i ENABLED |
| 234 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 235 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 236 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 237 | if [ $use_info_jobs ]; then |
| 238 | ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type101 $TARGET info-owner $CR_SERVICE_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE |
| 239 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 240 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 241 | fi |
| 242 | if [ $(($i%5)) -eq 1 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 243 | 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] | 244 | if [ -z "$FLAT_A1_EI" ]; then |
| 245 | ecs_api_a1_get_job_status 200 type2 job$i ENABLED |
| 246 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 247 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 248 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 249 | if [ $use_info_jobs ]; then |
| 250 | ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type102 $TARGET info-owner $CR_SERVICE_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE |
| 251 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 252 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 253 | fi |
| 254 | if [ $(($i%5)) -eq 2 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 255 | 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] | 256 | if [ -z "$FLAT_A1_EI" ]; then |
| 257 | ecs_api_a1_get_job_status 200 type3 job$i ENABLED |
| 258 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 259 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 260 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 261 | if [ $use_info_jobs ]; then |
| 262 | ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type103 $TARGET info-owner $CR_SERVICE_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE |
| 263 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 264 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 265 | fi |
| 266 | if [ $(($i%5)) -eq 3 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 267 | 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] | 268 | if [ -z "$FLAT_A1_EI" ]; then |
| 269 | ecs_api_a1_get_job_status 200 type4 job$i ENABLED |
| 270 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 271 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 272 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 273 | if [ $use_info_jobs ]; then |
| 274 | ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type104 $TARGET info-owner $CR_SERVICE_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE |
| 275 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 276 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 277 | fi |
| 278 | if [ $(($i%5)) -eq 4 ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 279 | 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] | 280 | if [ -z "$FLAT_A1_EI" ]; then |
| 281 | ecs_api_a1_get_job_status 200 type5 job$i ENABLED |
| 282 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 283 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 284 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 285 | if [ $use_info_jobs ]; then |
| 286 | ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type105 $TARGET info-owner $CR_SERVICE_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE |
| 287 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 288 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 289 | fi |
| 290 | done |
| 291 | |
| 292 | if [ -z "$FLAT_A1_EI" ]; then |
| 293 | ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5)) |
| 294 | ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5)) |
| 295 | ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5)) |
| 296 | ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5)) |
| 297 | ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5)) |
| 298 | else |
| 299 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 300 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5)) |
| 301 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5)) |
| 302 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5)) |
| 303 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5)) |
| 304 | fi |
| 305 | if [ $use_info_jobs ]; then |
| 306 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5)) |
| 307 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5)) |
| 308 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5)) |
| 309 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5)) |
| 310 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5)) |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 311 | fi |
| 312 | |
BjornMagnussonXA | a69cd90 | 2021-04-22 23:46:10 +0200 | [diff] [blame] | 313 | stop_ecs |
| 314 | |
| 315 | start_stopped_ecs |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 316 | |
| 317 | set_ecs_trace |
| 318 | |
| 319 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 320 | do |
| 321 | if [ $(($i%5)) -eq 0 ]; then |
| 322 | prodstub_delete_jobdata 204 prod-a job$i |
| 323 | prodstub_delete_jobdata 204 prod-b job$i |
| 324 | prodstub_delete_jobdata 204 prod-c job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 325 | if [ $use_info_jobs ]; then |
| 326 | prodstub_delete_jobdata 204 prod-a job$(($i+$NUM_JOBS)) |
| 327 | prodstub_delete_jobdata 204 prod-b job$(($i+$NUM_JOBS)) |
| 328 | prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS)) |
| 329 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 330 | fi |
| 331 | if [ $(($i%5)) -eq 1 ]; then |
| 332 | prodstub_delete_jobdata 204 prod-b job$i |
| 333 | prodstub_delete_jobdata 204 prod-c job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 334 | if [ $use_info_jobs ]; then |
| 335 | prodstub_delete_jobdata 204 prod-b job$(($i+$NUM_JOBS)) |
| 336 | prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS)) |
| 337 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 338 | fi |
| 339 | if [ $(($i%5)) -eq 2 ]; then |
| 340 | prodstub_delete_jobdata 204 prod-c job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 341 | if [ $use_info_jobs ]; then |
| 342 | prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS)) |
| 343 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 344 | fi |
| 345 | if [ $(($i%5)) -eq 3 ]; then |
| 346 | prodstub_delete_jobdata 204 prod-d job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 347 | if [ $use_info_jobs ]; then |
| 348 | prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS)) |
| 349 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 350 | fi |
| 351 | if [ $(($i%5)) -eq 4 ]; then |
| 352 | prodstub_delete_jobdata 204 prod-d job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 353 | if [ $use_info_jobs ]; then |
| 354 | prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS)) |
| 355 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 356 | fi |
| 357 | done |
| 358 | |
| 359 | ecs_api_edp_get_producer_status 404 prod-a |
| 360 | ecs_api_edp_get_producer_status 404 prod-b |
| 361 | ecs_api_edp_get_producer_status 404 prod-c |
| 362 | ecs_api_edp_get_producer_status 404 prod-d |
| 363 | |
| 364 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 365 | do |
| 366 | if [ $(($i%5)) -eq 0 ]; then |
| 367 | if [ -z "$FLAT_A1_EI" ]; then |
| 368 | ecs_api_a1_get_job_status 200 type1 job$i DISABLED |
| 369 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 370 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 371 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 372 | if [ $use_info_jobs ]; then |
| 373 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) DISABLED 120 |
| 374 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 375 | fi |
| 376 | if [ $(($i%5)) -eq 1 ]; then |
| 377 | if [ -z "$FLAT_A1_EI" ]; then |
| 378 | ecs_api_a1_get_job_status 200 type2 job$i DISABLED |
| 379 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 380 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 381 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 382 | if [ $use_info_jobs ]; then |
| 383 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) DISABLED 120 |
| 384 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 385 | fi |
| 386 | if [ $(($i%5)) -eq 2 ]; then |
| 387 | if [ -z "$FLAT_A1_EI" ]; then |
| 388 | ecs_api_a1_get_job_status 200 type3 job$i DISABLED |
| 389 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 390 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 391 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 392 | if [ $use_info_jobs ]; then |
| 393 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) DISABLED 120 |
| 394 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 395 | fi |
| 396 | if [ $(($i%5)) -eq 3 ]; then |
| 397 | if [ -z "$FLAT_A1_EI" ]; then |
| 398 | ecs_api_a1_get_job_status 200 type4 job$i DISABLED |
| 399 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 400 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 401 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 402 | if [ $use_info_jobs ]; then |
| 403 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) DISABLED 120 |
| 404 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 405 | fi |
| 406 | if [ $(($i%5)) -eq 4 ]; then |
| 407 | if [ -z "$FLAT_A1_EI" ]; then |
| 408 | ecs_api_a1_get_job_status 200 type5 job$i DISABLED |
| 409 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 410 | ecs_api_a1_get_job_status 200 job$i DISABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 411 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 412 | if [ $use_info_jobs ]; then |
| 413 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) DISABLED 120 |
| 414 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 415 | fi |
| 416 | done |
| 417 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 418 | if [ $ECS_VERSION == "V1-1" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 419 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 420 | 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] | 421 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 422 | 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] | 423 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 424 | 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] | 425 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 426 | 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 |
| 427 | |
| 428 | else |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 429 | if [ $use_info_jobs ]; then |
| 430 | ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 type101 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 431 | |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 432 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 type101 type102 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 433 | |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 434 | ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 type101 type102 type103 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 435 | |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 436 | ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105 |
| 437 | else |
| 438 | ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 439 | |
| 440 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 |
| 441 | |
| 442 | ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 |
| 443 | |
| 444 | ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 |
| 445 | fi |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 446 | |
| 447 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 448 | |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 449 | if [ $use_info_jobs ]; then |
| 450 | ecs_equal json:data-producer/v1/info-producers 4 |
| 451 | else |
| 452 | ecs_equal json:ei-producer/v1/eiproducers 4 |
| 453 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 454 | |
| 455 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 456 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 457 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 458 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 459 | |
| 460 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 461 | do |
| 462 | if [ $(($i%5)) -eq 0 ]; then |
| 463 | if [ -z "$FLAT_A1_EI" ]; then |
| 464 | ecs_api_a1_get_job_status 200 type1 job$i ENABLED |
| 465 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 466 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 467 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 468 | if [ $use_info_jobs ]; then |
| 469 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 470 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 471 | fi |
| 472 | if [ $(($i%5)) -eq 1 ]; then |
| 473 | if [ -z "$FLAT_A1_EI" ]; then |
| 474 | ecs_api_a1_get_job_status 200 type2 job$i ENABLED |
| 475 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 476 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 477 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 478 | if [ $use_info_jobs ]; then |
| 479 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 480 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 481 | fi |
| 482 | if [ $(($i%5)) -eq 2 ]; then |
| 483 | if [ -z "$FLAT_A1_EI" ]; then |
| 484 | ecs_api_a1_get_job_status 200 type3 job$i ENABLED |
| 485 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 486 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 487 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 488 | if [ $use_info_jobs ]; then |
| 489 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 490 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 491 | fi |
| 492 | if [ $(($i%5)) -eq 3 ]; then |
| 493 | if [ -z "$FLAT_A1_EI" ]; then |
| 494 | ecs_api_a1_get_job_status 200 type4 job$i ENABLED |
| 495 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 496 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 497 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 498 | if [ $use_info_jobs ]; then |
| 499 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 500 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 501 | fi |
| 502 | if [ $(($i%5)) -eq 4 ]; then |
| 503 | if [ -z "$FLAT_A1_EI" ]; then |
| 504 | ecs_api_a1_get_job_status 200 type5 job$i ENABLED |
| 505 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 506 | ecs_api_a1_get_job_status 200 job$i ENABLED 120 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 507 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 508 | if [ $use_info_jobs ]; then |
| 509 | ecs_api_idc_get_job_status 200 job$(($i+$NUM_JOBS)) ENABLED 120 |
| 510 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 511 | fi |
| 512 | done |
| 513 | |
| 514 | |
| 515 | if [ -z "$FLAT_A1_EI" ]; then |
| 516 | ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5)) |
| 517 | ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5)) |
| 518 | ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5)) |
| 519 | ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5)) |
| 520 | ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5)) |
| 521 | else |
| 522 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5)) |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 523 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5)) |
| 524 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5)) |
| 525 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5)) |
| 526 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5)) |
| 527 | fi |
| 528 | |
| 529 | if [ $use_info_jobs ]; then |
| 530 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5)) |
| 531 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5)) |
| 532 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5)) |
| 533 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5)) |
| 534 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5)) |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 535 | fi |
| 536 | |
| 537 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 538 | do |
| 539 | if [ $(($i%5)) -eq 0 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 540 | if [ $ECS_VERSION == "V1-1" ]; then |
| 541 | prodstub_check_jobdata 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 542 | prodstub_check_jobdata 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 543 | prodstub_check_jobdata 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 544 | else |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 545 | if [ $use_info_jobs ]; then |
| 546 | prodstub_check_jobdata_3 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 547 | prodstub_check_jobdata_3 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 548 | prodstub_check_jobdata_3 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 549 | else |
| 550 | prodstub_check_jobdata_2 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 551 | prodstub_check_jobdata_2 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 552 | prodstub_check_jobdata_2 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json |
| 553 | fi |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 554 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 555 | if [ $use_info_jobs ]; then |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 556 | prodstub_check_jobdata_3 200 prod-a job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json |
| 557 | prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json |
| 558 | prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 559 | fi |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 560 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 561 | fi |
| 562 | if [ $(($i%5)) -eq 1 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 563 | if [ $ECS_VERSION == "V1-1" ]; then |
| 564 | prodstub_check_jobdata 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 565 | prodstub_check_jobdata 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 566 | else |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 567 | if [ $use_info_jobs ]; then |
| 568 | prodstub_check_jobdata_3 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 569 | prodstub_check_jobdata_3 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 570 | else |
| 571 | prodstub_check_jobdata_2 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 572 | prodstub_check_jobdata_2 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json |
| 573 | fi |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 574 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 575 | if [ $use_info_jobs ]; then |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 576 | prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json |
| 577 | prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 578 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 579 | fi |
| 580 | if [ $(($i%5)) -eq 2 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 581 | if [ $ECS_VERSION == "V1-1" ]; then |
| 582 | prodstub_check_jobdata 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json |
| 583 | else |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 584 | if [ $use_info_jobs ]; then |
| 585 | prodstub_check_jobdata_3 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json |
| 586 | else |
| 587 | prodstub_check_jobdata_2 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json |
| 588 | fi |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 589 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 590 | if [ $use_info_jobs ]; then |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 591 | prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type103 $TARGET info-owner testdata/ecs/job-template.json |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 592 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 593 | fi |
| 594 | if [ $(($i%5)) -eq 3 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 595 | if [ $ECS_VERSION == "V1-1" ]; then |
| 596 | prodstub_check_jobdata 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json |
| 597 | else |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 598 | if [ $use_info_jobs ]; then |
| 599 | prodstub_check_jobdata_3 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json |
| 600 | else |
| 601 | prodstub_check_jobdata_2 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json |
| 602 | fi |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 603 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 604 | if [ $use_info_jobs ]; then |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 605 | prodstub_check_jobdata_3 200 prod-d job$(($i+$NUM_JOBS)) type104 $TARGET info-owner testdata/ecs/job-template.json |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 606 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 607 | fi |
| 608 | if [ $(($i%5)) -eq 4 ]; then |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 609 | if [ $ECS_VERSION == "V1-1" ]; then |
| 610 | prodstub_check_jobdata 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json |
| 611 | else |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 612 | if [ $use_info_jobs ]; then |
| 613 | prodstub_check_jobdata_3 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json |
| 614 | else |
| 615 | prodstub_check_jobdata_2 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json |
| 616 | fi |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 617 | fi |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 618 | if [ $use_info_jobs ]; then |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 619 | prodstub_check_jobdata_3 200 prod-d job$(($i+$NUM_JOBS)) type105 $TARGET info-owner testdata/ecs/job-template.json |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 620 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 621 | fi |
| 622 | done |
| 623 | |
| 624 | |
| 625 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 626 | do |
| 627 | if [ $(($i%5)) -eq 0 ]; then |
| 628 | ecs_api_a1_delete_job 204 job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 629 | if [ $use_info_jobs ]; then |
| 630 | ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS)) |
| 631 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 632 | fi |
| 633 | if [ $(($i%5)) -eq 1 ]; then |
| 634 | ecs_api_a1_delete_job 204 job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 635 | if [ $use_info_jobs ]; then |
| 636 | ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS)) |
| 637 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 638 | fi |
| 639 | if [ $(($i%5)) -eq 2 ]; then |
| 640 | ecs_api_a1_delete_job 204 job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 641 | if [ $use_info_jobs ]; then |
| 642 | ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS)) |
| 643 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 644 | fi |
| 645 | if [ $(($i%5)) -eq 3 ]; then |
| 646 | ecs_api_a1_delete_job 204 job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 647 | if [ $use_info_jobs ]; then |
| 648 | ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS)) |
| 649 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 650 | fi |
| 651 | if [ $(($i%5)) -eq 4 ]; then |
| 652 | ecs_api_a1_delete_job 204 job$i |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 653 | if [ $use_info_jobs ]; then |
| 654 | ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS)) |
| 655 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 656 | fi |
| 657 | done |
| 658 | |
BjornMagnussonXA | ce4b14c | 2021-05-11 15:40:03 +0200 | [diff] [blame] | 659 | if [ $use_info_jobs ]; then |
| 660 | ecs_equal json:data-producer/v1/info-producers 4 |
| 661 | else |
| 662 | ecs_equal json:ei-producer/v1/eiproducers 4 |
| 663 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 664 | |
| 665 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 666 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 667 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 668 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 669 | |
| 670 | if [ -z "$FLAT_A1_EI" ]; then |
| 671 | ecs_equal json:A1-EI/v1/eitypes/type1/eijobs 0 |
| 672 | ecs_equal json:A1-EI/v1/eitypes/type2/eijobs 0 |
| 673 | ecs_equal json:A1-EI/v1/eitypes/type3/eijobs 0 |
| 674 | ecs_equal json:A1-EI/v1/eitypes/type4/eijobs 0 |
| 675 | ecs_equal json:A1-EI/v1/eitypes/type5/eijobs 0 |
| 676 | else |
| 677 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0 |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 678 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 0 |
| 679 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 0 |
| 680 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 0 |
| 681 | ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 0 |
| 682 | fi |
| 683 | |
| 684 | if [ $use_info_jobs ]; then |
| 685 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 0 |
| 686 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 0 |
| 687 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 0 |
| 688 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 0 |
| 689 | ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 0 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 690 | fi |
| 691 | |
| 692 | check_ecs_logs |
| 693 | |
| 694 | store_logs END |
| 695 | |
| 696 | #### TEST COMPLETE #### |
| 697 | |
| 698 | |
| 699 | print_result |
| 700 | |
BjornMagnussonXA | 9d8fafb | 2021-05-10 11:11:49 +0200 | [diff] [blame] | 701 | auto_clean_environment |