blob: 0e4f4a72150f7b7b0ecaf36e12deebabf0694ae8 [file] [log] [blame]
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001#!/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
BjornMagnussonXAc963b732021-01-20 14:24:13 +010021TC_ONELINE_DESCR="ECS full interfaces walkthrough"
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020022
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 RICSIM CP HTTPPROXY 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="PRODSTUB CR ECS RICSIM CP HTTPPROXY 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
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010029KUBE_PRESTARTED_IMAGES=""
30
31#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
32#the image is not configured in the supplied env_file
33#Used for images not applicable to all supported profile
34CONDITIONALLY_IGNORED_IMAGES="NGW"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010035
36#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"
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020040
41. ../common/testcase_common.sh $@
42. ../common/ecs_api_functions.sh
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020043. ../common/prodstub_api_functions.sh
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010044. ../common/cr_api_functions.sh
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010045. ../common/control_panel_api_functions.sh
46. ../common/controller_api_functions.sh
47. ../common/ricsimulator_api_functions.sh
BjornMagnussonXAc963b732021-01-20 14:24:13 +010048. ../common/http_proxy_api_functions.sh
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010049. ../common/kube_proxy_api_functions.sh
50. ../common/gateway_api_functions.sh
51
52setup_testenvironment
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020053
54#### TEST BEGIN ####
55
BjornMagnussonXA4207b832020-11-03 09:52:49 +010056FLAT_A1_EI="1"
57
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010058clean_environment
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020059
BjornMagnussonXA663566c2021-11-08 10:25:07 +010060start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010061
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010062use_ecs_rest_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020063
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010064use_prod_stub_https
65
66use_simulator_https
67
68use_cr_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020069
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010070start_http_proxy
BjornMagnussonXAc963b732021-01-20 14:24:13 +010071
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010072start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE #Change NOPROXY to PROXY to run with http proxy
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010073
74if [ $RUNMODE == "KUBE" ]; then
75 ecs_api_admin_reset
76fi
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020077
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020078start_prod_stub
79
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +020080set_ecs_debug
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020081
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010082start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
83
84if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
85 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
86fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010087
88if [ "$PMS_VERSION" == "V2" ]; then
89 start_ric_simulators ricsim_g3 4 STD_2.0.0
90fi
91
92start_cr
93
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010094CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
95CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +020096#Targets for ei jobs
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010097TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
98TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
99TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
100TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
101TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200103#Targets for info jobs
104TARGET101="http://localhost:80/target" # Dummy target, no target for info data in this env...
105TARGET102="http://localhost:80/target" # Dummy target, no target for info data in this env...
106TARGET103="http://localhost:80/target" # Dummy target, no target for info data in this env...
107TARGET108="http://localhost:80/target" # Dummy target, no target for info data in this env...
108TARGET110="http://localhost:80/target" # Dummy target, no target for info data in this env...
109TARGET150="http://localhost:80/target" # Dummy target, no target for info data in this env...
110TARGET160="http://localhost:80/target" # Dummy target, no target for info data in this env...
111
112#Status callbacks for eijobs
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100113STATUS1="$CR_SERVICE_APP_PATH/job1-status"
114STATUS2="$CR_SERVICE_APP_PATH/job2-status"
115STATUS3="$CR_SERVICE_APP_PATH/job3-status"
116STATUS8="$CR_SERVICE_APP_PATH/job8-status"
117STATUS10="$CR_SERVICE_APP_PATH/job10-status"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100118
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200119#Status callbacks for infojobs
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100120INFOSTATUS101="$CR_SERVICE_APP_PATH/info-job101-status"
121INFOSTATUS102="$CR_SERVICE_APP_PATH/info-job102-status"
122INFOSTATUS103="$CR_SERVICE_APP_PATH/info-job103-status"
123INFOSTATUS108="$CR_SERVICE_APP_PATH/info-job108-status"
124INFOSTATUS110="$CR_SERVICE_APP_PATH/info-job110-status"
125INFOSTATUS150="$CR_SERVICE_APP_PATH/info-job150-status"
126INFOSTATUS160="$CR_SERVICE_APP_PATH/info-job160-status"
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200127
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200128if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
129 #Type registration status callbacks
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100130 TYPESTATUS1="$CR_SERVICE_APP_PATH/type-status1"
131 TYPESTATUS2="$CR_SERVICE_APP_PATH/type-status2"
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200132
133 ecs_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
134
135 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
136
137 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
138
139 ecs_api_idc_get_subscription_ids 200 test EMPTY
140
141 ecs_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
142
143 ecs_api_idc_get_subscription 404 test
144
145 ecs_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
146
147 ecs_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
148
149 ecs_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
150
151 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
152
153 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
154
155 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
156
157 ecs_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
158 ecs_api_idc_get_subscription 200 subscription-id-2 owner2 $TYPESTATUS2
159
160 ecs_api_idc_delete_subscription 204 subscription-id-2
161
162 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
163
164 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
165
166 cr_equal received_callbacks 1 30
167 cr_equal received_callbacks?id=type-status1 1
168 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json REGISTERED
169
170 ecs_api_edp_delete_type_2 204 type1
171
172 cr_equal received_callbacks 2 30
173 cr_equal received_callbacks?id=type-status1 2
174 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json DEREGISTERED
175
176 ecs_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
177 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
178
179 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
180
181 cr_equal received_callbacks 4 30
182 cr_equal received_callbacks?id=type-status1 3
183 cr_equal received_callbacks?id=type-status2 1
184 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json REGISTERED
185
186 ecs_api_idc_delete_subscription 204 subscription-id-2
187
188 ecs_api_edp_delete_type_2 204 type1
189
190 cr_equal received_callbacks 5 30
191 cr_equal received_callbacks?id=type-status1 4
192 cr_equal received_callbacks?id=type-status2 1
193 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json DEREGISTERED
194
195 cr_api_reset
196fi
197
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100198### Setup prodstub sim to accept calls for producers, types and jobs
199## prod-a type1
200## prod-b type1 and type2
201## prod-c no-type
202## prod-d type4
203## prod-e type6
204## prod-f type6
205
206## job1 -> prod-a
207## job2 -> prod-a
208## job3 -> prod-b
209## job4 -> prod-a
210## job6 -> prod-b
211## job8 -> prod-d
212## job10 -> prod-e and prod-f
213
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200214prodstub_arm_producer 200 prod-a
215prodstub_arm_producer 200 prod-b
216prodstub_arm_producer 200 prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200217prodstub_arm_producer 200 prod-d
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100218prodstub_arm_producer 200 prod-e
219prodstub_arm_producer 200 prod-f
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200220
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200221prodstub_arm_type 200 prod-a type1
222prodstub_arm_type 200 prod-b type2
223prodstub_arm_type 200 prod-b type3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100224prodstub_arm_type 200 prod-d type4
225prodstub_arm_type 200 prod-e type6
226prodstub_arm_type 200 prod-f type6
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200227
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200228prodstub_disarm_type 200 prod-b type3
229prodstub_arm_type 200 prod-b type1
230prodstub_disarm_type 200 prod-b type1
231
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100232
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200233prodstub_arm_job_create 200 prod-a job1
234prodstub_arm_job_create 200 prod-a job2
235prodstub_arm_job_create 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200236
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200237prodstub_arm_job_delete 200 prod-a job1
238prodstub_arm_job_delete 200 prod-a job2
239prodstub_arm_job_delete 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200240
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200241prodstub_arm_job_create 200 prod-b job4
242prodstub_arm_job_create 200 prod-a job4
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200243
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200244prodstub_arm_job_create 200 prod-b job6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200245
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100246prodstub_arm_job_create 200 prod-d job8
247
248prodstub_arm_job_create 200 prod-e job10
249prodstub_arm_job_create 200 prod-f job10
250
251### ecs status
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200252ecs_api_service_status 200
253
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100254cr_equal received_callbacks 0
255
256### Initial tests - no config made
257### GET: type ids, types, producer ids, producers, job ids, jobs
258### DELETE: jobs
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200259ecs_api_a1_get_type_ids 200 EMPTY
260ecs_api_a1_get_type 404 test-type
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200261
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200262ecs_api_edp_get_type_ids 200 EMPTY
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100263if [ $ECS_VERSION == "V1-1" ]; then
264 ecs_api_edp_get_type 404 test-type
265else
266 ecs_api_edp_get_type_2 404 test-type
267fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200268
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100269if [ $ECS_VERSION == "V1-1" ]; then
270 ecs_api_edp_get_producer_ids 200 EMPTY
271 ecs_api_edp_get_producer 404 test-prod
272else
273 ecs_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
274 ecs_api_edp_get_producer_2 404 test-prod
275fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200276ecs_api_edp_get_producer_status 404 test-prod
277
278ecs_api_edp_delete_producer 404 test-prod
279
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100280if [ -z "$FLAT_A1_EI" ]; then
281 ecs_api_a1_get_job_ids 404 test-type NOWNER
282 ecs_api_a1_get_job_ids 404 test-type test-owner
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200283
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100284 ecs_api_a1_get_job 404 test-type test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200285
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100286 ecs_api_a1_get_job_status 404 test-type test-job
287else
288 ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY
289 ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200290
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100291 ecs_api_a1_get_job 404 test-job
292
293 ecs_api_a1_get_job_status 404 test-job
294fi
295
296if [ -z "$FLAT_A1_EI" ]; then
297 ecs_api_a1_delete_job 404 test-type test-job
298else
299 ecs_api_a1_delete_job 404 test-job
300fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200301
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100302if [ $ECS_VERSION == "V1-1" ]; then
303 ecs_api_edp_get_producer_jobs 404 test-prod
304else
305 ecs_api_edp_get_producer_jobs_2 404 test-prod
306fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200307
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100308if [ $ECS_VERSION == "V1-2" ]; then
309 ecs_api_edp_get_type_2 404 test-type
310 ecs_api_edp_delete_type_2 404 test-type
311fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200312
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100313### Setup of producer/job and testing apis ###
314
315## Setup prod-a
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100316if [ $ECS_VERSION == "V1-1" ]; then
317 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
318 ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
319else
320 #V1-2
321 ecs_api_edp_get_type_ids 200 EMPTY
322 ecs_api_edp_get_type_2 404 type1
323 ecs_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
324
325 # Create type, delete and create again
326 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
327 ecs_api_edp_get_type_2 200 type1
328 ecs_api_edp_get_type_ids 200 type1
329 ecs_api_edp_delete_type_2 204 type1
330 ecs_api_edp_get_type_2 404 type1
331 ecs_api_edp_get_type_ids 200 EMPTY
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200332 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
333 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
334 else
335 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
336 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100337 ecs_api_edp_get_type_ids 200 type1
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200338 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
339 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
340 else
341 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
342 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100343
344 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
345 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200346
347 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
348 cr_equal received_callbacks 3 30
349 cr_equal received_callbacks?id=type-status1 3
350 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json REGISTERED type1 testdata/ecs/ei-type-1.json DEREGISTERED type1 testdata/ecs/ei-type-1.json REGISTERED
351 else
352 cr_equal received_callbacks 0
353 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100354fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100355
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200356
357ecs_api_a1_get_type_ids 200 type1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100358if [ -z "$FLAT_A1_EI" ]; then
359 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
360else
361 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
362fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200363
364ecs_api_edp_get_type_ids 200 type1
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100365if [ $ECS_VERSION == "V1-1" ]; then
366 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
367else
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200368 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
369 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
370 else
371 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
372 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100373fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200374
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100375if [ $ECS_VERSION == "V1-1" ]; then
376 ecs_api_edp_get_producer_ids 200 prod-a
377else
378 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a
379 ecs_api_edp_get_producer_ids_2 200 type1 prod-a
380 ecs_api_edp_get_producer_ids_2 200 type2 EMPTY
381fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100382
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100383if [ $ECS_VERSION == "V1-1" ]; then
384 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
385else
386 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
387fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200388
389ecs_api_edp_get_producer_status 200 prod-a ENABLED
390
391ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
392ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
393
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100394if [ -z "$FLAT_A1_EI" ]; then
395 ecs_api_a1_get_job 404 type1 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200396
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100397 ecs_api_a1_get_job_status 404 type1 test-job
398else
399 ecs_api_a1_get_job 404 test-job
400
401 ecs_api_a1_get_job_status 404 test-job
402fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100403if [ $ECS_VERSION == "V1-1" ]; then
404 ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
405else
406 ecs_api_edp_get_producer_jobs_2 200 prod-a EMPTY
407fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200408
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100409## Create a job for prod-a
410## job1 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100411if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100412 ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100413else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100414 ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100415fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200416
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100417# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100418if [ $ECS_VERSION == "V1-1" ]; then
419 prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
420else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200421 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
422 prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
423 else
424 prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
425 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100426fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200427
428ecs_api_a1_get_job_ids 200 type1 NOWNER job1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100429ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
430
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100431if [ ! -z "$FLAT_A1_EI" ]; then
432 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1
433fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200434
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100435if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100436 ecs_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200437
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100438 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
439else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100440 ecs_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100441
442 ecs_api_a1_get_job_status 200 job1 ENABLED
443fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200444
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100445prodstub_equal create/prod-a/job1 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200446
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100447if [ $ECS_VERSION == "V1-1" ]; then
448 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
449else
450 ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
451fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200452
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100453## Create a second job for prod-a
454## job2 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100455if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100456 ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100457else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100458 ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100459fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200460
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100461# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100462if [ $ECS_VERSION == "V1-1" ]; then
463 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
464else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200465 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
466 prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
467 else
468 prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
469 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100470fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200471ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100472ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
473ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100474if [ ! -z "$FLAT_A1_EI" ]; then
475 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
476fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200477
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100478if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100479 ecs_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200480
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100481 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
482else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100483 ecs_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100484
485 ecs_api_a1_get_job_status 200 job2 ENABLED
486fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200487
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100488prodstub_equal create/prod-a/job2 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200489
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100490if [ $ECS_VERSION == "V1-1" ]; then
491 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
492else
493 ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
494fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200495
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100496## Setup prod-b
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100497if [ $ECS_VERSION == "V1-1" ]; then
498 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
499else
500 ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
501 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200502 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
503 cr_equal received_callbacks 4 30
504 cr_equal received_callbacks?id=type-status1 4
505 cr_api_check_all_ecs_subscription_events 200 type-status1 type2 testdata/ecs/ei-type-2.json REGISTERED
506 else
507 cr_equal received_callbacks 0
508 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100509fi
510
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200511
512ecs_api_a1_get_type_ids 200 type1 type2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100513if [ -z "$FLAT_A1_EI" ]; then
514 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
515 ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
516else
517 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
518 ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json
519fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200520
521ecs_api_edp_get_type_ids 200 type1 type2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100522if [ $ECS_VERSION == "V1-1" ]; then
523 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
524 ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
525else
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200526 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
527 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
528 else
529 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
530 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100531 ecs_api_edp_get_type_2 200 type2 testdata/ecs/ei-type-2.json
532fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200533
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100534if [ $ECS_VERSION == "V1-1" ]; then
535 ecs_api_edp_get_producer_ids 200 prod-a prod-b
536else
537 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b
538fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100539
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100540if [ $ECS_VERSION == "V1-1" ]; then
541 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
542 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
543else
544 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
545 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
546fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200547
548ecs_api_edp_get_producer_status 200 prod-b ENABLED
549
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100550## Create job for prod-b
551## job3 - prod-b
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100552if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100553 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100554else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100555 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100556fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200557
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100558prodstub_equal create/prod-b/job3 1
559
560# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100561if [ $ECS_VERSION == "V1-1" ]; then
562 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
563else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200564 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
565 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
566 else
567 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
568 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100569fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200570
571ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
572ecs_api_a1_get_job_ids 200 type2 NOWNER job3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100573ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
574ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
575ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200576
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100577if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100578 ecs_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200579
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100580 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
581else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100582 ecs_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100583
584 ecs_api_a1_get_job_status 200 job3 ENABLED
585fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200586
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100587if [ $ECS_VERSION == "V1-1" ]; then
588 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
589 ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
590else
591 ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
592 ecs_api_edp_get_producer_jobs_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
593fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200594
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100595## Setup prod-c (no types)
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100596if [ $ECS_VERSION == "V1-1" ]; then
597 ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
598else
599 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
600fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100601
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100602if [ $ECS_VERSION == "V1-1" ]; then
603 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
604else
605 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
606fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200607
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100608if [ $ECS_VERSION == "V1-1" ]; then
609 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
610 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
611 ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
612else
613 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
614 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
615 ecs_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
616fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200617
618ecs_api_edp_get_producer_status 200 prod-c ENABLED
619
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100620
621## Delete job3 and prod-b and re-create if different order
622
623# Delete job then producer
624ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100625if [ $ECS_VERSION == "V1-1" ]; then
626 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
627else
628 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
629fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100630
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100631if [ -z "$FLAT_A1_EI" ]; then
632 ecs_api_a1_delete_job 204 type2 job3
633else
634 ecs_api_a1_delete_job 204 job3
635fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200636
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100637ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100638if [ $ECS_VERSION == "V1-1" ]; then
639 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
640else
641 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
642fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100643
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200644ecs_api_edp_delete_producer 204 prod-b
645
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100646ecs_api_edp_get_producer_status 404 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200647
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100648ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100649if [ $ECS_VERSION == "V1-1" ]; then
650 ecs_api_edp_get_producer_ids 200 prod-a prod-c
651else
652 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
653fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200654
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100655prodstub_equal delete/prod-b/job3 1
656
657if [ -z "$FLAT_A1_EI" ]; then
658 ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
659else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100660 if [ $ECS_VERSION == "V1-1" ]; then
661 ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
662 else
663 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
664 ecs_api_a1_get_job_status 200 job3 DISABLED
665 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100666fi
667
668# Put producer then job
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100669if [ $ECS_VERSION == "V1-1" ]; then
670 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
671else
672 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
673fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100674
675ecs_api_edp_get_producer_status 200 prod-b ENABLED
676
677if [ -z "$FLAT_A1_EI" ]; then
678 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
679 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
680else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100681 if [ $ECS_VERSION == "V1-1" ]; then
682 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
683 else
684 ecs_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
685 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100686 ecs_api_a1_get_job_status 200 job3 ENABLED
687fi
688
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100689if [ $ECS_VERSION == "V1-1" ]; then
690 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
691else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200692 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
693 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
694 else
695 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
696 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100697fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100698
699ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100700if [ $ECS_VERSION == "V1-1" ]; then
701 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
702else
703 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
704fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100705
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100706if [ $ECS_VERSION == "V1-1" ]; then
707 prodstub_equal create/prod-b/job3 2
708else
709 prodstub_equal create/prod-b/job3 3
710fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100711prodstub_equal delete/prod-b/job3 1
712
713# Delete only the producer
714ecs_api_edp_delete_producer 204 prod-b
715
716ecs_api_edp_get_producer_status 404 prod-b
717
718ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100719if [ $ECS_VERSION == "V1-1" ]; then
720 ecs_api_edp_get_producer_ids 200 prod-a prod-c
721else
722 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
723fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100724
725if [ -z "$FLAT_A1_EI" ]; then
726 ecs_api_a1_get_job_status 200 type2 job3 DISABLED
727else
728 ecs_api_a1_get_job_status 200 job3 DISABLED
729fi
730
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200731if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
732 cr_equal received_callbacks 5 30
733 cr_equal received_callbacks?id=type-status1 4
734 cr_equal received_callbacks?id=job3-status 1
735 cr_api_check_all_ecs_events 200 job3-status DISABLED
736else
737 cr_equal received_callbacks 1 30
738 cr_equal received_callbacks?id=job3-status 1
739 cr_api_check_all_ecs_events 200 job3-status DISABLED
740fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100741
742# Re-create the producer
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100743if [ $ECS_VERSION == "V1-1" ]; then
744 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
745else
746 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
747fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100748
749ecs_api_edp_get_producer_status 200 prod-b ENABLED
750
751if [ -z "$FLAT_A1_EI" ]; then
752 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
753else
754 ecs_api_a1_get_job_status 200 job3 ENABLED
755fi
756
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200757if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
758 cr_equal received_callbacks 6 30
759 cr_equal received_callbacks?id=type-status1 4
760 cr_equal received_callbacks?id=job3-status 2
761 cr_api_check_all_ecs_events 200 job3-status ENABLED
762else
763 cr_equal received_callbacks 2 30
764 cr_equal received_callbacks?id=job3-status 2
765 cr_api_check_all_ecs_events 200 job3-status ENABLED
766fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100767
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100768if [ $ECS_VERSION == "V1-1" ]; then
769 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
770else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200771 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
772 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
773 else
774 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
775 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100776fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100777
778## Setup prod-d
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100779if [ $ECS_VERSION == "V1-1" ]; then
780 ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
781else
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200782 ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100783 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
784fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200785
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200786if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
787 cr_equal received_callbacks 7 30
788 cr_equal received_callbacks?id=type-status1 5
789 cr_api_check_all_ecs_subscription_events 200 type-status1 type4 testdata/ecs/ei-type-4.json REGISTERED
790fi
791
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200792ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
793
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100794if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100795 ecs_api_a1_put_job 201 type4 job8 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100796else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100797 ecs_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100798fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100799
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100800if [ $ECS_VERSION == "V1-1" ]; then
801 prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
802else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200803 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
804 prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
805 else
806 prodstub_check_jobdata_3 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
807 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100808fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100809
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200810prodstub_equal create/prod-d/job8 1
811prodstub_equal delete/prod-d/job8 0
812
813ecs_api_a1_get_job_ids 200 type4 NOWNER job8
814
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100815if [ -z "$FLAT_A1_EI" ]; then
816 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
817else
818 ecs_api_a1_get_job_status 200 job8 ENABLED
819fi
820
821# Re-PUT the producer with zero types
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100822if [ $ECS_VERSION == "V1-1" ]; then
823 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
824else
825 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
826fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200827
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100828if [ -z "$FLAT_A1_EI" ]; then
829 ecs_api_a1_get_job_ids 404 type4 NOWNER
830else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100831 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
832 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100833fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200834
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100835if [ -z "$FLAT_A1_EI" ]; then
836 ecs_api_a1_get_job_status 200 type4 job8 DISABLED
837else
838 ecs_api_a1_get_job_status 200 job8 DISABLED
839fi
840
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200841if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
842 cr_equal received_callbacks 8 30
843 cr_equal received_callbacks?id=type-status1 5
844 cr_equal received_callbacks?id=job8-status 1
845 cr_api_check_all_ecs_events 200 job8-status DISABLED
846else
847 cr_equal received_callbacks 3 30
848 cr_equal received_callbacks?id=job8-status 1
849 cr_api_check_all_ecs_events 200 job8-status DISABLED
850fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100851
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200852prodstub_equal create/prod-d/job8 1
853prodstub_equal delete/prod-d/job8 0
854
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100855## Re-setup prod-d
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100856if [ $ECS_VERSION == "V1-1" ]; then
857 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
858else
859 ecs_api_edp_put_type_2 200 type4 testdata/ecs/ei-type-4.json
860 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
861fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100862
863if [ -z "$FLAT_A1_EI" ]; then
864 ecs_api_a1_get_job_ids 404 type4 NOWNER
865else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100866 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
867 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100868fi
869
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100870if [ -z "$FLAT_A1_EI" ]; then
871 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
872else
873 ecs_api_a1_get_job_status 200 job8 ENABLED
874fi
875
876ecs_api_edp_get_producer_status 200 prod-a ENABLED
877ecs_api_edp_get_producer_status 200 prod-b ENABLED
878ecs_api_edp_get_producer_status 200 prod-c ENABLED
879ecs_api_edp_get_producer_status 200 prod-d ENABLED
880
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200881if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
882 cr_equal received_callbacks 10 30
883 cr_equal received_callbacks?id=type-status1 6
884 cr_api_check_all_ecs_subscription_events 200 type-status1 type4 testdata/ecs/ei-type-4.json REGISTERED
885
886 cr_equal received_callbacks?id=job8-status 2
887 cr_api_check_all_ecs_events 200 job8-status ENABLED
888else
889 cr_equal received_callbacks 4 30
890 cr_equal received_callbacks?id=job8-status 2
891 cr_api_check_all_ecs_events 200 job8-status ENABLED
892fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100893
894prodstub_equal create/prod-d/job8 2
895prodstub_equal delete/prod-d/job8 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100896
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100897## Setup prod-e
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100898if [ $ECS_VERSION == "V1-1" ]; then
899 ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
900else
901 ecs_api_edp_put_type_2 201 type6 testdata/ecs/ei-type-6.json
902 ecs_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6
903fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100904
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200905if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
906 cr_equal received_callbacks 11 30
907 cr_equal received_callbacks?id=type-status1 7
908 cr_api_check_all_ecs_subscription_events 200 type-status1 type6 testdata/ecs/ei-type-6.json REGISTERED
909fi
910
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100911ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY
912
913if [ -z "$FLAT_A1_EI" ]; then
914 ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
915else
916 ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json
917fi
918
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100919if [ $ECS_VERSION == "V1-1" ]; then
920 prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
921else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200922 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
923 prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
924 else
925 prodstub_check_jobdata_3 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
926 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100927fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100928
929prodstub_equal create/prod-e/job10 1
930prodstub_equal delete/prod-e/job10 0
931
932ecs_api_a1_get_job_ids 200 type6 NOWNER job10
933
934if [ -z "$FLAT_A1_EI" ]; then
935 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
936else
937 ecs_api_a1_get_job_status 200 job10 ENABLED
938fi
939
940## Setup prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100941if [ $ECS_VERSION == "V1-1" ]; then
942 ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
943else
944 ecs_api_edp_put_type_2 200 type6 testdata/ecs/ei-type-6.json
945 ecs_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6
946fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100947
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200948if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
949 cr_equal received_callbacks 12 30
950 cr_equal received_callbacks?id=type-status1 8
951 cr_api_check_all_ecs_subscription_events 200 type-status1 type6 testdata/ecs/ei-type-6.json REGISTERED
952fi
953
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100954ecs_api_a1_get_job_ids 200 type6 NOWNER job10
955
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100956if [ $ECS_VERSION == "V1-1" ]; then
957 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
958else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200959 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
960 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
961 else
962 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
963 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100964fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100965
966prodstub_equal create/prod-f/job10 1
967prodstub_equal delete/prod-f/job10 0
968
969ecs_api_a1_get_job_ids 200 type6 NOWNER job10
970
971if [ -z "$FLAT_A1_EI" ]; then
972 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
973else
974 ecs_api_a1_get_job_status 200 job10 ENABLED
975fi
976
977## Status updates prod-a and jobs
978
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100979if [ $ECS_VERSION == "V1-1" ]; then
980 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
981else
982 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
983fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100984
985ecs_api_edp_get_producer_status 200 prod-a ENABLED
986ecs_api_edp_get_producer_status 200 prod-b ENABLED
987ecs_api_edp_get_producer_status 200 prod-c ENABLED
988ecs_api_edp_get_producer_status 200 prod-d ENABLED
989ecs_api_edp_get_producer_status 200 prod-e ENABLED
990ecs_api_edp_get_producer_status 200 prod-f ENABLED
991
992# Arm producer prod-a for supervision failure
993prodstub_arm_producer 200 prod-a 400
994
995# Wait for producer prod-a to go disabled
996ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
997
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100998if [ $ECS_VERSION == "V1-1" ]; then
999 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
1000else
1001 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
1002fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001003
1004ecs_api_edp_get_producer_status 200 prod-a DISABLED
1005ecs_api_edp_get_producer_status 200 prod-b ENABLED
1006ecs_api_edp_get_producer_status 200 prod-c ENABLED
1007ecs_api_edp_get_producer_status 200 prod-d ENABLED
1008ecs_api_edp_get_producer_status 200 prod-e ENABLED
1009ecs_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +01001010
1011
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001012if [ -z "$FLAT_A1_EI" ]; then
1013 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
1014 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
1015 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1016 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1017 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1018else
1019 ecs_api_a1_get_job_status 200 job1 ENABLED
1020 ecs_api_a1_get_job_status 200 job2 ENABLED
1021 ecs_api_a1_get_job_status 200 job3 ENABLED
1022 ecs_api_a1_get_job_status 200 job8 ENABLED
1023 ecs_api_a1_get_job_status 200 job10 ENABLED
1024fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +01001025
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001026# Arm producer prod-a for supervision
1027prodstub_arm_producer 200 prod-a 200
1028
1029# Wait for producer prod-a to go enabled
1030ecs_api_edp_get_producer_status 200 prod-a ENABLED 360
1031
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001032if [ $ECS_VERSION == "V1-1" ]; then
1033 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
1034else
1035 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
1036fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001037
1038ecs_api_edp_get_producer_status 200 prod-a ENABLED
1039ecs_api_edp_get_producer_status 200 prod-b ENABLED
1040ecs_api_edp_get_producer_status 200 prod-c ENABLED
1041ecs_api_edp_get_producer_status 200 prod-d ENABLED
1042ecs_api_edp_get_producer_status 200 prod-e ENABLED
1043ecs_api_edp_get_producer_status 200 prod-f ENABLED
1044
1045if [ -z "$FLAT_A1_EI" ]; then
1046 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
1047 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
1048 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1049 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1050 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1051else
1052 ecs_api_a1_get_job_status 200 job1 ENABLED
1053 ecs_api_a1_get_job_status 200 job2 ENABLED
1054 ecs_api_a1_get_job_status 200 job3 ENABLED
1055 ecs_api_a1_get_job_status 200 job8 ENABLED
1056 ecs_api_a1_get_job_status 200 job10 ENABLED
1057fi
1058
1059# Arm producer prod-a for supervision failure
1060prodstub_arm_producer 200 prod-a 400
1061
1062# Wait for producer prod-a to go disabled
1063ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
1064
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001065if [ $ECS_VERSION == "V1-1" ]; then
1066 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
1067else
1068 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
1069fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001070
1071ecs_api_edp_get_producer_status 200 prod-a DISABLED
1072ecs_api_edp_get_producer_status 200 prod-b ENABLED
1073ecs_api_edp_get_producer_status 200 prod-c ENABLED
1074ecs_api_edp_get_producer_status 200 prod-d ENABLED
1075ecs_api_edp_get_producer_status 200 prod-e ENABLED
1076ecs_api_edp_get_producer_status 200 prod-f ENABLED
1077
1078if [ -z "$FLAT_A1_EI" ]; then
1079 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
1080 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
1081 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1082 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1083 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1084else
1085 ecs_api_a1_get_job_status 200 job1 ENABLED
1086 ecs_api_a1_get_job_status 200 job2 ENABLED
1087 ecs_api_a1_get_job_status 200 job3 ENABLED
1088 ecs_api_a1_get_job_status 200 job8 ENABLED
1089 ecs_api_a1_get_job_status 200 job10 ENABLED
1090fi
1091
1092# Wait for producer prod-a to be removed
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001093if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1094 ecs_equal json:data-producer/v1/info-producers 5 1000
1095else
1096 ecs_equal json:ei-producer/v1/eiproducers 5 1000
1097fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001098
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001099if [ $ECS_VERSION == "V1-1" ]; then
1100 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
1101else
1102 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
1103fi
1104
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001105
1106ecs_api_edp_get_producer_status 404 prod-a
1107ecs_api_edp_get_producer_status 200 prod-b ENABLED
1108ecs_api_edp_get_producer_status 200 prod-c ENABLED
1109ecs_api_edp_get_producer_status 200 prod-d ENABLED
1110ecs_api_edp_get_producer_status 200 prod-e ENABLED
1111ecs_api_edp_get_producer_status 200 prod-f ENABLED
1112
1113if [ -z "$FLAT_A1_EI" ]; then
1114 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1115 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1116 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1117 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1118 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1119else
1120 ecs_api_a1_get_job_status 200 job1 DISABLED
1121 ecs_api_a1_get_job_status 200 job2 DISABLED
1122 ecs_api_a1_get_job_status 200 job3 ENABLED
1123 ecs_api_a1_get_job_status 200 job8 ENABLED
1124 ecs_api_a1_get_job_status 200 job10 ENABLED
1125fi
1126
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001127if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1128 cr_equal received_callbacks 14 30
1129else
1130 cr_equal received_callbacks 6 30
1131fi
1132
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001133cr_equal received_callbacks?id=job1-status 1
1134cr_equal received_callbacks?id=job2-status 1
1135
1136cr_api_check_all_ecs_events 200 job1-status DISABLED
1137cr_api_check_all_ecs_events 200 job2-status DISABLED
1138
1139
1140# Arm producer prod-e for supervision failure
1141prodstub_arm_producer 200 prod-e 400
1142
1143ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000
1144
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001145if [ $ECS_VERSION == "V1-1" ]; then
1146 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
1147else
1148 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
1149fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001150
1151ecs_api_edp_get_producer_status 404 prod-a
1152ecs_api_edp_get_producer_status 200 prod-b ENABLED
1153ecs_api_edp_get_producer_status 200 prod-c ENABLED
1154ecs_api_edp_get_producer_status 200 prod-d ENABLED
1155ecs_api_edp_get_producer_status 200 prod-e DISABLED
1156ecs_api_edp_get_producer_status 200 prod-f ENABLED
1157
1158if [ -z "$FLAT_A1_EI" ]; then
1159 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1160 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1161 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1162 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1163 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1164else
1165 ecs_api_a1_get_job_status 200 job1 DISABLED
1166 ecs_api_a1_get_job_status 200 job2 DISABLED
1167 ecs_api_a1_get_job_status 200 job3 ENABLED
1168 ecs_api_a1_get_job_status 200 job8 ENABLED
1169 ecs_api_a1_get_job_status 200 job10 ENABLED
1170fi
1171
1172#Disable create for job10 in prod-e
1173prodstub_arm_job_create 200 prod-e job10 400
1174
1175#Update tjob 10 - only prod-f will be updated
1176if [ -z "$FLAT_A1_EI" ]; then
1177 ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1178else
1179 ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json
1180fi
1181#Reset producer and job responses
1182prodstub_arm_producer 200 prod-e 200
1183prodstub_arm_job_create 200 prod-e job10 200
1184
1185ecs_api_edp_get_producer_status 200 prod-e ENABLED 360
1186
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001187if [ $ECS_VERSION == "V1-1" ]; then
1188 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
1189else
1190 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
1191fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001192
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001193#Wait for job to be updated
1194sleep_wait 120
1195
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001196if [ $ECS_VERSION == "V1-1" ]; then
1197 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1198else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001199 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
1200 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1201 else
1202 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1203 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001204fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001205
1206prodstub_arm_producer 200 prod-f 400
1207
1208ecs_api_edp_get_producer_status 200 prod-f DISABLED 360
1209
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001210if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1211 ecs_equal json:data-producer/v1/info-producers 4 1000
1212else
1213 ecs_equal json:ei-producer/v1/eiproducers 4 1000
1214fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001215
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001216if [ $ECS_VERSION == "V1-1" ]; then
1217 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
1218else
1219 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1220fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001221
1222ecs_api_edp_get_producer_status 404 prod-a
1223ecs_api_edp_get_producer_status 200 prod-b ENABLED
1224ecs_api_edp_get_producer_status 200 prod-c ENABLED
1225ecs_api_edp_get_producer_status 200 prod-d ENABLED
1226ecs_api_edp_get_producer_status 200 prod-e ENABLED
1227ecs_api_edp_get_producer_status 404 prod-f
1228
1229if [ -z "$FLAT_A1_EI" ]; then
1230 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1231 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1232 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1233 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1234 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1235else
1236 ecs_api_a1_get_job_status 200 job1 DISABLED
1237 ecs_api_a1_get_job_status 200 job2 DISABLED
1238 ecs_api_a1_get_job_status 200 job3 ENABLED
1239 ecs_api_a1_get_job_status 200 job8 ENABLED
1240 ecs_api_a1_get_job_status 200 job10 ENABLED
1241fi
1242
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001243if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1244 cr_equal received_callbacks 14 30
1245else
1246 cr_equal received_callbacks 6 30
1247fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +02001248
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001249
1250if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
1251
1252 # End test if info types is not impl in tested version
1253 check_ecs_logs
1254
1255 store_logs END
1256
1257 #### TEST COMPLETE ####
1258
1259 print_result
1260
1261 auto_clean_environment
1262fi
1263
1264
1265############################################
1266# Test of info types
1267############################################
1268
1269### Setup prodstub sim to accept calls for producers, info types and jobs
1270## prod-ia type101
1271## prod-ib type101 and type102
1272## prod-ic no-type
1273## prod-id type104
1274## prod-ie type106
1275## prod-if type106
1276## prod-ig type150 (configured later)
1277## prod-ig type160 (configured later)
1278
1279## job101 -> prod-ia
1280## job102 -> prod-ia
1281## job103 -> prod-ib
1282## job104 -> prod-ia
1283## job106 -> prod-ib
1284## job108 -> prod-id
1285## job110 -> prod-ie and prod-if
1286## job150 -> prod-ig (configured later)
1287
1288prodstub_arm_producer 200 prod-ia
1289prodstub_arm_producer 200 prod-ib
1290prodstub_arm_producer 200 prod-ic
1291prodstub_arm_producer 200 prod-id
1292prodstub_arm_producer 200 prod-ie
1293prodstub_arm_producer 200 prod-if
1294
1295prodstub_arm_type 200 prod-ia type101
1296prodstub_arm_type 200 prod-ib type102
1297prodstub_arm_type 200 prod-ib type103
1298prodstub_arm_type 200 prod-id type104
1299prodstub_arm_type 200 prod-ie type106
1300prodstub_arm_type 200 prod-if type106
1301
1302prodstub_disarm_type 200 prod-ib type103
1303prodstub_arm_type 200 prod-ib type101
1304prodstub_disarm_type 200 prod-ib type101
1305
1306
1307prodstub_arm_job_create 200 prod-ia job101
1308prodstub_arm_job_create 200 prod-ia job102
1309prodstub_arm_job_create 200 prod-ib job103
1310
1311prodstub_arm_job_delete 200 prod-ia job101
1312prodstub_arm_job_delete 200 prod-ia job102
1313prodstub_arm_job_delete 200 prod-ib job103
1314
1315prodstub_arm_job_create 200 prod-ib job104
1316prodstub_arm_job_create 200 prod-ia job104
1317
1318prodstub_arm_job_create 200 prod-ib job106
1319
1320prodstub_arm_job_create 200 prod-id job108
1321
1322prodstub_arm_job_create 200 prod-ie job110
1323prodstub_arm_job_create 200 prod-if job110
1324
1325
1326# NOTE: types, jobs and producers are still present related to eitypes
1327
1328
1329### Initial tests - no config made
1330### GET: type ids, types, producer ids, producers, job ids, jobs
1331### DELETE: jobs
1332ecs_api_idc_get_type_ids 200 type1 type2 type4 type6
1333ecs_api_idc_get_type 404 test-type
1334
1335ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1336ecs_api_edp_get_type_2 404 test-type
1337
1338ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1339ecs_api_edp_get_producer_2 404 test-prod
1340ecs_api_edp_get_producer_status 404 test-prod
1341
1342ecs_api_edp_delete_producer 404 test-prod
1343
1344ecs_api_idc_get_job_ids 200 test-type NOWNER EMPTY
1345ecs_api_idc_get_job_ids 200 test-type test-owner EMPTY
1346
1347ecs_api_idc_get_job 404 test-job
1348
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001349ecs_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001350
1351ecs_api_idc_delete_job 404 test-job
1352
1353ecs_api_edp_get_producer_jobs_2 404 test-prod
1354
1355ecs_api_edp_get_type_2 404 test-type
1356ecs_api_edp_delete_type_2 404 test-type
1357
1358### Setup of producer/job and testing apis ###
1359
1360## Setup prod-ia
1361ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1362ecs_api_edp_get_type_2 404 type101
1363ecs_api_edp_put_producer_2 404 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1364
1365# Create type, delete and create again
1366ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
1367ecs_api_edp_get_type_2 200 type101
1368ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1369ecs_api_edp_delete_type_2 204 type101
1370ecs_api_edp_get_type_2 404 type101
1371ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1372ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
1373ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1374ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1375
1376ecs_api_edp_put_producer_2 201 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1377ecs_api_edp_put_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1378
1379ecs_api_edp_delete_type_2 406 type101
1380
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001381if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1382 cr_equal received_callbacks 17 30
1383 cr_equal received_callbacks?id=type-status1 11
1384 cr_api_check_all_ecs_subscription_events 200 type-status1 type101 testdata/ecs/info-type-1.json REGISTERED type101 testdata/ecs/info-type-1.json DEREGISTERED type101 testdata/ecs/info-type-1.json REGISTERED
1385else
1386 cr_equal received_callbacks 6
1387fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001388
1389ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1390ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1391
1392ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-b prod-c prod-d prod-e
1393ecs_api_edp_get_producer_ids_2 200 type101 prod-ia
1394ecs_api_edp_get_producer_ids_2 200 type102 EMPTY
1395
1396ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1397
1398ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1399
1400ecs_api_idc_get_job_ids 200 type101 NOWNER EMPTY
1401ecs_api_idc_get_job_ids 200 type101 test-owner EMPTY
1402
1403ecs_api_idc_get_job 404 test-job
1404
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001405ecs_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001406ecs_api_edp_get_producer_jobs_2 200 prod-ia EMPTY
1407
1408## Create a job for prod-ia
1409## job101 - prod-ia
1410ecs_api_idc_put_job 201 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ecs/job-template.json VALIDATE
1411
1412# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001413prodstub_check_jobdata_3 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001414
1415ecs_api_idc_get_job_ids 200 type101 NOWNER job101
1416ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1417
1418ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job1 job2 job3 job8 job10
1419
1420ecs_api_idc_get_job 200 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ecs/job-template.json
1421
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001422ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001423
1424prodstub_equal create/prod-ia/job101 1
1425
1426ecs_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json
1427
1428## Create a second job for prod-ia
1429## job102 - prod-ia
1430ecs_api_idc_put_job 201 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ecs/job-template.json VALIDATE
1431
1432# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001433prodstub_check_jobdata_3 200 prod-ia job102 type101 $TARGET102 info-owner-2 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001434ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1435ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1436ecs_api_idc_get_job_ids 200 type101 info-owner-2 job102
1437ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1438
1439ecs_api_idc_get_job 200 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ecs/job-template.json
1440
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001441ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001442
1443prodstub_equal create/prod-ia/job102 1
1444
1445ecs_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json job102 type101 $TARGET102 info-owner-2 testdata/ecs/job-template.json
1446
1447
1448## Setup prod-ib
1449ecs_api_edp_put_type_2 201 type102 testdata/ecs/info-type-2.json
1450ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1451
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001452if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1453 cr_equal received_callbacks 18 30
1454 cr_equal received_callbacks?id=type-status1 12
1455 cr_api_check_all_ecs_subscription_events 200 type-status1 type102 testdata/ecs/info-type-2.json REGISTERED
1456else
1457 cr_equal received_callbacks 6
1458fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001459
1460ecs_api_idc_get_type_ids 200 type101 type102 type1 type2 type4 type6
1461
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001462if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1463 ecs_api_idc_get_type 200 type101 testdata/ecs/info-type-1.json ENABLED 1
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001464
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001465 ecs_api_idc_get_type 200 type102 testdata/ecs/info-type-2.json ENABLED 1
1466else
1467 ecs_api_idc_get_type 200 type101 testdata/ecs/info-type-1.json
1468
1469 ecs_api_idc_get_type 200 type102 testdata/ecs/info-type-2.json
1470fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001471
1472ecs_api_edp_get_type_ids 200 type101 type102 type1 type2 type4 type6
1473ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1474ecs_api_edp_get_type_2 200 type102 testdata/ecs/info-type-2.json
1475
1476ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-b prod-c prod-d prod-e
1477
1478ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1479ecs_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1480
1481ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1482
1483## Create job for prod-ib
1484## job103 - prod-ib
1485ecs_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json VALIDATE
1486
1487prodstub_equal create/prod-ib/job103 1
1488
1489# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001490prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001491
1492ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1493ecs_api_idc_get_job_ids 200 type102 NOWNER job103
1494ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1495ecs_api_idc_get_job_ids 200 type101 info-owner-2 job102
1496ecs_api_idc_get_job_ids 200 type102 info-owner-3 job103
1497
1498ecs_api_idc_get_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json
1499
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001500ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001501
1502ecs_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json job102 type101 $TARGET102 info-owner-2 testdata/ecs/job-template.json
1503ecs_api_edp_get_producer_jobs_2 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json
1504
1505## Setup prod-ic (no types)
1506ecs_api_edp_put_producer_2 201 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic NOTYPE
1507
1508ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1509
1510ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1511ecs_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1512ecs_api_edp_get_producer_2 200 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic EMPTY
1513
1514ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1515
1516
1517## Delete job103 and prod-ib and re-create if different order
1518
1519# Delete job then producer
1520ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1521ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1522
1523ecs_api_idc_delete_job 204 job103
1524
1525ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1526ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1527
1528ecs_api_edp_delete_producer 204 prod-ib
1529
1530ecs_api_edp_get_producer_status 404 prod-ib
1531
1532ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1533ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
1534
1535prodstub_equal delete/prod-ib/job103 1
1536
1537ecs_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001538ecs_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001539
1540# Put producer then job
1541ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1542
1543ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1544
1545ecs_api_idc_put_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template2.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001546ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001547
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001548prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001549
1550ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1551ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1552
1553prodstub_equal create/prod-ib/job103 3
1554prodstub_equal delete/prod-ib/job103 1
1555
1556# Delete only the producer
1557ecs_api_edp_delete_producer 204 prod-ib
1558
1559ecs_api_edp_get_producer_status 404 prod-ib
1560
1561ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1562ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
1563
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001564ecs_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001565
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001566if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1567 cr_equal received_callbacks 19 30
1568
1569 cr_equal received_callbacks?id=info-job103-status 1
1570 cr_api_check_all_ecs_events 200 info-job103-status DISABLED
1571else
1572 cr_equal received_callbacks 7 30
1573 cr_equal received_callbacks?id=info-job103-status 1
1574 cr_api_check_all_ecs_events 200 info-job103-status DISABLED
1575fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001576
1577# Re-create the producer
1578ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1579
1580ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1581
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001582ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001583
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001584if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1585 cr_equal received_callbacks 20 30
1586 cr_equal received_callbacks?id=info-job103-status 2
1587 cr_api_check_all_ecs_events 200 info-job103-status ENABLED
1588else
1589 cr_equal received_callbacks 8 30
1590 cr_equal received_callbacks?id=info-job103-status 2
1591 cr_api_check_all_ecs_events 200 info-job103-status ENABLED
1592fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001593
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001594prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001595
1596## Setup prod-id
1597ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json
1598ecs_api_edp_put_producer_2 201 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
1599
1600ecs_api_idc_get_job_ids 200 type104 NOWNER EMPTY
1601
1602ecs_api_idc_put_job 201 job108 type104 $TARGET108 info-owner-4 $INFOSTATUS108 testdata/ecs/job-template.json VALIDATE
1603
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001604prodstub_check_jobdata_3 200 prod-id job108 type104 $TARGET108 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001605
1606prodstub_equal create/prod-id/job108 1
1607prodstub_equal delete/prod-id/job108 0
1608
1609ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1610
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001611ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001612
1613# Re-PUT the producer with zero types
1614ecs_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id NOTYPE
1615
1616ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1617ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
1618
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001619ecs_api_idc_get_job_status2 200 job108 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001620
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001621if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1622 cr_equal received_callbacks 22 30
1623 cr_equal received_callbacks?id=type-status1 13
1624 cr_api_check_all_ecs_subscription_events 200 type-status1 type104 testdata/ecs/info-type-4.json REGISTERED
1625
1626 cr_equal received_callbacks?id=info-job108-status 1
1627 cr_api_check_all_ecs_events 200 info-job108-status DISABLED
1628else
1629 cr_equal received_callbacks 9 30
1630 cr_equal received_callbacks?id=info-job108-status 1
1631 cr_api_check_all_ecs_events 200 info-job108-status DISABLED
1632fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001633
1634prodstub_equal create/prod-id/job108 1
1635prodstub_equal delete/prod-id/job108 0
1636
1637## Re-setup prod-id
1638ecs_api_edp_put_type_2 200 type104 testdata/ecs/info-type-4.json
1639ecs_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
1640
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001641
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001642ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1643ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
1644
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001645ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001646
1647ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1648ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1649ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1650ecs_api_edp_get_producer_status 200 prod-id ENABLED
1651
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001652if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1653 cr_equal received_callbacks 24 30
1654
1655 cr_equal received_callbacks?id=type-status1 14
1656 cr_api_check_all_ecs_subscription_events 200 type-status1 type104 testdata/ecs/info-type-4.json REGISTERED
1657
1658 cr_equal received_callbacks?id=info-job108-status 2
1659 cr_api_check_all_ecs_events 200 info-job108-status ENABLED
1660else
1661 cr_equal received_callbacks 10 30
1662 cr_equal received_callbacks?id=info-job108-status 2
1663 cr_api_check_all_ecs_events 200 info-job108-status ENABLED
1664fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001665
1666prodstub_equal create/prod-id/job108 2
1667prodstub_equal delete/prod-id/job108 0
1668
1669
1670## Setup prod-ie
1671ecs_api_edp_put_type_2 201 type106 testdata/ecs/info-type-6.json
1672ecs_api_edp_put_producer_2 201 prod-ie $CB_JOB/prod-ie $CB_SV/prod-ie type106
1673
1674ecs_api_idc_get_job_ids 200 type106 NOWNER EMPTY
1675
1676ecs_api_idc_put_job 201 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ecs/job-template.json VALIDATE
1677
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001678prodstub_check_jobdata_3 200 prod-ie job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001679
1680prodstub_equal create/prod-ie/job110 1
1681prodstub_equal delete/prod-ie/job110 0
1682
1683ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1684
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001685ecs_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001686
1687## Setup prod-if
1688ecs_api_edp_put_type_2 200 type106 testdata/ecs/info-type-6.json
1689ecs_api_edp_put_producer_2 201 prod-if $CB_JOB/prod-if $CB_SV/prod-if type106
1690
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001691if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1692 cr_equal received_callbacks 26 30
1693
1694 cr_equal received_callbacks?id=type-status1 16
1695 cr_api_check_all_ecs_subscription_events 200 type-status1 type106 testdata/ecs/info-type-6.json REGISTERED type106 testdata/ecs/info-type-6.json REGISTERED
1696fi
1697
1698
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001699ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1700
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001701prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001702
1703prodstub_equal create/prod-if/job110 1
1704prodstub_equal delete/prod-if/job110 0
1705
1706ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1707
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001708ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001709
1710## Status updates prod-ia and jobs
1711
1712ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
1713
1714ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1715ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1716ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1717ecs_api_edp_get_producer_status 200 prod-id ENABLED
1718ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1719ecs_api_edp_get_producer_status 200 prod-if ENABLED
1720
1721# Arm producer prod-ia for supervision failure
1722prodstub_arm_producer 200 prod-ia 400
1723
1724# Wait for producer prod-ia to go disabled
1725ecs_api_edp_get_producer_status 200 prod-ia DISABLED 360
1726
1727ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
1728
1729ecs_api_edp_get_producer_status 200 prod-ia DISABLED
1730ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1731ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1732ecs_api_edp_get_producer_status 200 prod-id ENABLED
1733ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1734ecs_api_edp_get_producer_status 200 prod-if ENABLED
1735
1736
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001737ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1738ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1739ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1740ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1741ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001742
1743# Arm producer prod-ia for supervision
1744prodstub_arm_producer 200 prod-ia 200
1745
1746# Wait for producer prod-ia to go enabled
1747ecs_api_edp_get_producer_status 200 prod-ia ENABLED 360
1748
1749ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
1750
1751ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1752ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1753ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1754ecs_api_edp_get_producer_status 200 prod-id ENABLED
1755ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1756ecs_api_edp_get_producer_status 200 prod-if ENABLED
1757
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001758ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1759ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1760ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1761ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1762ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001763
1764# Arm producer prod-ia for supervision failure
1765prodstub_arm_producer 200 prod-ia 400
1766
1767# Wait for producer prod-ia to go disabled
1768ecs_api_edp_get_producer_status 200 prod-ia DISABLED 360
1769
1770ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
1771
1772ecs_api_edp_get_producer_status 200 prod-ia DISABLED
1773ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1774ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1775ecs_api_edp_get_producer_status 200 prod-id ENABLED
1776ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1777ecs_api_edp_get_producer_status 200 prod-if ENABLED
1778
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001779ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1780ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1781ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1782ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1783ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001784
1785# Wait for producer prod-ia to be removed
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001786if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1787 ecs_equal json:data-producer/v1/info-producers 9 1000
1788else
1789 ecs_equal json:ei-producer/v1/eiproducers 9 1000
1790fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001791
1792ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
1793
1794
1795ecs_api_edp_get_producer_status 404 prod-ia
1796ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1797ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1798ecs_api_edp_get_producer_status 200 prod-id ENABLED
1799ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1800ecs_api_edp_get_producer_status 200 prod-if ENABLED
1801
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001802ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1803ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1804ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1805ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1806ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001807
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001808
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001809if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1810 cr_equal received_callbacks 28 30
1811
1812 cr_equal received_callbacks?id=info-job101-status 1
1813 cr_equal received_callbacks?id=info-job102-status 1
1814 cr_api_check_all_ecs_events 200 info-job101-status DISABLED
1815 cr_api_check_all_ecs_events 200 info-job102-status DISABLED
1816else
1817 cr_equal received_callbacks 12 30
1818
1819 cr_equal received_callbacks?id=info-job101-status 1
1820 cr_equal received_callbacks?id=info-job102-status 1
1821 cr_api_check_all_ecs_events 200 info-job101-status DISABLED
1822 cr_api_check_all_ecs_events 200 info-job102-status DISABLED
1823fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001824
1825
1826# Arm producer prod-ie for supervision failure
1827prodstub_arm_producer 200 prod-ie 400
1828
1829ecs_api_edp_get_producer_status 200 prod-ie DISABLED 1000
1830
1831ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
1832
1833ecs_api_edp_get_producer_status 404 prod-ia
1834ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1835ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1836ecs_api_edp_get_producer_status 200 prod-id ENABLED
1837ecs_api_edp_get_producer_status 200 prod-ie DISABLED
1838ecs_api_edp_get_producer_status 200 prod-if ENABLED
1839
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001840ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1841ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1842ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1843ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1844ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001845
1846#Disable create for job110 in prod-ie
1847prodstub_arm_job_create 200 prod-ie job110 400
1848
1849#Update tjob 10 - only prod-if will be updated
1850ecs_api_idc_put_job 200 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ecs/job-template2.json VALIDATE
1851#Reset producer and job responses
1852prodstub_arm_producer 200 prod-ie 200
1853prodstub_arm_job_create 200 prod-ie job110 200
1854
1855ecs_api_edp_get_producer_status 200 prod-ie ENABLED 360
1856
1857ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
1858
1859#Wait for job to be updated
1860sleep_wait 120
1861
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001862prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001863
1864prodstub_arm_producer 200 prod-if 400
1865
1866ecs_api_edp_get_producer_status 200 prod-if DISABLED 360
1867
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001868if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1869 ecs_equal json:data-producer/v1/info-producers 8 1000
1870else
1871 ecs_equal json:ei-producer/v1/eiproducers 8 1000
1872fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001873
1874ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-b prod-c prod-d prod-e
1875
1876ecs_api_edp_get_producer_status 404 prod-ia
1877ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1878ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1879ecs_api_edp_get_producer_status 200 prod-id ENABLED
1880ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1881ecs_api_edp_get_producer_status 404 prod-if
1882
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001883ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1884ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1885ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1886ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1887ecs_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001888
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001889if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1890 cr_equal received_callbacks 28
1891else
1892 cr_equal received_callbacks 12
1893fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001894### Test of pre and post validation
1895
1896ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
1897ecs_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1898ecs_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ecs/job-template.json
1899
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001900ecs_api_idc_get_job_status2 404 job150
1901ecs_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001902
1903prodstub_arm_producer 200 prod-ig
1904prodstub_arm_job_create 200 prod-ig job150
1905prodstub_arm_job_create 200 prod-ig job160
1906
1907ecs_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
1908ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1909
1910ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
1911
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001912ecs_api_idc_get_job_status2 404 job150
1913ecs_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001914
1915prodstub_arm_type 200 prod-ig type160
1916
1917ecs_api_edp_put_type_2 201 type160 testdata/ecs/info-type-60.json
1918ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160
1919
1920ecs_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1921ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1922ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1923
1924ecs_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1925
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001926ecs_api_idc_get_job_status2 404 job150
1927ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001928
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001929prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001930
1931prodstub_equal create/prod-ig/job160 1
1932prodstub_equal delete/prod-ig/job160 0
1933
1934prodstub_arm_type 200 prod-ig type150
1935
1936ecs_api_edp_put_type_2 201 type150 testdata/ecs/info-type-50.json
1937ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160 type150
1938
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001939if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1940 cr_equal received_callbacks 30 30
1941 cr_equal received_callbacks?id=type-status1 18
1942 cr_api_check_all_ecs_subscription_events 200 type-status1 type160 testdata/ecs/info-type-60.json REGISTERED type150 testdata/ecs/info-type-50.json REGISTERED
1943else
1944 cr_equal received_callbacks 12
1945fi
1946
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001947ecs_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1948ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1949
1950ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1951
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001952ecs_api_idc_get_job_status2 404 job150
1953ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001954
1955ecs_api_idc_put_job 201 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1956
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001957ecs_api_idc_get_job_status2 200 job150 ENABLED 1 prod-ig 60
1958ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001959
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001960if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1961 cr_equal received_callbacks 30 30
1962 cr_equal received_callbacks?id=type-status1 18
1963else
1964 cr_equal received_callbacks 12
1965fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001966
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001967# Test job deletion at type delete
1968
1969if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1970
1971 ecs_api_edp_delete_type_2 406 type104
1972
1973 ecs_api_edp_delete_producer 204 prod-id
1974
1975 ecs_api_edp_delete_type_2 204 type104
1976
1977 cr_equal received_callbacks 32 30
1978 cr_equal received_callbacks?id=info-job108-status 3
1979 cr_equal received_callbacks?id=type-status1 19
1980 cr_api_check_all_ecs_subscription_events 200 type-status1 type104 testdata/ecs/info-type-4.json DEREGISTERED
1981 cr_api_check_all_ecs_events 200 info-job108-status DISABLED
1982
1983 ecs_api_edp_get_producer 404 prod-id
1984
1985 ecs_api_idc_get_job 404 job-108
1986
1987else
1988 cr_equal received_callbacks 12
1989fi
1990
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +02001991check_ecs_logs
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001992
1993store_logs END
1994
1995#### TEST COMPLETE ####
1996
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001997print_result
1998
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001999auto_clean_environment