blob: 232f901b05cd2eea4e584f2779b7492dfada2cfa [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
BjornMagnussonXA79e37002021-11-22 13:36:04 +010041. ../common/testcase_common.sh $@
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010042
43setup_testenvironment
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010044
45#### TEST BEGIN ####
46
47FLAT_A1_EI="1"
48
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010049clean_environment
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010050
BjornMagnussonXA663566c2021-11-08 10:25:07 +010051start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010052
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010053use_ecs_rest_http
54
55use_prod_stub_http
56
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010057start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010058
59start_prod_stub
60
61set_ecs_trace
62
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010063start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
64
65if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
66 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
67fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010068
BjornMagnussonXA79e37002021-11-22 13:36:04 +010069start_cr 1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010070
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010071CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
72CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010073TARGET="http://localhost:80/target" # Dummy target
74
75NUM_JOBS=10000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +020076use_info_jobs=false #Set flag if interface supporting info-types is used
77if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
78 use_info_jobs=true
79 NUM_JOBS=5000 # 5K ei jobs and 5K info jobs
80fi
81
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +020082if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
83 #Type registration status callbacks
BjornMagnussonXA79e37002021-11-22 13:36:04 +010084 TYPESTATUS1="$CR_SERVICE_APP_PATH_0/type-status1"
85 TYPESTATUS2="$CR_SERVICE_APP_PATH_0/type-status2"
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +020086
87 ecs_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
88
89 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
90
91 ecs_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
92
93 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
94
95fi
96
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010097# Setup prodstub sim to accept calls for producers, types and jobs
98prodstub_arm_producer 200 prod-a
99prodstub_arm_producer 200 prod-b
100prodstub_arm_producer 200 prod-c
101prodstub_arm_producer 200 prod-d
102
103prodstub_arm_type 200 prod-a type1
104
105prodstub_arm_type 200 prod-b type1
106prodstub_arm_type 200 prod-b type2
107
108prodstub_arm_type 200 prod-c type1
109prodstub_arm_type 200 prod-c type2
110prodstub_arm_type 200 prod-c type3
111
112prodstub_arm_type 200 prod-d type4
113prodstub_arm_type 200 prod-d type5
114
115for ((i=1; i<=$NUM_JOBS; i++))
116do
117 if [ $(($i%5)) -eq 0 ]; then
118 prodstub_arm_job_create 200 prod-a job$i
119 prodstub_arm_job_create 200 prod-b job$i
120 prodstub_arm_job_create 200 prod-c job$i
121 fi
122 if [ $(($i%5)) -eq 1 ]; then
123 prodstub_arm_job_create 200 prod-b job$i
124 prodstub_arm_job_create 200 prod-c job$i
125 fi
126 if [ $(($i%5)) -eq 2 ]; then
127 prodstub_arm_job_create 200 prod-c job$i
128 fi
129 if [ $(($i%5)) -eq 3 ]; then
130 prodstub_arm_job_create 200 prod-d job$i
131 fi
132 if [ $(($i%5)) -eq 4 ]; then
133 prodstub_arm_job_create 200 prod-d job$i
134 fi
135done
136
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200137if [ $use_info_jobs ]; then
138 prodstub_arm_producer 200 prod-a
139 prodstub_arm_producer 200 prod-b
140 prodstub_arm_producer 200 prod-c
141 prodstub_arm_producer 200 prod-d
142
143 prodstub_arm_type 200 prod-a type101
144
145 prodstub_arm_type 200 prod-b type101
146 prodstub_arm_type 200 prod-b type102
147
148 prodstub_arm_type 200 prod-c type101
149 prodstub_arm_type 200 prod-c type102
150 prodstub_arm_type 200 prod-c type103
151
152 prodstub_arm_type 200 prod-d type104
153 prodstub_arm_type 200 prod-d type105
154
155 for ((i=1; i<=$NUM_JOBS; i++))
156 do
157 if [ $(($i%5)) -eq 0 ]; then
158 prodstub_arm_job_create 200 prod-a job$(($i+$NUM_JOBS))
159 prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS))
160 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
161 fi
162 if [ $(($i%5)) -eq 1 ]; then
163 prodstub_arm_job_create 200 prod-b job$(($i+$NUM_JOBS))
164 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
165 fi
166 if [ $(($i%5)) -eq 2 ]; then
167 prodstub_arm_job_create 200 prod-c job$(($i+$NUM_JOBS))
168 fi
169 if [ $(($i%5)) -eq 3 ]; then
170 prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS))
171 fi
172 if [ $(($i%5)) -eq 4 ]; then
173 prodstub_arm_job_create 200 prod-d job$(($i+$NUM_JOBS))
174 fi
175 done
176fi
177
178
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100179if [ $ECS_VERSION == "V1-1" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100180
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100181 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 +0100182
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100183 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 +0100184
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100185 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
186
187 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
188
189else
190
191 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
192 ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
193 ecs_api_edp_put_type_2 201 type3 testdata/ecs/ei-type-3.json
194 ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json
195 ecs_api_edp_put_type_2 201 type5 testdata/ecs/ei-type-5.json
196
197 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
198
199 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
200
201 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
202
203 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 +0200204
205 if [ $use_info_jobs ]; then
206 ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
207 ecs_api_edp_put_type_2 201 type102 testdata/ecs/info-type-2.json
208 ecs_api_edp_put_type_2 201 type103 testdata/ecs/info-type-3.json
209 ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json
210 ecs_api_edp_put_type_2 201 type105 testdata/ecs/info-type-5.json
211
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200212
213
214 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100215 cr_equal 0 received_callbacks 20 30
216 cr_equal 0 received_callbacks?id=type-status1 10
217 cr_equal 0 received_callbacks?id=type-status2 10
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200218
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100219 cr_api_check_all_ecs_subscription_events 200 0 type-status1 \
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200220 type1 testdata/ecs/ei-type-1.json REGISTERED \
221 type2 testdata/ecs/ei-type-2.json REGISTERED \
222 type3 testdata/ecs/ei-type-3.json REGISTERED \
223 type4 testdata/ecs/ei-type-4.json REGISTERED \
224 type5 testdata/ecs/ei-type-5.json REGISTERED \
225 type101 testdata/ecs/info-type-1.json REGISTERED \
226 type102 testdata/ecs/info-type-2.json REGISTERED \
227 type103 testdata/ecs/info-type-3.json REGISTERED \
228 type104 testdata/ecs/info-type-4.json REGISTERED \
229 type105 testdata/ecs/info-type-5.json REGISTERED
230
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100231 cr_api_check_all_ecs_subscription_events 200 0 type-status2 \
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200232 type1 testdata/ecs/ei-type-1.json REGISTERED \
233 type2 testdata/ecs/ei-type-2.json REGISTERED \
234 type3 testdata/ecs/ei-type-3.json REGISTERED \
235 type4 testdata/ecs/ei-type-4.json REGISTERED \
236 type5 testdata/ecs/ei-type-5.json REGISTERED \
237 type101 testdata/ecs/info-type-1.json REGISTERED \
238 type102 testdata/ecs/info-type-2.json REGISTERED \
239 type103 testdata/ecs/info-type-3.json REGISTERED \
240 type104 testdata/ecs/info-type-4.json REGISTERED \
241 type105 testdata/ecs/info-type-5.json REGISTERED
242
243 fi
244
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200245 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 type101
246
247 ecs_api_edp_put_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2 type101 type102
248
249 ecs_api_edp_put_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3 type101 type102 type103
250
251 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105
252 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100253fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100254
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200255if [ $use_info_jobs ]; then
256 ecs_equal json:data-producer/v1/info-producers 4
257else
258 ecs_equal json:ei-producer/v1/eiproducers 4
259fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100260
261ecs_api_edp_get_producer_status 200 prod-a ENABLED
262ecs_api_edp_get_producer_status 200 prod-b ENABLED
263ecs_api_edp_get_producer_status 200 prod-c ENABLED
264ecs_api_edp_get_producer_status 200 prod-d ENABLED
265
266for ((i=1; i<=$NUM_JOBS; i++))
267do
268 if [ $(($i%5)) -eq 0 ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100269 ecs_api_a1_put_job 201 job$i type1 $TARGET ric1 $CR_SERVICE_APP_PATH_0/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100270 if [ -z "$FLAT_A1_EI" ]; then
271 ecs_api_a1_get_job_status 200 type1 job$i ENABLED
272 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100273 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100274 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200275 if [ $use_info_jobs ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100276 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type101 $TARGET info-owner $CR_SERVICE_APP_PATH_0/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200277 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 +0200278 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100279 fi
280 if [ $(($i%5)) -eq 1 ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100281 ecs_api_a1_put_job 201 job$i type2 $TARGET ric1 $CR_SERVICE_APP_PATH_0/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100282 if [ -z "$FLAT_A1_EI" ]; then
283 ecs_api_a1_get_job_status 200 type2 job$i ENABLED
284 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100285 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100286 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200287 if [ $use_info_jobs ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100288 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type102 $TARGET info-owner $CR_SERVICE_APP_PATH_0/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200289 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 2 prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200290 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100291 fi
292 if [ $(($i%5)) -eq 2 ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100293 ecs_api_a1_put_job 201 job$i type3 $TARGET ric1 $CR_SERVICE_APP_PATH_0/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100294 if [ -z "$FLAT_A1_EI" ]; then
295 ecs_api_a1_get_job_status 200 type3 job$i ENABLED
296 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100297 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100298 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200299 if [ $use_info_jobs ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100300 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type103 $TARGET info-owner $CR_SERVICE_APP_PATH_0/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200301 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200302 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100303 fi
304 if [ $(($i%5)) -eq 3 ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100305 ecs_api_a1_put_job 201 job$i type4 $TARGET ric1 $CR_SERVICE_APP_PATH_0/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100306 if [ -z "$FLAT_A1_EI" ]; then
307 ecs_api_a1_get_job_status 200 type4 job$i ENABLED
308 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100309 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100310 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200311 if [ $use_info_jobs ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100312 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type104 $TARGET info-owner $CR_SERVICE_APP_PATH_0/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200313 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200314 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100315 fi
316 if [ $(($i%5)) -eq 4 ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100317 ecs_api_a1_put_job 201 job$i type5 $TARGET ric1 $CR_SERVICE_APP_PATH_0/job_status_ric1 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100318 if [ -z "$FLAT_A1_EI" ]; then
319 ecs_api_a1_get_job_status 200 type5 job$i ENABLED
320 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100321 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100322 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200323 if [ $use_info_jobs ]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100324 ecs_api_idc_put_job 201 job$(($i+$NUM_JOBS)) type105 $TARGET info-owner $CR_SERVICE_APP_PATH_0/job_status_info-owner testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200325 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200326 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100327 fi
328done
329
330if [ -z "$FLAT_A1_EI" ]; then
331 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5))
332 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5))
333 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5))
334 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5))
335 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5))
336else
337 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5))
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200338 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5))
339 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5))
340 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5))
341 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5))
342fi
343if [ $use_info_jobs ]; then
344 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5))
345 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5))
346 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5))
347 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5))
348 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5))
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100349fi
350
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200351if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100352 cr_equal 0 received_callbacks 20 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200353
354else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100355 cr_equal 0 received_callbacks 0 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200356
357fi
358
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200359
360if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
361
362 ecs_equal json:/data-consumer/v1/info-type-subscription 2 200
363
364 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
365 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
366
367 if [ $use_info_jobs ]; then
368 ecs_equal json:data-producer/v1/info-types 10 1000
369 else
370 ecs_equal json:ei-producer/v1/eitypes 5 1000
371 fi
372
373fi
374
BjornMagnussonXAa69cd902021-04-22 23:46:10 +0200375stop_ecs
376
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100377cr_api_reset 0
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200378
BjornMagnussonXAa69cd902021-04-22 23:46:10 +0200379start_stopped_ecs
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100380
381set_ecs_trace
382
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200383if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
384
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200385 ecs_equal json:/data-consumer/v1/info-type-subscription 2 200
386
387 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
388 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200389
390 if [ $use_info_jobs ]; then
391 ecs_equal json:data-producer/v1/info-types 10 1000
392 else
393 ecs_equal json:ei-producer/v1/eitypes 5 1000
394 fi
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200395fi
396
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100397cr_equal 0 received_callbacks 0
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200398
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100399for ((i=1; i<=$NUM_JOBS; i++))
400do
401 if [ $(($i%5)) -eq 0 ]; then
402 prodstub_delete_jobdata 204 prod-a job$i
403 prodstub_delete_jobdata 204 prod-b job$i
404 prodstub_delete_jobdata 204 prod-c job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200405 if [ $use_info_jobs ]; then
406 prodstub_delete_jobdata 204 prod-a job$(($i+$NUM_JOBS))
407 prodstub_delete_jobdata 204 prod-b job$(($i+$NUM_JOBS))
408 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
409 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100410 fi
411 if [ $(($i%5)) -eq 1 ]; then
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-b job$(($i+$NUM_JOBS))
416 prodstub_delete_jobdata 204 prod-c job$(($i+$NUM_JOBS))
417 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100418 fi
419 if [ $(($i%5)) -eq 2 ]; then
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-c job$(($i+$NUM_JOBS))
423 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100424 fi
425 if [ $(($i%5)) -eq 3 ]; then
426 prodstub_delete_jobdata 204 prod-d job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200427 if [ $use_info_jobs ]; then
428 prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS))
429 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100430 fi
431 if [ $(($i%5)) -eq 4 ]; then
432 prodstub_delete_jobdata 204 prod-d job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200433 if [ $use_info_jobs ]; then
434 prodstub_delete_jobdata 204 prod-d job$(($i+$NUM_JOBS))
435 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100436 fi
437done
438
439ecs_api_edp_get_producer_status 404 prod-a
440ecs_api_edp_get_producer_status 404 prod-b
441ecs_api_edp_get_producer_status 404 prod-c
442ecs_api_edp_get_producer_status 404 prod-d
443
444for ((i=1; i<=$NUM_JOBS; i++))
445do
446 if [ $(($i%5)) -eq 0 ]; then
447 if [ -z "$FLAT_A1_EI" ]; then
448 ecs_api_a1_get_job_status 200 type1 job$i DISABLED
449 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100450 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100451 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200452 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200453 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200454 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100455 fi
456 if [ $(($i%5)) -eq 1 ]; then
457 if [ -z "$FLAT_A1_EI" ]; then
458 ecs_api_a1_get_job_status 200 type2 job$i DISABLED
459 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100460 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100461 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200462 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200463 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200464 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100465 fi
466 if [ $(($i%5)) -eq 2 ]; then
467 if [ -z "$FLAT_A1_EI" ]; then
468 ecs_api_a1_get_job_status 200 type3 job$i DISABLED
469 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100470 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100471 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200472 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200473 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200474 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100475 fi
476 if [ $(($i%5)) -eq 3 ]; then
477 if [ -z "$FLAT_A1_EI" ]; then
478 ecs_api_a1_get_job_status 200 type4 job$i DISABLED
479 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100480 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100481 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200482 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200483 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200484 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100485 fi
486 if [ $(($i%5)) -eq 4 ]; then
487 if [ -z "$FLAT_A1_EI" ]; then
488 ecs_api_a1_get_job_status 200 type5 job$i DISABLED
489 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100490 ecs_api_a1_get_job_status 200 job$i DISABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100491 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200492 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200493 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) DISABLED EMPTYPROD 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200494 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100495 fi
496done
497
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100498if [ $ECS_VERSION == "V1-1" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100499
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100500 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 +0100501
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100502 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 +0100503
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100504 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 +0100505
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100506 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
507
508else
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200509 if [ $use_info_jobs ]; then
510 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 +0100511
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200512 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 +0100513
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200514 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 +0100515
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200516 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5 type104 type105
517 else
518 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
519
520 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
521
522 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
523
524 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5
525 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100526
527fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100528
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200529if [ $use_info_jobs ]; then
530 ecs_equal json:data-producer/v1/info-producers 4
531else
532 ecs_equal json:ei-producer/v1/eiproducers 4
533fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100534
535ecs_api_edp_get_producer_status 200 prod-a ENABLED
536ecs_api_edp_get_producer_status 200 prod-b ENABLED
537ecs_api_edp_get_producer_status 200 prod-c ENABLED
538ecs_api_edp_get_producer_status 200 prod-d ENABLED
539
540for ((i=1; i<=$NUM_JOBS; i++))
541do
542 if [ $(($i%5)) -eq 0 ]; then
543 if [ -z "$FLAT_A1_EI" ]; then
544 ecs_api_a1_get_job_status 200 type1 job$i ENABLED
545 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100546 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100547 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200548 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200549 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 +0200550 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100551 fi
552 if [ $(($i%5)) -eq 1 ]; then
553 if [ -z "$FLAT_A1_EI" ]; then
554 ecs_api_a1_get_job_status 200 type2 job$i ENABLED
555 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100556 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100557 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200558 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200559 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 2 prod-b prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200560 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100561 fi
562 if [ $(($i%5)) -eq 2 ]; then
563 if [ -z "$FLAT_A1_EI" ]; then
564 ecs_api_a1_get_job_status 200 type3 job$i ENABLED
565 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100566 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100567 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200568 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200569 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-c 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200570 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100571 fi
572 if [ $(($i%5)) -eq 3 ]; then
573 if [ -z "$FLAT_A1_EI" ]; then
574 ecs_api_a1_get_job_status 200 type4 job$i ENABLED
575 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100576 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100577 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200578 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200579 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200580 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100581 fi
582 if [ $(($i%5)) -eq 4 ]; then
583 if [ -z "$FLAT_A1_EI" ]; then
584 ecs_api_a1_get_job_status 200 type5 job$i ENABLED
585 else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100586 ecs_api_a1_get_job_status 200 job$i ENABLED 120
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100587 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200588 if [ $use_info_jobs ]; then
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +0200589 ecs_api_idc_get_job_status2 200 job$(($i+$NUM_JOBS)) ENABLED 1 prod-d 120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200590 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100591 fi
592done
593
594
595if [ -z "$FLAT_A1_EI" ]; then
596 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs $(($NUM_JOBS/5))
597 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs $(($NUM_JOBS/5))
598 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs $(($NUM_JOBS/5))
599 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs $(($NUM_JOBS/5))
600 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs $(($NUM_JOBS/5))
601else
602 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 $(($NUM_JOBS/5))
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200603 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 $(($NUM_JOBS/5))
604 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 $(($NUM_JOBS/5))
605 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 $(($NUM_JOBS/5))
606 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 $(($NUM_JOBS/5))
607fi
608
609if [ $use_info_jobs ]; then
610 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 $(($NUM_JOBS/5))
611 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 $(($NUM_JOBS/5))
612 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 $(($NUM_JOBS/5))
613 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 $(($NUM_JOBS/5))
614 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 $(($NUM_JOBS/5))
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100615fi
616
617for ((i=1; i<=$NUM_JOBS; i++))
618do
619 if [ $(($i%5)) -eq 0 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100620 if [ $ECS_VERSION == "V1-1" ]; then
621 prodstub_check_jobdata 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
622 prodstub_check_jobdata 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
623 prodstub_check_jobdata 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
624 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200625 if [ $use_info_jobs ]; then
626 prodstub_check_jobdata_3 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
627 prodstub_check_jobdata_3 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
628 prodstub_check_jobdata_3 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
629 else
630 prodstub_check_jobdata_2 200 prod-a job$i type1 $TARGET ric1 testdata/ecs/job-template.json
631 prodstub_check_jobdata_2 200 prod-b job$i type1 $TARGET ric1 testdata/ecs/job-template.json
632 prodstub_check_jobdata_2 200 prod-c job$i type1 $TARGET ric1 testdata/ecs/job-template.json
633 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100634 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200635 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200636 prodstub_check_jobdata_3 200 prod-a job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json
637 prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type101 $TARGET info-owner testdata/ecs/job-template.json
638 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 +0200639 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100640
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100641 fi
642 if [ $(($i%5)) -eq 1 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100643 if [ $ECS_VERSION == "V1-1" ]; then
644 prodstub_check_jobdata 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
645 prodstub_check_jobdata 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
646 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200647 if [ $use_info_jobs ]; then
648 prodstub_check_jobdata_3 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
649 prodstub_check_jobdata_3 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
650 else
651 prodstub_check_jobdata_2 200 prod-b job$i type2 $TARGET ric1 testdata/ecs/job-template.json
652 prodstub_check_jobdata_2 200 prod-c job$i type2 $TARGET ric1 testdata/ecs/job-template.json
653 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100654 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200655 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200656 prodstub_check_jobdata_3 200 prod-b job$(($i+$NUM_JOBS)) type102 $TARGET info-owner testdata/ecs/job-template.json
657 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 +0200658 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100659 fi
660 if [ $(($i%5)) -eq 2 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100661 if [ $ECS_VERSION == "V1-1" ]; then
662 prodstub_check_jobdata 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
663 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200664 if [ $use_info_jobs ]; then
665 prodstub_check_jobdata_3 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
666 else
667 prodstub_check_jobdata_2 200 prod-c job$i type3 $TARGET ric1 testdata/ecs/job-template.json
668 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100669 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200670 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200671 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 +0200672 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100673 fi
674 if [ $(($i%5)) -eq 3 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100675 if [ $ECS_VERSION == "V1-1" ]; then
676 prodstub_check_jobdata 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
677 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200678 if [ $use_info_jobs ]; then
679 prodstub_check_jobdata_3 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
680 else
681 prodstub_check_jobdata_2 200 prod-d job$i type4 $TARGET ric1 testdata/ecs/job-template.json
682 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100683 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200684 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200685 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 +0200686 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100687 fi
688 if [ $(($i%5)) -eq 4 ]; then
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100689 if [ $ECS_VERSION == "V1-1" ]; then
690 prodstub_check_jobdata 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
691 else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200692 if [ $use_info_jobs ]; then
693 prodstub_check_jobdata_3 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
694 else
695 prodstub_check_jobdata_2 200 prod-d job$i type5 $TARGET ric1 testdata/ecs/job-template.json
696 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100697 fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200698 if [ $use_info_jobs ]; then
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200699 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 +0200700 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100701 fi
702done
703
704
705for ((i=1; i<=$NUM_JOBS; i++))
706do
707 if [ $(($i%5)) -eq 0 ]; then
708 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200709 if [ $use_info_jobs ]; then
710 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
711 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100712 fi
713 if [ $(($i%5)) -eq 1 ]; then
714 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200715 if [ $use_info_jobs ]; then
716 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
717 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100718 fi
719 if [ $(($i%5)) -eq 2 ]; then
720 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200721 if [ $use_info_jobs ]; then
722 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
723 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100724 fi
725 if [ $(($i%5)) -eq 3 ]; then
726 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200727 if [ $use_info_jobs ]; then
728 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
729 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100730 fi
731 if [ $(($i%5)) -eq 4 ]; then
732 ecs_api_a1_delete_job 204 job$i
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200733 if [ $use_info_jobs ]; then
734 ecs_api_idc_delete_job 204 job$(($i+$NUM_JOBS))
735 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100736 fi
737done
738
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200739if [ $use_info_jobs ]; then
740 ecs_equal json:data-producer/v1/info-producers 4
741else
742 ecs_equal json:ei-producer/v1/eiproducers 4
743fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100744
745ecs_api_edp_get_producer_status 200 prod-a ENABLED
746ecs_api_edp_get_producer_status 200 prod-b ENABLED
747ecs_api_edp_get_producer_status 200 prod-c ENABLED
748ecs_api_edp_get_producer_status 200 prod-d ENABLED
749
750if [ -z "$FLAT_A1_EI" ]; then
751 ecs_equal json:A1-EI/v1/eitypes/type1/eijobs 0
752 ecs_equal json:A1-EI/v1/eitypes/type2/eijobs 0
753 ecs_equal json:A1-EI/v1/eitypes/type3/eijobs 0
754 ecs_equal json:A1-EI/v1/eitypes/type4/eijobs 0
755 ecs_equal json:A1-EI/v1/eitypes/type5/eijobs 0
756else
757 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type1 0
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200758 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type2 0
759 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type3 0
760 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type4 0
761 ecs_equal json:A1-EI/v1/eijobs?eiTypeId=type5 0
762fi
763
764if [ $use_info_jobs ]; then
765 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type101 0
766 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type102 0
767 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type103 0
768 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type104 0
769 ecs_equal json:data-consumer/v1/info-jobs?infoTypeId=type105 0
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100770fi
771
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200772if [ $use_info_jobs ]; then
773 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
774 ecs_api_edp_put_type_2 200 type101 testdata/ecs/info-type-1.json
775 ecs_api_edp_put_type_2 200 type102 testdata/ecs/info-type-2.json
776 ecs_api_edp_put_type_2 200 type103 testdata/ecs/info-type-3.json
777 ecs_api_edp_put_type_2 200 type104 testdata/ecs/info-type-4.json
778 ecs_api_edp_put_type_2 200 type105 testdata/ecs/info-type-5.json
779 fi
780fi
781
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200782if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100783 cr_equal 0 received_callbacks 10 30
784 cr_equal 0 received_callbacks?id=type-status1 5
785 cr_equal 0 received_callbacks?id=type-status2 5
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200786
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100787 cr_api_check_all_ecs_subscription_events 200 0 type-status1 \
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200788 type101 testdata/ecs/info-type-1.json REGISTERED \
789 type102 testdata/ecs/info-type-2.json REGISTERED \
790 type103 testdata/ecs/info-type-3.json REGISTERED \
791 type104 testdata/ecs/info-type-4.json REGISTERED \
792 type105 testdata/ecs/info-type-5.json REGISTERED
793
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100794 cr_api_check_all_ecs_subscription_events 200 0 type-status2 \
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200795 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
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200801else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100802 cr_equal 0 received_callbacks 0 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200803fi
804
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100805check_ecs_logs
806
807store_logs END
808
809#### TEST COMPLETE ####
810
811
812print_result
813
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200814auto_clean_environment