blob: 6241f3cacb6d03967a48cf4d84972553f8a4aff6 [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
BjornMagnussonXA663566c2021-11-08 10:25:07 +010024DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR CP NGW KUBEPROXY"
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
BjornMagnussonXA663566c2021-11-08 10:25:07 +010058start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010059
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010060use_ecs_rest_http
61
62use_prod_stub_http
63
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010064start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010065
66start_prod_stub
67
68set_ecs_trace
69
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010070start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
71
72if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
73 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
74fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010075
76start_cr
77
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010078CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
79CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010080TARGET="http://localhost:80/target" # Dummy target
81
82NUM_JOBS=10000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +020083use_info_jobs=false #Set flag if interface supporting info-types is used
84if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
85 use_info_jobs=true
86 NUM_JOBS=5000 # 5K ei jobs and 5K info jobs
87fi
88
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +020089if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
90 #Type registration status callbacks
BjornMagnussonXA663566c2021-11-08 10:25:07 +010091 TYPESTATUS1="$CR_SERVICE_APP_PATH/type-status1"
92 TYPESTATUS2="$CR_SERVICE_APP_PATH/type-status2"
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +020093
94 ecs_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
95
96 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
97
98 ecs_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
99
100 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
101
102fi
103
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100104# Setup prodstub sim to accept calls for producers, types and jobs
105prodstub_arm_producer 200 prod-a
106prodstub_arm_producer 200 prod-b
107prodstub_arm_producer 200 prod-c
108prodstub_arm_producer 200 prod-d
109
110prodstub_arm_type 200 prod-a type1
111
112prodstub_arm_type 200 prod-b type1
113prodstub_arm_type 200 prod-b type2
114
115prodstub_arm_type 200 prod-c type1
116prodstub_arm_type 200 prod-c type2
117prodstub_arm_type 200 prod-c type3
118
119prodstub_arm_type 200 prod-d type4
120prodstub_arm_type 200 prod-d type5
121
122for ((i=1; i<=$NUM_JOBS; i++))
123do
124 if [ $(($i%5)) -eq 0 ]; then
125 prodstub_arm_job_create 200 prod-a job$i
126 prodstub_arm_job_create 200 prod-b job$i
127 prodstub_arm_job_create 200 prod-c job$i
128 fi
129 if [ $(($i%5)) -eq 1 ]; then
130 prodstub_arm_job_create 200 prod-b job$i
131 prodstub_arm_job_create 200 prod-c job$i
132 fi
133 if [ $(($i%5)) -eq 2 ]; then
134 prodstub_arm_job_create 200 prod-c job$i
135 fi
136 if [ $(($i%5)) -eq 3 ]; then
137 prodstub_arm_job_create 200 prod-d job$i
138 fi
139 if [ $(($i%5)) -eq 4 ]; then
140 prodstub_arm_job_create 200 prod-d job$i
141 fi
142done
143
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200144if [ $use_info_jobs ]; then
145 prodstub_arm_producer 200 prod-a
146 prodstub_arm_producer 200 prod-b
147 prodstub_arm_producer 200 prod-c
148 prodstub_arm_producer 200 prod-d
149
150 prodstub_arm_type 200 prod-a type101
151
152 prodstub_arm_type 200 prod-b type101
153 prodstub_arm_type 200 prod-b type102
154
155 prodstub_arm_type 200 prod-c type101
156 prodstub_arm_type 200 prod-c type102
157 prodstub_arm_type 200 prod-c type103
158
159 prodstub_arm_type 200 prod-d type104
160 prodstub_arm_type 200 prod-d type105
161
162 for ((i=1; i<=$NUM_JOBS; i++))
163 do
164 if [ $(($i%5)) -eq 0 ]; then
165 prodstub_arm_job_create 200 prod-a job$(($i+$NUM_JOBS))
166 prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS))
167 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
168 fi
169 if [ $(($i%5)) -eq 1 ]; then
170 prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS))
171 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
172 fi
173 if [ $(($i%5)) -eq 2 ]; then
174 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
175 fi
176 if [ $(($i%5)) -eq 3 ]; then
177 prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS))
178 fi
179 if [ $(($i%5)) -eq 4 ]; then
180 prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS))
181 fi
182 done
183fi
184
185
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100186if [ $ECS_VERSION == "V1-1" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100187
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100188 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 +0100189
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100190 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 +0100191
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100192 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
193
194 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
195
196else
197
198 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
199 ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
200 ecs_api_edp_put_type_2 201 type3 testdata/ecs/ei-type-3.json
201 ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json
202 ecs_api_edp_put_type_2 201 type5 testdata/ecs/ei-type-5.json
203
204 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
205
206 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
207
208 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
209
210 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 +0200211
212 if [ $use_info_jobs ]; then
213 ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
214 ecs_api_edp_put_type_2 201 type102 testdata/ecs/info-type-2.json
215 ecs_api_edp_put_type_2 201 type103 testdata/ecs/info-type-3.json
216 ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json
217 ecs_api_edp_put_type_2 201 type105 testdata/ecs/info-type-5.json
218
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200219
220
221 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
222 cr_equal received_callbacks 20 30
223 cr_equal received_callbacks?id=type-status1 10
224 cr_equal received_callbacks?id=type-status2 10
225
226 cr_api_check_all_ecs_subscription_events 200 type-status1 \
227 type1 testdata/ecs/ei-type-1.json REGISTERED \
228 type2 testdata/ecs/ei-type-2.json REGISTERED \
229 type3 testdata/ecs/ei-type-3.json REGISTERED \
230 type4 testdata/ecs/ei-type-4.json REGISTERED \
231 type5 testdata/ecs/ei-type-5.json REGISTERED \
232 type101 testdata/ecs/info-type-1.json REGISTERED \
233 type102 testdata/ecs/info-type-2.json REGISTERED \
234 type103 testdata/ecs/info-type-3.json REGISTERED \
235 type104 testdata/ecs/info-type-4.json REGISTERED \
236 type105 testdata/ecs/info-type-5.json REGISTERED
237
238 cr_api_check_all_ecs_subscription_events 200 type-status2 \
239 type1 testdata/ecs/ei-type-1.json REGISTERED \
240 type2 testdata/ecs/ei-type-2.json REGISTERED \
241 type3 testdata/ecs/ei-type-3.json REGISTERED \
242 type4 testdata/ecs/ei-type-4.json REGISTERED \
243 type5 testdata/ecs/ei-type-5.json REGISTERED \
244 type101 testdata/ecs/info-type-1.json REGISTERED \
245 type102 testdata/ecs/info-type-2.json REGISTERED \
246 type103 testdata/ecs/info-type-3.json REGISTERED \
247 type104 testdata/ecs/info-type-4.json REGISTERED \
248 type105 testdata/ecs/info-type-5.json REGISTERED
249
250 fi
251
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200252 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 type101
253
254 ecs_api_edp_put_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 type101 type102
255
256 ecs_api_edp_put_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 type101 type102 type103
257
258 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105
259 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100260fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100261
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200262if [ $use_info_jobs ]; then
263 ecs_equal json:data-producer/v1/info-producers 4
264else
265 ecs_equal json:ei-producer/v1/eiproducers 4
266fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100267
268ecs_api_edp_get_producer_status 200 prod-a ENABLED
269ecs_api_edp_get_producer_status 200 prod-b ENABLED
270ecs_api_edp_get_producer_status 200 prod-c ENABLED
271ecs_api_edp_get_producer_status 200 prod-d ENABLED
272
273for ((i=1; i<=$NUM_JOBS; i++))
274do
275 if [ $(($i%5)) -eq 0 ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100276 ecs_api_a1_put_job 201 job$i type1 $TARGET ric1 $CR_SERVICE_APP_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100277 if [ -z "$FLAT_A1_EI" ]; then
278 ecs_api_a1_get_job_status 200 type1 job$i ENABLED
279 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100280 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100281 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200282 if [ $use_info_jobs ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100283 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type101 $TARGET info-owner $CR_SERVICE_APP_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200284 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 +0200285 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100286 fi
287 if [ $(($i%5)) -eq 1 ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100288 ecs_api_a1_put_job 201 job$i type2 $TARGET ric1 $CR_SERVICE_APP_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100289 if [ -z "$FLAT_A1_EI" ]; then
290 ecs_api_a1_get_job_status 200 type2 job$i ENABLED
291 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100292 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100293 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200294 if [ $use_info_jobs ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100295 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type102 $TARGET info-owner $CR_SERVICE_APP_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200296 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 2 prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200297 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100298 fi
299 if [ $(($i%5)) -eq 2 ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100300 ecs_api_a1_put_job 201 job$i type3 $TARGET ric1 $CR_SERVICE_APP_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100301 if [ -z "$FLAT_A1_EI" ]; then
302 ecs_api_a1_get_job_status 200 type3 job$i ENABLED
303 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100304 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100305 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200306 if [ $use_info_jobs ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100307 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type103 $TARGET info-owner $CR_SERVICE_APP_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200308 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200309 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100310 fi
311 if [ $(($i%5)) -eq 3 ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100312 ecs_api_a1_put_job 201 job$i type4 $TARGET ric1 $CR_SERVICE_APP_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100313 if [ -z "$FLAT_A1_EI" ]; then
314 ecs_api_a1_get_job_status 200 type4 job$i ENABLED
315 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100316 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100317 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200318 if [ $use_info_jobs ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100319 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type104 $TARGET info-owner $CR_SERVICE_APP_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200320 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200321 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100322 fi
323 if [ $(($i%5)) -eq 4 ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100324 ecs_api_a1_put_job 201 job$i type5 $TARGET ric1 $CR_SERVICE_APP_PATH/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100325 if [ -z "$FLAT_A1_EI" ]; then
326 ecs_api_a1_get_job_status 200 type5 job$i ENABLED
327 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100328 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100329 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200330 if [ $use_info_jobs ]; then
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100331 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type105 $TARGET info-owner $CR_SERVICE_APP_PATH/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200332 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200333 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100334 fi
335done
336
337if [ -z "$FLAT_A1_EI" ]; then
338 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5))
339 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5))
340 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5))
341 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5))
342 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5))
343else
344 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5))
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200345 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5))
346 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5))
347 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5))
348 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5))
349fi
350if [ $use_info_jobs ]; then
351 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5))
352 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5))
353 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5))
354 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5))
355 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5))
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100356fi
357
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200358if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
359 cr_equal received_callbacks 20 30
360
361else
362 cr_equal received_callbacks 0 30
363
364fi
365
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200366
367if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
368
369 ecs_equal json:/data-consumer/v1/info-type-subscription 2 200
370
371 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
372 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
373
374 if [ $use_info_jobs ]; then
375 ecs_equal json:data-producer/v1/info-types 10 1000
376 else
377 ecs_equal json:ei-producer/v1/eitypes 5 1000
378 fi
379
380fi
381
BjornMagnussonXAa69cd902021-04-22 23:46:10 +0200382stop_ecs
383
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200384cr_api_reset
385
BjornMagnussonXAa69cd902021-04-22 23:46:10 +0200386start_stopped_ecs
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100387
388set_ecs_trace
389
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200390if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
391
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200392 ecs_equal json:/data-consumer/v1/info-type-subscription 2 200
393
394 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
395 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200396
397 if [ $use_info_jobs ]; then
398 ecs_equal json:data-producer/v1/info-types 10 1000
399 else
400 ecs_equal json:ei-producer/v1/eitypes 5 1000
401 fi
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200402fi
403
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200404cr_equal received_callbacks 0
405
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100406for ((i=1; i<=$NUM_JOBS; i++))
407do
408 if [ $(($i%5)) -eq 0 ]; then
409 prodstub_delete_jobdata 204 prod-a job$i
410 prodstub_delete_jobdata 204 prod-b job$i
411 prodstub_delete_jobdata 204 prod-c job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200412 if [ $use_info_jobs ]; then
413 prodstub_delete_jobdata 204 prod-a job$(($i+$NUM_JOBS))
414 prodstub_delete_jobdata 204 prod-b job$(($i+$NUM_JOBS))
415 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
416 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100417 fi
418 if [ $(($i%5)) -eq 1 ]; then
419 prodstub_delete_jobdata 204 prod-b job$i
420 prodstub_delete_jobdata 204 prod-c job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200421 if [ $use_info_jobs ]; then
422 prodstub_delete_jobdata 204 prod-b job$(($i+$NUM_JOBS))
423 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
424 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100425 fi
426 if [ $(($i%5)) -eq 2 ]; then
427 prodstub_delete_jobdata 204 prod-c job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200428 if [ $use_info_jobs ]; then
429 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
430 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100431 fi
432 if [ $(($i%5)) -eq 3 ]; then
433 prodstub_delete_jobdata 204 prod-d job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200434 if [ $use_info_jobs ]; then
435 prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS))
436 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100437 fi
438 if [ $(($i%5)) -eq 4 ]; then
439 prodstub_delete_jobdata 204 prod-d job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200440 if [ $use_info_jobs ]; then
441 prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS))
442 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100443 fi
444done
445
446ecs_api_edp_get_producer_status 404 prod-a
447ecs_api_edp_get_producer_status 404 prod-b
448ecs_api_edp_get_producer_status 404 prod-c
449ecs_api_edp_get_producer_status 404 prod-d
450
451for ((i=1; i<=$NUM_JOBS; i++))
452do
453 if [ $(($i%5)) -eq 0 ]; then
454 if [ -z "$FLAT_A1_EI" ]; then
455 ecs_api_a1_get_job_status 200 type1 job$i DISABLED
456 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100457 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100458 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200459 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200460 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200461 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100462 fi
463 if [ $(($i%5)) -eq 1 ]; then
464 if [ -z "$FLAT_A1_EI" ]; then
465 ecs_api_a1_get_job_status 200 type2 job$i DISABLED
466 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100467 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100468 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200469 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200470 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200471 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100472 fi
473 if [ $(($i%5)) -eq 2 ]; then
474 if [ -z "$FLAT_A1_EI" ]; then
475 ecs_api_a1_get_job_status 200 type3 job$i DISABLED
476 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100477 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100478 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200479 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200480 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200481 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100482 fi
483 if [ $(($i%5)) -eq 3 ]; then
484 if [ -z "$FLAT_A1_EI" ]; then
485 ecs_api_a1_get_job_status 200 type4 job$i DISABLED
486 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100487 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100488 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200489 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200490 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200491 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100492 fi
493 if [ $(($i%5)) -eq 4 ]; then
494 if [ -z "$FLAT_A1_EI" ]; then
495 ecs_api_a1_get_job_status 200 type5 job$i DISABLED
496 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100497 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100498 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200499 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200500 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200501 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100502 fi
503done
504
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100505if [ $ECS_VERSION == "V1-1" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100506
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100507 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 +0100508
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100509 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 +0100510
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100511 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 +0100512
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100513 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
514
515else
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200516 if [ $use_info_jobs ]; then
517 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 +0100518
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200519 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 +0100520
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200521 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 +0100522
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200523 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105
524 else
525 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
526
527 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
528
529 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
530
531 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5
532 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100533
534fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100535
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200536if [ $use_info_jobs ]; then
537 ecs_equal json:data-producer/v1/info-producers 4
538else
539 ecs_equal json:ei-producer/v1/eiproducers 4
540fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100541
542ecs_api_edp_get_producer_status 200 prod-a ENABLED
543ecs_api_edp_get_producer_status 200 prod-b ENABLED
544ecs_api_edp_get_producer_status 200 prod-c ENABLED
545ecs_api_edp_get_producer_status 200 prod-d ENABLED
546
547for ((i=1; i<=$NUM_JOBS; i++))
548do
549 if [ $(($i%5)) -eq 0 ]; then
550 if [ -z "$FLAT_A1_EI" ]; then
551 ecs_api_a1_get_job_status 200 type1 job$i ENABLED
552 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100553 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100554 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200555 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200556 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 +0200557 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100558 fi
559 if [ $(($i%5)) -eq 1 ]; then
560 if [ -z "$FLAT_A1_EI" ]; then
561 ecs_api_a1_get_job_status 200 type2 job$i ENABLED
562 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100563 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100564 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200565 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200566 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 2 prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200567 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100568 fi
569 if [ $(($i%5)) -eq 2 ]; then
570 if [ -z "$FLAT_A1_EI" ]; then
571 ecs_api_a1_get_job_status 200 type3 job$i ENABLED
572 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100573 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100574 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200575 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200576 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200577 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100578 fi
579 if [ $(($i%5)) -eq 3 ]; then
580 if [ -z "$FLAT_A1_EI" ]; then
581 ecs_api_a1_get_job_status 200 type4 job$i ENABLED
582 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100583 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100584 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200585 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200586 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200587 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100588 fi
589 if [ $(($i%5)) -eq 4 ]; then
590 if [ -z "$FLAT_A1_EI" ]; then
591 ecs_api_a1_get_job_status 200 type5 job$i ENABLED
592 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100593 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100594 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200595 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200596 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200597 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100598 fi
599done
600
601
602if [ -z "$FLAT_A1_EI" ]; then
603 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5))
604 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5))
605 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5))
606 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5))
607 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5))
608else
609 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5))
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200610 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5))
611 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5))
612 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5))
613 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5))
614fi
615
616if [ $use_info_jobs ]; then
617 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5))
618 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5))
619 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5))
620 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5))
621 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5))
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100622fi
623
624for ((i=1; i<=$NUM_JOBS; i++))
625do
626 if [ $(($i%5)) -eq 0 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100627 if [ $ECS_VERSION == "V1-1" ]; then
628 prodstub_check_jobdata 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
629 prodstub_check_jobdata 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
630 prodstub_check_jobdata 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
631 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200632 if [ $use_info_jobs ]; then
633 prodstub_check_jobdata_3 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
634 prodstub_check_jobdata_3 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
635 prodstub_check_jobdata_3 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
636 else
637 prodstub_check_jobdata_2 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
638 prodstub_check_jobdata_2 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
639 prodstub_check_jobdata_2 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
640 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100641 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200642 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200643 prodstub_check_jobdata_3 200 prod-a job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json
644 prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json
645 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 +0200646 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100647
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100648 fi
649 if [ $(($i%5)) -eq 1 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100650 if [ $ECS_VERSION == "V1-1" ]; then
651 prodstub_check_jobdata 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
652 prodstub_check_jobdata 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
653 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200654 if [ $use_info_jobs ]; then
655 prodstub_check_jobdata_3 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
656 prodstub_check_jobdata_3 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
657 else
658 prodstub_check_jobdata_2 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
659 prodstub_check_jobdata_2 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
660 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100661 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200662 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200663 prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json
664 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 +0200665 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100666 fi
667 if [ $(($i%5)) -eq 2 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100668 if [ $ECS_VERSION == "V1-1" ]; then
669 prodstub_check_jobdata 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
670 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200671 if [ $use_info_jobs ]; then
672 prodstub_check_jobdata_3 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
673 else
674 prodstub_check_jobdata_2 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
675 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100676 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200677 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200678 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 +0200679 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100680 fi
681 if [ $(($i%5)) -eq 3 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100682 if [ $ECS_VERSION == "V1-1" ]; then
683 prodstub_check_jobdata 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
684 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200685 if [ $use_info_jobs ]; then
686 prodstub_check_jobdata_3 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
687 else
688 prodstub_check_jobdata_2 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
689 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100690 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200691 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200692 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 +0200693 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100694 fi
695 if [ $(($i%5)) -eq 4 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100696 if [ $ECS_VERSION == "V1-1" ]; then
697 prodstub_check_jobdata 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
698 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200699 if [ $use_info_jobs ]; then
700 prodstub_check_jobdata_3 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
701 else
702 prodstub_check_jobdata_2 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
703 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100704 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200705 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200706 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 +0200707 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100708 fi
709done
710
711
712for ((i=1; i<=$NUM_JOBS; i++))
713do
714 if [ $(($i%5)) -eq 0 ]; then
715 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200716 if [ $use_info_jobs ]; then
717 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
718 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100719 fi
720 if [ $(($i%5)) -eq 1 ]; then
721 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200722 if [ $use_info_jobs ]; then
723 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
724 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100725 fi
726 if [ $(($i%5)) -eq 2 ]; then
727 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200728 if [ $use_info_jobs ]; then
729 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
730 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100731 fi
732 if [ $(($i%5)) -eq 3 ]; then
733 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200734 if [ $use_info_jobs ]; then
735 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
736 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100737 fi
738 if [ $(($i%5)) -eq 4 ]; then
739 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200740 if [ $use_info_jobs ]; then
741 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
742 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100743 fi
744done
745
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200746if [ $use_info_jobs ]; then
747 ecs_equal json:data-producer/v1/info-producers 4
748else
749 ecs_equal json:ei-producer/v1/eiproducers 4
750fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100751
752ecs_api_edp_get_producer_status 200 prod-a ENABLED
753ecs_api_edp_get_producer_status 200 prod-b ENABLED
754ecs_api_edp_get_producer_status 200 prod-c ENABLED
755ecs_api_edp_get_producer_status 200 prod-d ENABLED
756
757if [ -z "$FLAT_A1_EI" ]; then
758 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs 0
759 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs 0
760 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs 0
761 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs 0
762 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs 0
763else
764 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200765 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 0
766 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 0
767 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 0
768 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 0
769fi
770
771if [ $use_info_jobs ]; then
772 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 0
773 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 0
774 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 0
775 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 0
776 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 0
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100777fi
778
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200779if [ $use_info_jobs ]; then
780 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
781 ecs_api_edp_put_type_2 200 type101 testdata/ecs/info-type-1.json
782 ecs_api_edp_put_type_2 200 type102 testdata/ecs/info-type-2.json
783 ecs_api_edp_put_type_2 200 type103 testdata/ecs/info-type-3.json
784 ecs_api_edp_put_type_2 200 type104 testdata/ecs/info-type-4.json
785 ecs_api_edp_put_type_2 200 type105 testdata/ecs/info-type-5.json
786 fi
787fi
788
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200789if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200790 cr_equal received_callbacks 10 30
791 cr_equal received_callbacks?id=type-status1 5
792 cr_equal received_callbacks?id=type-status2 5
793
794 cr_api_check_all_ecs_subscription_events 200 type-status1 \
795 type101 testdata/ecs/info-type-1.json REGISTERED \
796 type102 testdata/ecs/info-type-2.json REGISTERED \
797 type103 testdata/ecs/info-type-3.json REGISTERED \
798 type104 testdata/ecs/info-type-4.json REGISTERED \
799 type105 testdata/ecs/info-type-5.json REGISTERED
800
801 cr_api_check_all_ecs_subscription_events 200 type-status2 \
802 type101 testdata/ecs/info-type-1.json REGISTERED \
803 type102 testdata/ecs/info-type-2.json REGISTERED \
804 type103 testdata/ecs/info-type-3.json REGISTERED \
805 type104 testdata/ecs/info-type-4.json REGISTERED \
806 type105 testdata/ecs/info-type-5.json REGISTERED
807
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200808else
809 cr_equal received_callbacks 0 30
810fi
811
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100812check_ecs_logs
813
814store_logs END
815
816#### TEST COMPLETE ####
817
818
819print_result
820
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200821auto_clean_environment