blob: bb9ed60772512e3373b0b7d8d9e5ac7449125937 [file] [log] [blame]
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001#!/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
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +020021TC_ONELINE_DESCR="ECS Create 10000 jobs (ei and info) restart, test job persistency"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010022
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010023#App names to include in the test when running docker, space separated list
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010024DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR CP NGW"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010025
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010026#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010027KUBE_INCLUDED_IMAGES="ECS PRODSTUB CP CR KUBEPROXY NGW"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010028#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
29KUBE_PRESTARTED_IMAGES=""
30
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010031#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
34CONDITIONALLY_IGNORED_IMAGES="NGW"
35
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010036#Supported test environment profiles
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020037SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010038#Supported run modes
39SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010040
41. ../common/testcase_common.sh $@
42. ../common/ecs_api_functions.sh
43. ../common/prodstub_api_functions.sh
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010044. ../common/control_panel_api_functions.sh
45. ../common/controller_api_functions.sh
BjornMagnussonXA27db02f2021-01-19 08:13:00 +010046. ../common/cr_api_functions.sh
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010047. ../common/kube_proxy_api_functions.sh
48. ../common/gateway_api_functions.sh
49
50setup_testenvironment
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010051
52#### TEST BEGIN ####
53
54FLAT_A1_EI="1"
55
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010056clean_environment
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010057
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010058if [ $RUNMODE == "KUBE" ]; then
59 start_kube_proxy
60fi
61
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010062use_ecs_rest_http
63
64use_prod_stub_http
65
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010066start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010067
68start_prod_stub
69
70set_ecs_trace
71
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010072start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
73
74if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
75 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
76fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010077
78start_cr
79
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010080CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
81CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010082TARGET="http://localhost:80/target" # Dummy target
83
84NUM_JOBS=10000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +020085use_info_jobs=false #Set flag if interface supporting info-types is used
86if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
87 use_info_jobs=true
88 NUM_JOBS=5000 # 5K ei jobs and 5K info jobs
89fi
90
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +020091if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
92 #Type registration status callbacks
93 TYPESTATUS1="$CR_SERVICE_PATH/type-status1"
94 TYPESTATUS2="$CR_SERVICE_PATH/type-status2"
95
96 ecs_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
97
98 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
99
100 ecs_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
101
102 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
103
104fi
105
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100106# Setup prodstub sim to accept calls for producers, types and jobs
107prodstub_arm_producer 200 prod-a
108prodstub_arm_producer 200 prod-b
109prodstub_arm_producer 200 prod-c
110prodstub_arm_producer 200 prod-d
111
112prodstub_arm_type 200 prod-a type1
113
114prodstub_arm_type 200 prod-b type1
115prodstub_arm_type 200 prod-b type2
116
117prodstub_arm_type 200 prod-c type1
118prodstub_arm_type 200 prod-c type2
119prodstub_arm_type 200 prod-c type3
120
121prodstub_arm_type 200 prod-d type4
122prodstub_arm_type 200 prod-d type5
123
124for ((i=1; i<=$NUM_JOBS; i++))
125do
126 if [ $(($i%5)) -eq 0 ]; then
127 prodstub_arm_job_create 200 prod-a job$i
128 prodstub_arm_job_create 200 prod-b job$i
129 prodstub_arm_job_create 200 prod-c job$i
130 fi
131 if [ $(($i%5)) -eq 1 ]; then
132 prodstub_arm_job_create 200 prod-b job$i
133 prodstub_arm_job_create 200 prod-c job$i
134 fi
135 if [ $(($i%5)) -eq 2 ]; then
136 prodstub_arm_job_create 200 prod-c job$i
137 fi
138 if [ $(($i%5)) -eq 3 ]; then
139 prodstub_arm_job_create 200 prod-d job$i
140 fi
141 if [ $(($i%5)) -eq 4 ]; then
142 prodstub_arm_job_create 200 prod-d job$i
143 fi
144done
145
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200146if [ $use_info_jobs ]; then
147 prodstub_arm_producer 200 prod-a
148 prodstub_arm_producer 200 prod-b
149 prodstub_arm_producer 200 prod-c
150 prodstub_arm_producer 200 prod-d
151
152 prodstub_arm_type 200 prod-a type101
153
154 prodstub_arm_type 200 prod-b type101
155 prodstub_arm_type 200 prod-b type102
156
157 prodstub_arm_type 200 prod-c type101
158 prodstub_arm_type 200 prod-c type102
159 prodstub_arm_type 200 prod-c type103
160
161 prodstub_arm_type 200 prod-d type104
162 prodstub_arm_type 200 prod-d type105
163
164 for ((i=1; i<=$NUM_JOBS; i++))
165 do
166 if [ $(($i%5)) -eq 0 ]; then
167 prodstub_arm_job_create 200 prod-a job$(($i+$NUM_JOBS))
168 prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS))
169 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
170 fi
171 if [ $(($i%5)) -eq 1 ]; then
172 prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS))
173 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
174 fi
175 if [ $(($i%5)) -eq 2 ]; then
176 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
177 fi
178 if [ $(($i%5)) -eq 3 ]; then
179 prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS))
180 fi
181 if [ $(($i%5)) -eq 4 ]; then
182 prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS))
183 fi
184 done
185fi
186
187
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100188if [ $ECS_VERSION == "V1-1" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100189
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100190 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100191
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100192 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
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100193
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100194 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
195
196 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
197
198else
199
200 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
201 ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
202 ecs_api_edp_put_type_2 201 type3 testdata/ecs/ei-type-3.json
203 ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json
204 ecs_api_edp_put_type_2 201 type5 testdata/ecs/ei-type-5.json
205
206 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
207
208 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
209
210 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
211
212 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200213
214 if [ $use_info_jobs ]; then
215 ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
216 ecs_api_edp_put_type_2 201 type102 testdata/ecs/info-type-2.json
217 ecs_api_edp_put_type_2 201 type103 testdata/ecs/info-type-3.json
218 ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json
219 ecs_api_edp_put_type_2 201 type105 testdata/ecs/info-type-5.json
220
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200221
222
223 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
224 cr_equal received_callbacks 20 30
225 cr_equal received_callbacks?id=type-status1 10
226 cr_equal received_callbacks?id=type-status2 10
227
228 cr_api_check_all_ecs_subscription_events 200 type-status1 \
229 type1 testdata/ecs/ei-type-1.json REGISTERED \
230 type2 testdata/ecs/ei-type-2.json REGISTERED \
231 type3 testdata/ecs/ei-type-3.json REGISTERED \
232 type4 testdata/ecs/ei-type-4.json REGISTERED \
233 type5 testdata/ecs/ei-type-5.json REGISTERED \
234 type101 testdata/ecs/info-type-1.json REGISTERED \
235 type102 testdata/ecs/info-type-2.json REGISTERED \
236 type103 testdata/ecs/info-type-3.json REGISTERED \
237 type104 testdata/ecs/info-type-4.json REGISTERED \
238 type105 testdata/ecs/info-type-5.json REGISTERED
239
240 cr_api_check_all_ecs_subscription_events 200 type-status2 \
241 type1 testdata/ecs/ei-type-1.json REGISTERED \
242 type2 testdata/ecs/ei-type-2.json REGISTERED \
243 type3 testdata/ecs/ei-type-3.json REGISTERED \
244 type4 testdata/ecs/ei-type-4.json REGISTERED \
245 type5 testdata/ecs/ei-type-5.json REGISTERED \
246 type101 testdata/ecs/info-type-1.json REGISTERED \
247 type102 testdata/ecs/info-type-2.json REGISTERED \
248 type103 testdata/ecs/info-type-3.json REGISTERED \
249 type104 testdata/ecs/info-type-4.json REGISTERED \
250 type105 testdata/ecs/info-type-5.json REGISTERED
251
252 fi
253
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200254 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 type101
255
256 ecs_api_edp_put_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 type101 type102
257
258 ecs_api_edp_put_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 type101 type102 type103
259
260 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105
261 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100262fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100263
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200264if [ $use_info_jobs ]; then
265 ecs_equal json:data-producer/v1/info-producers 4
266else
267 ecs_equal json:ei-producer/v1/eiproducers 4
268fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100269
270ecs_api_edp_get_producer_status 200 prod-a ENABLED
271ecs_api_edp_get_producer_status 200 prod-b ENABLED
272ecs_api_edp_get_producer_status 200 prod-c ENABLED
273ecs_api_edp_get_producer_status 200 prod-d ENABLED
274
275for ((i=1; i<=$NUM_JOBS; i++))
276do
277 if [ $(($i%5)) -eq 0 ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100278 ecs_api_a1_put_job 201 job$i type1 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100279 if [ -z "$FLAT_A1_EI" ]; then
280 ecs_api_a1_get_job_status 200 type1 job$i ENABLED
281 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100282 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100283 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200284 if [ $use_info_jobs ]; then
285 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
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200286 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 3 prod-a prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200287 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100288 fi
289 if [ $(($i%5)) -eq 1 ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100290 ecs_api_a1_put_job 201 job$i type2 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100291 if [ -z "$FLAT_A1_EI" ]; then
292 ecs_api_a1_get_job_status 200 type2 job$i ENABLED
293 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100294 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100295 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200296 if [ $use_info_jobs ]; then
297 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
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200298 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 2 prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200299 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100300 fi
301 if [ $(($i%5)) -eq 2 ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100302 ecs_api_a1_put_job 201 job$i type3 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100303 if [ -z "$FLAT_A1_EI" ]; then
304 ecs_api_a1_get_job_status 200 type3 job$i ENABLED
305 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100306 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100307 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200308 if [ $use_info_jobs ]; then
309 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
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200310 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200311 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100312 fi
313 if [ $(($i%5)) -eq 3 ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100314 ecs_api_a1_put_job 201 job$i type4 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100315 if [ -z "$FLAT_A1_EI" ]; then
316 ecs_api_a1_get_job_status 200 type4 job$i ENABLED
317 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100318 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100319 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200320 if [ $use_info_jobs ]; then
321 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
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200322 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200323 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100324 fi
325 if [ $(($i%5)) -eq 4 ]; then
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100326 ecs_api_a1_put_job 201 job$i type5 $TARGET ric1 $CR_SERVICE_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100327 if [ -z "$FLAT_A1_EI" ]; then
328 ecs_api_a1_get_job_status 200 type5 job$i ENABLED
329 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100330 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100331 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200332 if [ $use_info_jobs ]; then
333 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
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200334 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200335 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100336 fi
337done
338
339if [ -z "$FLAT_A1_EI" ]; then
340 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5))
341 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5))
342 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5))
343 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5))
344 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5))
345else
346 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5))
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200347 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5))
348 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5))
349 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5))
350 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5))
351fi
352if [ $use_info_jobs ]; then
353 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5))
354 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5))
355 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5))
356 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5))
357 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5))
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100358fi
359
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200360if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
361 cr_equal received_callbacks 20 30
362
363else
364 cr_equal received_callbacks 0 30
365
366fi
367
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200368
369if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
370
371 ecs_equal json:/data-consumer/v1/info-type-subscription 2 200
372
373 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
374 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
375
376 if [ $use_info_jobs ]; then
377 ecs_equal json:data-producer/v1/info-types 10 1000
378 else
379 ecs_equal json:ei-producer/v1/eitypes 5 1000
380 fi
381
382fi
383
BjornMagnussonXAa69cd902021-04-22 23:46:10 +0200384stop_ecs
385
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200386cr_api_reset
387
BjornMagnussonXAa69cd902021-04-22 23:46:10 +0200388start_stopped_ecs
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100389
390set_ecs_trace
391
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200392if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
393
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200394 ecs_equal json:/data-consumer/v1/info-type-subscription 2 200
395
396 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
397 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200398
399 if [ $use_info_jobs ]; then
400 ecs_equal json:data-producer/v1/info-types 10 1000
401 else
402 ecs_equal json:ei-producer/v1/eitypes 5 1000
403 fi
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200404fi
405
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200406cr_equal received_callbacks 0
407
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100408for ((i=1; i<=$NUM_JOBS; i++))
409do
410 if [ $(($i%5)) -eq 0 ]; then
411 prodstub_delete_jobdata 204 prod-a job$i
412 prodstub_delete_jobdata 204 prod-b job$i
413 prodstub_delete_jobdata 204 prod-c job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200414 if [ $use_info_jobs ]; then
415 prodstub_delete_jobdata 204 prod-a job$(($i+$NUM_JOBS))
416 prodstub_delete_jobdata 204 prod-b job$(($i+$NUM_JOBS))
417 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
418 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100419 fi
420 if [ $(($i%5)) -eq 1 ]; then
421 prodstub_delete_jobdata 204 prod-b job$i
422 prodstub_delete_jobdata 204 prod-c job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200423 if [ $use_info_jobs ]; then
424 prodstub_delete_jobdata 204 prod-b job$(($i+$NUM_JOBS))
425 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
426 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100427 fi
428 if [ $(($i%5)) -eq 2 ]; then
429 prodstub_delete_jobdata 204 prod-c job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200430 if [ $use_info_jobs ]; then
431 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
432 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100433 fi
434 if [ $(($i%5)) -eq 3 ]; then
435 prodstub_delete_jobdata 204 prod-d job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200436 if [ $use_info_jobs ]; then
437 prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS))
438 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100439 fi
440 if [ $(($i%5)) -eq 4 ]; then
441 prodstub_delete_jobdata 204 prod-d job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200442 if [ $use_info_jobs ]; then
443 prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS))
444 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100445 fi
446done
447
448ecs_api_edp_get_producer_status 404 prod-a
449ecs_api_edp_get_producer_status 404 prod-b
450ecs_api_edp_get_producer_status 404 prod-c
451ecs_api_edp_get_producer_status 404 prod-d
452
453for ((i=1; i<=$NUM_JOBS; i++))
454do
455 if [ $(($i%5)) -eq 0 ]; then
456 if [ -z "$FLAT_A1_EI" ]; then
457 ecs_api_a1_get_job_status 200 type1 job$i DISABLED
458 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100459 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100460 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200461 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200462 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200463 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100464 fi
465 if [ $(($i%5)) -eq 1 ]; then
466 if [ -z "$FLAT_A1_EI" ]; then
467 ecs_api_a1_get_job_status 200 type2 job$i DISABLED
468 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100469 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100470 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200471 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200472 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200473 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100474 fi
475 if [ $(($i%5)) -eq 2 ]; then
476 if [ -z "$FLAT_A1_EI" ]; then
477 ecs_api_a1_get_job_status 200 type3 job$i DISABLED
478 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100479 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100480 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200481 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200482 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200483 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100484 fi
485 if [ $(($i%5)) -eq 3 ]; then
486 if [ -z "$FLAT_A1_EI" ]; then
487 ecs_api_a1_get_job_status 200 type4 job$i DISABLED
488 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100489 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100490 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200491 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200492 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200493 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100494 fi
495 if [ $(($i%5)) -eq 4 ]; then
496 if [ -z "$FLAT_A1_EI" ]; then
497 ecs_api_a1_get_job_status 200 type5 job$i DISABLED
498 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100499 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100500 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200501 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200502 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200503 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100504 fi
505done
506
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100507if [ $ECS_VERSION == "V1-1" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100508
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100509 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100510
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100511 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
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100512
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100513 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
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100514
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100515 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
516
517else
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200518 if [ $use_info_jobs ]; then
519 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 type101
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100520
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200521 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 type101 type102
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100522
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200523 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 type101 type102 type103
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100524
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200525 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105
526 else
527 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
528
529 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
530
531 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
532
533 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5
534 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100535
536fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100537
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200538if [ $use_info_jobs ]; then
539 ecs_equal json:data-producer/v1/info-producers 4
540else
541 ecs_equal json:ei-producer/v1/eiproducers 4
542fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100543
544ecs_api_edp_get_producer_status 200 prod-a ENABLED
545ecs_api_edp_get_producer_status 200 prod-b ENABLED
546ecs_api_edp_get_producer_status 200 prod-c ENABLED
547ecs_api_edp_get_producer_status 200 prod-d ENABLED
548
549for ((i=1; i<=$NUM_JOBS; i++))
550do
551 if [ $(($i%5)) -eq 0 ]; then
552 if [ -z "$FLAT_A1_EI" ]; then
553 ecs_api_a1_get_job_status 200 type1 job$i ENABLED
554 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100555 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100556 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200557 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200558 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 3 prod-a prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200559 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100560 fi
561 if [ $(($i%5)) -eq 1 ]; then
562 if [ -z "$FLAT_A1_EI" ]; then
563 ecs_api_a1_get_job_status 200 type2 job$i ENABLED
564 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100565 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100566 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200567 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200568 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 2 prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200569 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100570 fi
571 if [ $(($i%5)) -eq 2 ]; then
572 if [ -z "$FLAT_A1_EI" ]; then
573 ecs_api_a1_get_job_status 200 type3 job$i ENABLED
574 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100575 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100576 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200577 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200578 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200579 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100580 fi
581 if [ $(($i%5)) -eq 3 ]; then
582 if [ -z "$FLAT_A1_EI" ]; then
583 ecs_api_a1_get_job_status 200 type4 job$i ENABLED
584 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100585 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100586 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200587 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200588 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200589 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100590 fi
591 if [ $(($i%5)) -eq 4 ]; then
592 if [ -z "$FLAT_A1_EI" ]; then
593 ecs_api_a1_get_job_status 200 type5 job$i ENABLED
594 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100595 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100596 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200597 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200598 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200599 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100600 fi
601done
602
603
604if [ -z "$FLAT_A1_EI" ]; then
605 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5))
606 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5))
607 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5))
608 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5))
609 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5))
610else
611 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5))
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200612 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5))
613 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5))
614 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5))
615 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5))
616fi
617
618if [ $use_info_jobs ]; then
619 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5))
620 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5))
621 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5))
622 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5))
623 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5))
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100624fi
625
626for ((i=1; i<=$NUM_JOBS; i++))
627do
628 if [ $(($i%5)) -eq 0 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100629 if [ $ECS_VERSION == "V1-1" ]; then
630 prodstub_check_jobdata 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
631 prodstub_check_jobdata 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
632 prodstub_check_jobdata 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
633 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200634 if [ $use_info_jobs ]; then
635 prodstub_check_jobdata_3 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
636 prodstub_check_jobdata_3 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
637 prodstub_check_jobdata_3 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
638 else
639 prodstub_check_jobdata_2 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
640 prodstub_check_jobdata_2 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
641 prodstub_check_jobdata_2 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
642 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100643 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200644 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200645 prodstub_check_jobdata_3 200 prod-a job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json
646 prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json
647 prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200648 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100649
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100650 fi
651 if [ $(($i%5)) -eq 1 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100652 if [ $ECS_VERSION == "V1-1" ]; then
653 prodstub_check_jobdata 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
654 prodstub_check_jobdata 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
655 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200656 if [ $use_info_jobs ]; then
657 prodstub_check_jobdata_3 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
658 prodstub_check_jobdata_3 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
659 else
660 prodstub_check_jobdata_2 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
661 prodstub_check_jobdata_2 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
662 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100663 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200664 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200665 prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json
666 prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200667 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100668 fi
669 if [ $(($i%5)) -eq 2 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100670 if [ $ECS_VERSION == "V1-1" ]; then
671 prodstub_check_jobdata 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
672 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200673 if [ $use_info_jobs ]; then
674 prodstub_check_jobdata_3 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
675 else
676 prodstub_check_jobdata_2 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
677 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100678 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200679 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200680 prodstub_check_jobdata_3 200 prod-c job$(($i+$NUM_JOBS)) type103 $TARGET info-owner testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200681 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100682 fi
683 if [ $(($i%5)) -eq 3 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100684 if [ $ECS_VERSION == "V1-1" ]; then
685 prodstub_check_jobdata 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
686 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200687 if [ $use_info_jobs ]; then
688 prodstub_check_jobdata_3 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
689 else
690 prodstub_check_jobdata_2 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
691 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100692 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200693 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200694 prodstub_check_jobdata_3 200 prod-d job$(($i+$NUM_JOBS)) type104 $TARGET info-owner testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200695 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100696 fi
697 if [ $(($i%5)) -eq 4 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100698 if [ $ECS_VERSION == "V1-1" ]; then
699 prodstub_check_jobdata 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
700 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200701 if [ $use_info_jobs ]; then
702 prodstub_check_jobdata_3 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
703 else
704 prodstub_check_jobdata_2 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
705 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100706 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200707 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200708 prodstub_check_jobdata_3 200 prod-d job$(($i+$NUM_JOBS)) type105 $TARGET info-owner testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200709 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100710 fi
711done
712
713
714for ((i=1; i<=$NUM_JOBS; i++))
715do
716 if [ $(($i%5)) -eq 0 ]; then
717 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200718 if [ $use_info_jobs ]; then
719 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
720 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100721 fi
722 if [ $(($i%5)) -eq 1 ]; then
723 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200724 if [ $use_info_jobs ]; then
725 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
726 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100727 fi
728 if [ $(($i%5)) -eq 2 ]; then
729 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200730 if [ $use_info_jobs ]; then
731 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
732 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100733 fi
734 if [ $(($i%5)) -eq 3 ]; then
735 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200736 if [ $use_info_jobs ]; then
737 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
738 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100739 fi
740 if [ $(($i%5)) -eq 4 ]; then
741 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200742 if [ $use_info_jobs ]; then
743 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
744 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100745 fi
746done
747
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200748if [ $use_info_jobs ]; then
749 ecs_equal json:data-producer/v1/info-producers 4
750else
751 ecs_equal json:ei-producer/v1/eiproducers 4
752fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100753
754ecs_api_edp_get_producer_status 200 prod-a ENABLED
755ecs_api_edp_get_producer_status 200 prod-b ENABLED
756ecs_api_edp_get_producer_status 200 prod-c ENABLED
757ecs_api_edp_get_producer_status 200 prod-d ENABLED
758
759if [ -z "$FLAT_A1_EI" ]; then
760 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs 0
761 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs 0
762 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs 0
763 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs 0
764 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs 0
765else
766 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200767 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 0
768 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 0
769 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 0
770 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 0
771fi
772
773if [ $use_info_jobs ]; then
774 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 0
775 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 0
776 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 0
777 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 0
778 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 0
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100779fi
780
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200781if [ $use_info_jobs ]; then
782 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
783 ecs_api_edp_put_type_2 200 type101 testdata/ecs/info-type-1.json
784 ecs_api_edp_put_type_2 200 type102 testdata/ecs/info-type-2.json
785 ecs_api_edp_put_type_2 200 type103 testdata/ecs/info-type-3.json
786 ecs_api_edp_put_type_2 200 type104 testdata/ecs/info-type-4.json
787 ecs_api_edp_put_type_2 200 type105 testdata/ecs/info-type-5.json
788 fi
789fi
790
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200791if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200792 cr_equal received_callbacks 10 30
793 cr_equal received_callbacks?id=type-status1 5
794 cr_equal received_callbacks?id=type-status2 5
795
796 cr_api_check_all_ecs_subscription_events 200 type-status1 \
797 type101 testdata/ecs/info-type-1.json REGISTERED \
798 type102 testdata/ecs/info-type-2.json REGISTERED \
799 type103 testdata/ecs/info-type-3.json REGISTERED \
800 type104 testdata/ecs/info-type-4.json REGISTERED \
801 type105 testdata/ecs/info-type-5.json REGISTERED
802
803 cr_api_check_all_ecs_subscription_events 200 type-status2 \
804 type101 testdata/ecs/info-type-1.json REGISTERED \
805 type102 testdata/ecs/info-type-2.json REGISTERED \
806 type103 testdata/ecs/info-type-3.json REGISTERED \
807 type104 testdata/ecs/info-type-4.json REGISTERED \
808 type105 testdata/ecs/info-type-5.json REGISTERED
809
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200810else
811 cr_equal received_callbacks 0 30
812fi
813
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100814check_ecs_logs
815
816store_logs END
817
818#### TEST COMPLETE ####
819
820
821print_result
822
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200823auto_clean_environment