blob: eb687e8e9956a72f341038f987cdcb6f420cf645 [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
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010024DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP HTTPPROXY NGW"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010025
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010026#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010027KUBE_INCLUDED_IMAGES="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
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010060if [ $RUNMODE == "KUBE" ]; then
61 start_kube_proxy
62fi
63
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010064use_ecs_rest_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020065
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010066use_prod_stub_https
67
68use_simulator_https
69
70use_cr_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020071
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010072start_http_proxy
BjornMagnussonXAc963b732021-01-20 14:24:13 +010073
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010074start_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 +010075
76if [ $RUNMODE == "KUBE" ]; then
77 ecs_api_admin_reset
78fi
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020079
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020080start_prod_stub
81
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +020082set_ecs_debug
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020083
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010084start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
85
86if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
87 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
88fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010089
90if [ "$PMS_VERSION" == "V2" ]; then
91 start_ric_simulators ricsim_g3 4 STD_2.0.0
92fi
93
94start_cr
95
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010096CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
97CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +020098#Targets for ei jobs
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010099TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
100TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
101TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
102TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
103TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
104
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200105#Targets for info jobs
106TARGET101="http://localhost:80/target" # Dummy target, no target for info data in this env...
107TARGET102="http://localhost:80/target" # Dummy target, no target for info data in this env...
108TARGET103="http://localhost:80/target" # Dummy target, no target for info data in this env...
109TARGET108="http://localhost:80/target" # Dummy target, no target for info data in this env...
110TARGET110="http://localhost:80/target" # Dummy target, no target for info data in this env...
111TARGET150="http://localhost:80/target" # Dummy target, no target for info data in this env...
112TARGET160="http://localhost:80/target" # Dummy target, no target for info data in this env...
113
114#Status callbacks for eijobs
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100115STATUS1="$CR_SERVICE_PATH/job1-status"
116STATUS2="$CR_SERVICE_PATH/job2-status"
117STATUS3="$CR_SERVICE_PATH/job3-status"
118STATUS8="$CR_SERVICE_PATH/job8-status"
119STATUS10="$CR_SERVICE_PATH/job10-status"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100120
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200121#Status callbacks for infojobs
122INFOSTATUS101="$CR_SERVICE_PATH/info-job101-status"
123INFOSTATUS102="$CR_SERVICE_PATH/info-job102-status"
124INFOSTATUS103="$CR_SERVICE_PATH/info-job103-status"
125INFOSTATUS108="$CR_SERVICE_PATH/info-job108-status"
126INFOSTATUS110="$CR_SERVICE_PATH/info-job110-status"
127INFOSTATUS150="$CR_SERVICE_PATH/info-job150-status"
128INFOSTATUS160="$CR_SERVICE_PATH/info-job160-status"
129
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200130if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
131 #Type registration status callbacks
132 TYPESTATUS1="$CR_SERVICE_PATH/type-status1"
133 TYPESTATUS2="$CR_SERVICE_PATH/type-status2"
134
135 ecs_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
136
137 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
138
139 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
140
141 ecs_api_idc_get_subscription_ids 200 test EMPTY
142
143 ecs_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
144
145 ecs_api_idc_get_subscription 404 test
146
147 ecs_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
148
149 ecs_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
150
151 ecs_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
152
153 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
154
155 ecs_api_idc_get_subscription_ids 200 owner1 subscription-id-1
156
157 ecs_api_idc_get_subscription_ids 200 owner2 subscription-id-2
158
159 ecs_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
160 ecs_api_idc_get_subscription 200 subscription-id-2 owner2 $TYPESTATUS2
161
162 ecs_api_idc_delete_subscription 204 subscription-id-2
163
164 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
165
166 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
167
168 cr_equal received_callbacks 1 30
169 cr_equal received_callbacks?id=type-status1 1
170 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json REGISTERED
171
172 ecs_api_edp_delete_type_2 204 type1
173
174 cr_equal received_callbacks 2 30
175 cr_equal received_callbacks?id=type-status1 2
176 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json DEREGISTERED
177
178 ecs_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
179 ecs_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
180
181 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
182
183 cr_equal received_callbacks 4 30
184 cr_equal received_callbacks?id=type-status1 3
185 cr_equal received_callbacks?id=type-status2 1
186 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json REGISTERED
187
188 ecs_api_idc_delete_subscription 204 subscription-id-2
189
190 ecs_api_edp_delete_type_2 204 type1
191
192 cr_equal received_callbacks 5 30
193 cr_equal received_callbacks?id=type-status1 4
194 cr_equal received_callbacks?id=type-status2 1
195 cr_api_check_all_ecs_subscription_events 200 type-status1 type1 testdata/ecs/ei-type-1.json DEREGISTERED
196
197 cr_api_reset
198fi
199
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100200### Setup prodstub sim to accept calls for producers, types and jobs
201## prod-a type1
202## prod-b type1 and type2
203## prod-c no-type
204## prod-d type4
205## prod-e type6
206## prod-f type6
207
208## job1 -> prod-a
209## job2 -> prod-a
210## job3 -> prod-b
211## job4 -> prod-a
212## job6 -> prod-b
213## job8 -> prod-d
214## job10 -> prod-e and prod-f
215
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200216prodstub_arm_producer 200 prod-a
217prodstub_arm_producer 200 prod-b
218prodstub_arm_producer 200 prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200219prodstub_arm_producer 200 prod-d
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100220prodstub_arm_producer 200 prod-e
221prodstub_arm_producer 200 prod-f
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200222
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200223prodstub_arm_type 200 prod-a type1
224prodstub_arm_type 200 prod-b type2
225prodstub_arm_type 200 prod-b type3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100226prodstub_arm_type 200 prod-d type4
227prodstub_arm_type 200 prod-e type6
228prodstub_arm_type 200 prod-f type6
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200229
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200230prodstub_disarm_type 200 prod-b type3
231prodstub_arm_type 200 prod-b type1
232prodstub_disarm_type 200 prod-b type1
233
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100234
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200235prodstub_arm_job_create 200 prod-a job1
236prodstub_arm_job_create 200 prod-a job2
237prodstub_arm_job_create 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200238
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200239prodstub_arm_job_delete 200 prod-a job1
240prodstub_arm_job_delete 200 prod-a job2
241prodstub_arm_job_delete 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200242
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200243prodstub_arm_job_create 200 prod-b job4
244prodstub_arm_job_create 200 prod-a job4
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200245
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200246prodstub_arm_job_create 200 prod-b job6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200247
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100248prodstub_arm_job_create 200 prod-d job8
249
250prodstub_arm_job_create 200 prod-e job10
251prodstub_arm_job_create 200 prod-f job10
252
253### ecs status
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200254ecs_api_service_status 200
255
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100256cr_equal received_callbacks 0
257
258### Initial tests - no config made
259### GET: type ids, types, producer ids, producers, job ids, jobs
260### DELETE: jobs
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200261ecs_api_a1_get_type_ids 200 EMPTY
262ecs_api_a1_get_type 404 test-type
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200263
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200264ecs_api_edp_get_type_ids 200 EMPTY
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100265if [ $ECS_VERSION == "V1-1" ]; then
266 ecs_api_edp_get_type 404 test-type
267else
268 ecs_api_edp_get_type_2 404 test-type
269fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200270
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100271if [ $ECS_VERSION == "V1-1" ]; then
272 ecs_api_edp_get_producer_ids 200 EMPTY
273 ecs_api_edp_get_producer 404 test-prod
274else
275 ecs_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
276 ecs_api_edp_get_producer_2 404 test-prod
277fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200278ecs_api_edp_get_producer_status 404 test-prod
279
280ecs_api_edp_delete_producer 404 test-prod
281
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100282if [ -z "$FLAT_A1_EI" ]; then
283 ecs_api_a1_get_job_ids 404 test-type NOWNER
284 ecs_api_a1_get_job_ids 404 test-type test-owner
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200285
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100286 ecs_api_a1_get_job 404 test-type test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200287
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100288 ecs_api_a1_get_job_status 404 test-type test-job
289else
290 ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY
291 ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200292
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100293 ecs_api_a1_get_job 404 test-job
294
295 ecs_api_a1_get_job_status 404 test-job
296fi
297
298if [ -z "$FLAT_A1_EI" ]; then
299 ecs_api_a1_delete_job 404 test-type test-job
300else
301 ecs_api_a1_delete_job 404 test-job
302fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200303
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100304if [ $ECS_VERSION == "V1-1" ]; then
305 ecs_api_edp_get_producer_jobs 404 test-prod
306else
307 ecs_api_edp_get_producer_jobs_2 404 test-prod
308fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200309
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100310if [ $ECS_VERSION == "V1-2" ]; then
311 ecs_api_edp_get_type_2 404 test-type
312 ecs_api_edp_delete_type_2 404 test-type
313fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200314
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100315### Setup of producer/job and testing apis ###
316
317## Setup prod-a
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100318if [ $ECS_VERSION == "V1-1" ]; then
319 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
320 ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
321else
322 #V1-2
323 ecs_api_edp_get_type_ids 200 EMPTY
324 ecs_api_edp_get_type_2 404 type1
325 ecs_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
326
327 # Create type, delete and create again
328 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
329 ecs_api_edp_get_type_2 200 type1
330 ecs_api_edp_get_type_ids 200 type1
331 ecs_api_edp_delete_type_2 204 type1
332 ecs_api_edp_get_type_2 404 type1
333 ecs_api_edp_get_type_ids 200 EMPTY
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200334 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
335 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
336 else
337 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
338 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100339 ecs_api_edp_get_type_ids 200 type1
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200340 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
341 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
342 else
343 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
344 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100345
346 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
347 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200348
349 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
350 cr_equal received_callbacks 3 30
351 cr_equal received_callbacks?id=type-status1 3
352 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
353 else
354 cr_equal received_callbacks 0
355 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100356fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100357
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200358
359ecs_api_a1_get_type_ids 200 type1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100360if [ -z "$FLAT_A1_EI" ]; then
361 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
362else
363 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
364fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200365
366ecs_api_edp_get_type_ids 200 type1
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100367if [ $ECS_VERSION == "V1-1" ]; then
368 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
369else
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200370 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
371 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
372 else
373 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
374 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100375fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200376
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100377if [ $ECS_VERSION == "V1-1" ]; then
378 ecs_api_edp_get_producer_ids 200 prod-a
379else
380 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a
381 ecs_api_edp_get_producer_ids_2 200 type1 prod-a
382 ecs_api_edp_get_producer_ids_2 200 type2 EMPTY
383fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100384
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100385if [ $ECS_VERSION == "V1-1" ]; then
386 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
387else
388 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
389fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200390
391ecs_api_edp_get_producer_status 200 prod-a ENABLED
392
393ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
394ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
395
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100396if [ -z "$FLAT_A1_EI" ]; then
397 ecs_api_a1_get_job 404 type1 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200398
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100399 ecs_api_a1_get_job_status 404 type1 test-job
400else
401 ecs_api_a1_get_job 404 test-job
402
403 ecs_api_a1_get_job_status 404 test-job
404fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100405if [ $ECS_VERSION == "V1-1" ]; then
406 ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
407else
408 ecs_api_edp_get_producer_jobs_2 200 prod-a EMPTY
409fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200410
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100411## Create a job for prod-a
412## job1 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100413if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100414 ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100415else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100416 ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100417fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200418
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100419# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100420if [ $ECS_VERSION == "V1-1" ]; then
421 prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
422else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200423 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
424 prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
425 else
426 prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
427 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100428fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200429
430ecs_api_a1_get_job_ids 200 type1 NOWNER job1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100431ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
432
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100433if [ ! -z "$FLAT_A1_EI" ]; then
434 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1
435fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200436
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100437if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100438 ecs_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200439
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100440 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
441else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100442 ecs_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100443
444 ecs_api_a1_get_job_status 200 job1 ENABLED
445fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200446
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100447prodstub_equal create/prod-a/job1 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200448
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100449if [ $ECS_VERSION == "V1-1" ]; then
450 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
451else
452 ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
453fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200454
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100455## Create a second job for prod-a
456## job2 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100457if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100458 ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100459else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100460 ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100461fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200462
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100463# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100464if [ $ECS_VERSION == "V1-1" ]; then
465 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
466else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200467 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
468 prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
469 else
470 prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
471 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100472fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200473ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100474ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
475ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100476if [ ! -z "$FLAT_A1_EI" ]; then
477 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
478fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200479
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100480if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100481 ecs_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200482
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100483 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
484else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100485 ecs_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100486
487 ecs_api_a1_get_job_status 200 job2 ENABLED
488fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200489
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100490prodstub_equal create/prod-a/job2 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200491
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100492if [ $ECS_VERSION == "V1-1" ]; then
493 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
494else
495 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
496fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200497
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100498## Setup prod-b
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100499if [ $ECS_VERSION == "V1-1" ]; then
500 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
501else
502 ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
503 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200504 if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
505 cr_equal received_callbacks 4 30
506 cr_equal received_callbacks?id=type-status1 4
507 cr_api_check_all_ecs_subscription_events 200 type-status1 type2 testdata/ecs/ei-type-2.json REGISTERED
508 else
509 cr_equal received_callbacks 0
510 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100511fi
512
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200513
514ecs_api_a1_get_type_ids 200 type1 type2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100515if [ -z "$FLAT_A1_EI" ]; then
516 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
517 ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
518else
519 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
520 ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json
521fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200522
523ecs_api_edp_get_type_ids 200 type1 type2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100524if [ $ECS_VERSION == "V1-1" ]; then
525 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
526 ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
527else
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200528 if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
529 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json testdata/ecs/info-type-info.json
530 else
531 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
532 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100533 ecs_api_edp_get_type_2 200 type2 testdata/ecs/ei-type-2.json
534fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200535
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100536if [ $ECS_VERSION == "V1-1" ]; then
537 ecs_api_edp_get_producer_ids 200 prod-a prod-b
538else
539 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b
540fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100541
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100542if [ $ECS_VERSION == "V1-1" ]; then
543 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
544 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
545else
546 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
547 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
548fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200549
550ecs_api_edp_get_producer_status 200 prod-b ENABLED
551
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100552## Create job for prod-b
553## job3 - prod-b
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100554if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100555 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100556else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100557 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100558fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200559
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100560prodstub_equal create/prod-b/job3 1
561
562# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100563if [ $ECS_VERSION == "V1-1" ]; then
564 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
565else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200566 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
567 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
568 else
569 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
570 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100571fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200572
573ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
574ecs_api_a1_get_job_ids 200 type2 NOWNER job3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100575ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
576ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
577ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200578
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100579if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100580 ecs_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200581
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100582 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
583else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100584 ecs_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100585
586 ecs_api_a1_get_job_status 200 job3 ENABLED
587fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200588
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100589if [ $ECS_VERSION == "V1-1" ]; then
590 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
591 ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
592else
593 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
594 ecs_api_edp_get_producer_jobs_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
595fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200596
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100597## Setup prod-c (no types)
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100598if [ $ECS_VERSION == "V1-1" ]; then
599 ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
600else
601 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
602fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100603
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100604if [ $ECS_VERSION == "V1-1" ]; then
605 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
606else
607 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
608fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200609
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100610if [ $ECS_VERSION == "V1-1" ]; then
611 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
612 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
613 ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
614else
615 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
616 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
617 ecs_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
618fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200619
620ecs_api_edp_get_producer_status 200 prod-c ENABLED
621
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100622
623## Delete job3 and prod-b and re-create if different order
624
625# Delete job then producer
626ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100627if [ $ECS_VERSION == "V1-1" ]; then
628 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
629else
630 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
631fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100632
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100633if [ -z "$FLAT_A1_EI" ]; then
634 ecs_api_a1_delete_job 204 type2 job3
635else
636 ecs_api_a1_delete_job 204 job3
637fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200638
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100639ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100640if [ $ECS_VERSION == "V1-1" ]; then
641 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
642else
643 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
644fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100645
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200646ecs_api_edp_delete_producer 204 prod-b
647
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100648ecs_api_edp_get_producer_status 404 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200649
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100650ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100651if [ $ECS_VERSION == "V1-1" ]; then
652 ecs_api_edp_get_producer_ids 200 prod-a prod-c
653else
654 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
655fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200656
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100657prodstub_equal delete/prod-b/job3 1
658
659if [ -z "$FLAT_A1_EI" ]; then
660 ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
661else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100662 if [ $ECS_VERSION == "V1-1" ]; then
663 ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
664 else
665 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
666 ecs_api_a1_get_job_status 200 job3 DISABLED
667 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100668fi
669
670# Put producer then job
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100671if [ $ECS_VERSION == "V1-1" ]; then
672 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
673else
674 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
675fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100676
677ecs_api_edp_get_producer_status 200 prod-b ENABLED
678
679if [ -z "$FLAT_A1_EI" ]; then
680 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
681 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
682else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100683 if [ $ECS_VERSION == "V1-1" ]; then
684 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
685 else
686 ecs_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
687 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100688 ecs_api_a1_get_job_status 200 job3 ENABLED
689fi
690
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100691if [ $ECS_VERSION == "V1-1" ]; then
692 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
693else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200694 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
695 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
696 else
697 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
698 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100699fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100700
701ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100702if [ $ECS_VERSION == "V1-1" ]; then
703 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
704else
705 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
706fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100707
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100708if [ $ECS_VERSION == "V1-1" ]; then
709 prodstub_equal create/prod-b/job3 2
710else
711 prodstub_equal create/prod-b/job3 3
712fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100713prodstub_equal delete/prod-b/job3 1
714
715# Delete only the producer
716ecs_api_edp_delete_producer 204 prod-b
717
718ecs_api_edp_get_producer_status 404 prod-b
719
720ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100721if [ $ECS_VERSION == "V1-1" ]; then
722 ecs_api_edp_get_producer_ids 200 prod-a prod-c
723else
724 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
725fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100726
727if [ -z "$FLAT_A1_EI" ]; then
728 ecs_api_a1_get_job_status 200 type2 job3 DISABLED
729else
730 ecs_api_a1_get_job_status 200 job3 DISABLED
731fi
732
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200733if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
734 cr_equal received_callbacks 5 30
735 cr_equal received_callbacks?id=type-status1 4
736 cr_equal received_callbacks?id=job3-status 1
737 cr_api_check_all_ecs_events 200 job3-status DISABLED
738else
739 cr_equal received_callbacks 1 30
740 cr_equal received_callbacks?id=job3-status 1
741 cr_api_check_all_ecs_events 200 job3-status DISABLED
742fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100743
744# Re-create the producer
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100745if [ $ECS_VERSION == "V1-1" ]; then
746 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
747else
748 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
749fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100750
751ecs_api_edp_get_producer_status 200 prod-b ENABLED
752
753if [ -z "$FLAT_A1_EI" ]; then
754 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
755else
756 ecs_api_a1_get_job_status 200 job3 ENABLED
757fi
758
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200759if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
760 cr_equal received_callbacks 6 30
761 cr_equal received_callbacks?id=type-status1 4
762 cr_equal received_callbacks?id=job3-status 2
763 cr_api_check_all_ecs_events 200 job3-status ENABLED
764else
765 cr_equal received_callbacks 2 30
766 cr_equal received_callbacks?id=job3-status 2
767 cr_api_check_all_ecs_events 200 job3-status ENABLED
768fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100769
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100770if [ $ECS_VERSION == "V1-1" ]; then
771 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
772else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200773 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
774 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
775 else
776 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
777 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100778fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100779
780## Setup prod-d
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100781if [ $ECS_VERSION == "V1-1" ]; then
782 ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
783else
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200784 ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100785 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
786fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200787
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200788if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
789 cr_equal received_callbacks 7 30
790 cr_equal received_callbacks?id=type-status1 5
791 cr_api_check_all_ecs_subscription_events 200 type-status1 type4 testdata/ecs/ei-type-4.json REGISTERED
792fi
793
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200794ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
795
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100796if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100797 ecs_api_a1_put_job 201 type4 job8 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100798else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100799 ecs_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100800fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100801
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100802if [ $ECS_VERSION == "V1-1" ]; then
803 prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
804else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200805 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
806 prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
807 else
808 prodstub_check_jobdata_3 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
809 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100810fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100811
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200812prodstub_equal create/prod-d/job8 1
813prodstub_equal delete/prod-d/job8 0
814
815ecs_api_a1_get_job_ids 200 type4 NOWNER job8
816
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100817if [ -z "$FLAT_A1_EI" ]; then
818 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
819else
820 ecs_api_a1_get_job_status 200 job8 ENABLED
821fi
822
823# Re-PUT the producer with zero types
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100824if [ $ECS_VERSION == "V1-1" ]; then
825 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
826else
827 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
828fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200829
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100830if [ -z "$FLAT_A1_EI" ]; then
831 ecs_api_a1_get_job_ids 404 type4 NOWNER
832else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100833 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
834 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100835fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200836
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100837if [ -z "$FLAT_A1_EI" ]; then
838 ecs_api_a1_get_job_status 200 type4 job8 DISABLED
839else
840 ecs_api_a1_get_job_status 200 job8 DISABLED
841fi
842
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200843if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
844 cr_equal received_callbacks 8 30
845 cr_equal received_callbacks?id=type-status1 5
846 cr_equal received_callbacks?id=job8-status 1
847 cr_api_check_all_ecs_events 200 job8-status DISABLED
848else
849 cr_equal received_callbacks 3 30
850 cr_equal received_callbacks?id=job8-status 1
851 cr_api_check_all_ecs_events 200 job8-status DISABLED
852fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100853
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200854prodstub_equal create/prod-d/job8 1
855prodstub_equal delete/prod-d/job8 0
856
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100857## Re-setup prod-d
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100858if [ $ECS_VERSION == "V1-1" ]; then
859 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
860else
861 ecs_api_edp_put_type_2 200 type4 testdata/ecs/ei-type-4.json
862 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
863fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100864
865if [ -z "$FLAT_A1_EI" ]; then
866 ecs_api_a1_get_job_ids 404 type4 NOWNER
867else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100868 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
869 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100870fi
871
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100872if [ -z "$FLAT_A1_EI" ]; then
873 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
874else
875 ecs_api_a1_get_job_status 200 job8 ENABLED
876fi
877
878ecs_api_edp_get_producer_status 200 prod-a ENABLED
879ecs_api_edp_get_producer_status 200 prod-b ENABLED
880ecs_api_edp_get_producer_status 200 prod-c ENABLED
881ecs_api_edp_get_producer_status 200 prod-d ENABLED
882
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200883if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
884 cr_equal received_callbacks 10 30
885 cr_equal received_callbacks?id=type-status1 6
886 cr_api_check_all_ecs_subscription_events 200 type-status1 type4 testdata/ecs/ei-type-4.json REGISTERED
887
888 cr_equal received_callbacks?id=job8-status 2
889 cr_api_check_all_ecs_events 200 job8-status ENABLED
890else
891 cr_equal received_callbacks 4 30
892 cr_equal received_callbacks?id=job8-status 2
893 cr_api_check_all_ecs_events 200 job8-status ENABLED
894fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100895
896prodstub_equal create/prod-d/job8 2
897prodstub_equal delete/prod-d/job8 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100898
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100899## Setup prod-e
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100900if [ $ECS_VERSION == "V1-1" ]; then
901 ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
902else
903 ecs_api_edp_put_type_2 201 type6 testdata/ecs/ei-type-6.json
904 ecs_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6
905fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100906
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200907if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
908 cr_equal received_callbacks 11 30
909 cr_equal received_callbacks?id=type-status1 7
910 cr_api_check_all_ecs_subscription_events 200 type-status1 type6 testdata/ecs/ei-type-6.json REGISTERED
911fi
912
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100913ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY
914
915if [ -z "$FLAT_A1_EI" ]; then
916 ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
917else
918 ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json
919fi
920
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100921if [ $ECS_VERSION == "V1-1" ]; then
922 prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
923else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200924 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
925 prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
926 else
927 prodstub_check_jobdata_3 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
928 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100929fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100930
931prodstub_equal create/prod-e/job10 1
932prodstub_equal delete/prod-e/job10 0
933
934ecs_api_a1_get_job_ids 200 type6 NOWNER job10
935
936if [ -z "$FLAT_A1_EI" ]; then
937 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
938else
939 ecs_api_a1_get_job_status 200 job10 ENABLED
940fi
941
942## Setup prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100943if [ $ECS_VERSION == "V1-1" ]; then
944 ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
945else
946 ecs_api_edp_put_type_2 200 type6 testdata/ecs/ei-type-6.json
947 ecs_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6
948fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100949
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200950if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
951 cr_equal received_callbacks 12 30
952 cr_equal received_callbacks?id=type-status1 8
953 cr_api_check_all_ecs_subscription_events 200 type-status1 type6 testdata/ecs/ei-type-6.json REGISTERED
954fi
955
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100956ecs_api_a1_get_job_ids 200 type6 NOWNER job10
957
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100958if [ $ECS_VERSION == "V1-1" ]; then
959 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
960else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200961 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
962 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
963 else
964 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
965 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100966fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100967
968prodstub_equal create/prod-f/job10 1
969prodstub_equal delete/prod-f/job10 0
970
971ecs_api_a1_get_job_ids 200 type6 NOWNER job10
972
973if [ -z "$FLAT_A1_EI" ]; then
974 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
975else
976 ecs_api_a1_get_job_status 200 job10 ENABLED
977fi
978
979## Status updates prod-a and jobs
980
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100981if [ $ECS_VERSION == "V1-1" ]; then
982 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
983else
984 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
985fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100986
987ecs_api_edp_get_producer_status 200 prod-a ENABLED
988ecs_api_edp_get_producer_status 200 prod-b ENABLED
989ecs_api_edp_get_producer_status 200 prod-c ENABLED
990ecs_api_edp_get_producer_status 200 prod-d ENABLED
991ecs_api_edp_get_producer_status 200 prod-e ENABLED
992ecs_api_edp_get_producer_status 200 prod-f ENABLED
993
994# Arm producer prod-a for supervision failure
995prodstub_arm_producer 200 prod-a 400
996
997# Wait for producer prod-a to go disabled
998ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
999
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001000if [ $ECS_VERSION == "V1-1" ]; then
1001 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
1002else
1003 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
1004fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001005
1006ecs_api_edp_get_producer_status 200 prod-a DISABLED
1007ecs_api_edp_get_producer_status 200 prod-b ENABLED
1008ecs_api_edp_get_producer_status 200 prod-c ENABLED
1009ecs_api_edp_get_producer_status 200 prod-d ENABLED
1010ecs_api_edp_get_producer_status 200 prod-e ENABLED
1011ecs_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +01001012
1013
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001014if [ -z "$FLAT_A1_EI" ]; then
1015 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
1016 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
1017 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1018 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1019 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1020else
1021 ecs_api_a1_get_job_status 200 job1 ENABLED
1022 ecs_api_a1_get_job_status 200 job2 ENABLED
1023 ecs_api_a1_get_job_status 200 job3 ENABLED
1024 ecs_api_a1_get_job_status 200 job8 ENABLED
1025 ecs_api_a1_get_job_status 200 job10 ENABLED
1026fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +01001027
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001028# Arm producer prod-a for supervision
1029prodstub_arm_producer 200 prod-a 200
1030
1031# Wait for producer prod-a to go enabled
1032ecs_api_edp_get_producer_status 200 prod-a ENABLED 360
1033
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001034if [ $ECS_VERSION == "V1-1" ]; then
1035 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
1036else
1037 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
1038fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001039
1040ecs_api_edp_get_producer_status 200 prod-a ENABLED
1041ecs_api_edp_get_producer_status 200 prod-b ENABLED
1042ecs_api_edp_get_producer_status 200 prod-c ENABLED
1043ecs_api_edp_get_producer_status 200 prod-d ENABLED
1044ecs_api_edp_get_producer_status 200 prod-e ENABLED
1045ecs_api_edp_get_producer_status 200 prod-f ENABLED
1046
1047if [ -z "$FLAT_A1_EI" ]; then
1048 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
1049 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
1050 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1051 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1052 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1053else
1054 ecs_api_a1_get_job_status 200 job1 ENABLED
1055 ecs_api_a1_get_job_status 200 job2 ENABLED
1056 ecs_api_a1_get_job_status 200 job3 ENABLED
1057 ecs_api_a1_get_job_status 200 job8 ENABLED
1058 ecs_api_a1_get_job_status 200 job10 ENABLED
1059fi
1060
1061# Arm producer prod-a for supervision failure
1062prodstub_arm_producer 200 prod-a 400
1063
1064# Wait for producer prod-a to go disabled
1065ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
1066
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001067if [ $ECS_VERSION == "V1-1" ]; then
1068 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
1069else
1070 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
1071fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001072
1073ecs_api_edp_get_producer_status 200 prod-a DISABLED
1074ecs_api_edp_get_producer_status 200 prod-b ENABLED
1075ecs_api_edp_get_producer_status 200 prod-c ENABLED
1076ecs_api_edp_get_producer_status 200 prod-d ENABLED
1077ecs_api_edp_get_producer_status 200 prod-e ENABLED
1078ecs_api_edp_get_producer_status 200 prod-f ENABLED
1079
1080if [ -z "$FLAT_A1_EI" ]; then
1081 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
1082 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
1083 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1084 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1085 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1086else
1087 ecs_api_a1_get_job_status 200 job1 ENABLED
1088 ecs_api_a1_get_job_status 200 job2 ENABLED
1089 ecs_api_a1_get_job_status 200 job3 ENABLED
1090 ecs_api_a1_get_job_status 200 job8 ENABLED
1091 ecs_api_a1_get_job_status 200 job10 ENABLED
1092fi
1093
1094# Wait for producer prod-a to be removed
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001095if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1096 ecs_equal json:data-producer/v1/info-producers 5 1000
1097else
1098 ecs_equal json:ei-producer/v1/eiproducers 5 1000
1099fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001100
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001101if [ $ECS_VERSION == "V1-1" ]; then
1102 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
1103else
1104 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
1105fi
1106
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001107
1108ecs_api_edp_get_producer_status 404 prod-a
1109ecs_api_edp_get_producer_status 200 prod-b ENABLED
1110ecs_api_edp_get_producer_status 200 prod-c ENABLED
1111ecs_api_edp_get_producer_status 200 prod-d ENABLED
1112ecs_api_edp_get_producer_status 200 prod-e ENABLED
1113ecs_api_edp_get_producer_status 200 prod-f ENABLED
1114
1115if [ -z "$FLAT_A1_EI" ]; then
1116 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1117 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1118 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1119 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1120 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1121else
1122 ecs_api_a1_get_job_status 200 job1 DISABLED
1123 ecs_api_a1_get_job_status 200 job2 DISABLED
1124 ecs_api_a1_get_job_status 200 job3 ENABLED
1125 ecs_api_a1_get_job_status 200 job8 ENABLED
1126 ecs_api_a1_get_job_status 200 job10 ENABLED
1127fi
1128
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001129if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1130 cr_equal received_callbacks 14 30
1131else
1132 cr_equal received_callbacks 6 30
1133fi
1134
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001135cr_equal received_callbacks?id=job1-status 1
1136cr_equal received_callbacks?id=job2-status 1
1137
1138cr_api_check_all_ecs_events 200 job1-status DISABLED
1139cr_api_check_all_ecs_events 200 job2-status DISABLED
1140
1141
1142# Arm producer prod-e for supervision failure
1143prodstub_arm_producer 200 prod-e 400
1144
1145ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000
1146
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001147if [ $ECS_VERSION == "V1-1" ]; then
1148 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
1149else
1150 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
1151fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001152
1153ecs_api_edp_get_producer_status 404 prod-a
1154ecs_api_edp_get_producer_status 200 prod-b ENABLED
1155ecs_api_edp_get_producer_status 200 prod-c ENABLED
1156ecs_api_edp_get_producer_status 200 prod-d ENABLED
1157ecs_api_edp_get_producer_status 200 prod-e DISABLED
1158ecs_api_edp_get_producer_status 200 prod-f ENABLED
1159
1160if [ -z "$FLAT_A1_EI" ]; then
1161 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1162 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1163 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1164 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1165 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1166else
1167 ecs_api_a1_get_job_status 200 job1 DISABLED
1168 ecs_api_a1_get_job_status 200 job2 DISABLED
1169 ecs_api_a1_get_job_status 200 job3 ENABLED
1170 ecs_api_a1_get_job_status 200 job8 ENABLED
1171 ecs_api_a1_get_job_status 200 job10 ENABLED
1172fi
1173
1174#Disable create for job10 in prod-e
1175prodstub_arm_job_create 200 prod-e job10 400
1176
1177#Update tjob 10 - only prod-f will be updated
1178if [ -z "$FLAT_A1_EI" ]; then
1179 ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1180else
1181 ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json
1182fi
1183#Reset producer and job responses
1184prodstub_arm_producer 200 prod-e 200
1185prodstub_arm_job_create 200 prod-e job10 200
1186
1187ecs_api_edp_get_producer_status 200 prod-e ENABLED 360
1188
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001189if [ $ECS_VERSION == "V1-1" ]; then
1190 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
1191else
1192 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
1193fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001194
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001195#Wait for job to be updated
1196sleep_wait 120
1197
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001198if [ $ECS_VERSION == "V1-1" ]; then
1199 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1200else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001201 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
1202 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1203 else
1204 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1205 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001206fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001207
1208prodstub_arm_producer 200 prod-f 400
1209
1210ecs_api_edp_get_producer_status 200 prod-f DISABLED 360
1211
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001212if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1213 ecs_equal json:data-producer/v1/info-producers 4 1000
1214else
1215 ecs_equal json:ei-producer/v1/eiproducers 4 1000
1216fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001217
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001218if [ $ECS_VERSION == "V1-1" ]; then
1219 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
1220else
1221 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1222fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001223
1224ecs_api_edp_get_producer_status 404 prod-a
1225ecs_api_edp_get_producer_status 200 prod-b ENABLED
1226ecs_api_edp_get_producer_status 200 prod-c ENABLED
1227ecs_api_edp_get_producer_status 200 prod-d ENABLED
1228ecs_api_edp_get_producer_status 200 prod-e ENABLED
1229ecs_api_edp_get_producer_status 404 prod-f
1230
1231if [ -z "$FLAT_A1_EI" ]; then
1232 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1233 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1234 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1235 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1236 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1237else
1238 ecs_api_a1_get_job_status 200 job1 DISABLED
1239 ecs_api_a1_get_job_status 200 job2 DISABLED
1240 ecs_api_a1_get_job_status 200 job3 ENABLED
1241 ecs_api_a1_get_job_status 200 job8 ENABLED
1242 ecs_api_a1_get_job_status 200 job10 ENABLED
1243fi
1244
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001245if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1246 cr_equal received_callbacks 14 30
1247else
1248 cr_equal received_callbacks 6 30
1249fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +02001250
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001251
1252if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
1253
1254 # End test if info types is not impl in tested version
1255 check_ecs_logs
1256
1257 store_logs END
1258
1259 #### TEST COMPLETE ####
1260
1261 print_result
1262
1263 auto_clean_environment
1264fi
1265
1266
1267############################################
1268# Test of info types
1269############################################
1270
1271### Setup prodstub sim to accept calls for producers, info types and jobs
1272## prod-ia type101
1273## prod-ib type101 and type102
1274## prod-ic no-type
1275## prod-id type104
1276## prod-ie type106
1277## prod-if type106
1278## prod-ig type150 (configured later)
1279## prod-ig type160 (configured later)
1280
1281## job101 -> prod-ia
1282## job102 -> prod-ia
1283## job103 -> prod-ib
1284## job104 -> prod-ia
1285## job106 -> prod-ib
1286## job108 -> prod-id
1287## job110 -> prod-ie and prod-if
1288## job150 -> prod-ig (configured later)
1289
1290prodstub_arm_producer 200 prod-ia
1291prodstub_arm_producer 200 prod-ib
1292prodstub_arm_producer 200 prod-ic
1293prodstub_arm_producer 200 prod-id
1294prodstub_arm_producer 200 prod-ie
1295prodstub_arm_producer 200 prod-if
1296
1297prodstub_arm_type 200 prod-ia type101
1298prodstub_arm_type 200 prod-ib type102
1299prodstub_arm_type 200 prod-ib type103
1300prodstub_arm_type 200 prod-id type104
1301prodstub_arm_type 200 prod-ie type106
1302prodstub_arm_type 200 prod-if type106
1303
1304prodstub_disarm_type 200 prod-ib type103
1305prodstub_arm_type 200 prod-ib type101
1306prodstub_disarm_type 200 prod-ib type101
1307
1308
1309prodstub_arm_job_create 200 prod-ia job101
1310prodstub_arm_job_create 200 prod-ia job102
1311prodstub_arm_job_create 200 prod-ib job103
1312
1313prodstub_arm_job_delete 200 prod-ia job101
1314prodstub_arm_job_delete 200 prod-ia job102
1315prodstub_arm_job_delete 200 prod-ib job103
1316
1317prodstub_arm_job_create 200 prod-ib job104
1318prodstub_arm_job_create 200 prod-ia job104
1319
1320prodstub_arm_job_create 200 prod-ib job106
1321
1322prodstub_arm_job_create 200 prod-id job108
1323
1324prodstub_arm_job_create 200 prod-ie job110
1325prodstub_arm_job_create 200 prod-if job110
1326
1327
1328# NOTE: types, jobs and producers are still present related to eitypes
1329
1330
1331### Initial tests - no config made
1332### GET: type ids, types, producer ids, producers, job ids, jobs
1333### DELETE: jobs
1334ecs_api_idc_get_type_ids 200 type1 type2 type4 type6
1335ecs_api_idc_get_type 404 test-type
1336
1337ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1338ecs_api_edp_get_type_2 404 test-type
1339
1340ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1341ecs_api_edp_get_producer_2 404 test-prod
1342ecs_api_edp_get_producer_status 404 test-prod
1343
1344ecs_api_edp_delete_producer 404 test-prod
1345
1346ecs_api_idc_get_job_ids 200 test-type NOWNER EMPTY
1347ecs_api_idc_get_job_ids 200 test-type test-owner EMPTY
1348
1349ecs_api_idc_get_job 404 test-job
1350
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001351ecs_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001352
1353ecs_api_idc_delete_job 404 test-job
1354
1355ecs_api_edp_get_producer_jobs_2 404 test-prod
1356
1357ecs_api_edp_get_type_2 404 test-type
1358ecs_api_edp_delete_type_2 404 test-type
1359
1360### Setup of producer/job and testing apis ###
1361
1362## Setup prod-ia
1363ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1364ecs_api_edp_get_type_2 404 type101
1365ecs_api_edp_put_producer_2 404 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1366
1367# Create type, delete and create again
1368ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
1369ecs_api_edp_get_type_2 200 type101
1370ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1371ecs_api_edp_delete_type_2 204 type101
1372ecs_api_edp_get_type_2 404 type101
1373ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1374ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
1375ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1376ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1377
1378ecs_api_edp_put_producer_2 201 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1379ecs_api_edp_put_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1380
1381ecs_api_edp_delete_type_2 406 type101
1382
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001383if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1384 cr_equal received_callbacks 17 30
1385 cr_equal received_callbacks?id=type-status1 11
1386 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
1387else
1388 cr_equal received_callbacks 6
1389fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001390
1391ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1392ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1393
1394ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-b prod-c prod-d prod-e
1395ecs_api_edp_get_producer_ids_2 200 type101 prod-ia
1396ecs_api_edp_get_producer_ids_2 200 type102 EMPTY
1397
1398ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1399
1400ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1401
1402ecs_api_idc_get_job_ids 200 type101 NOWNER EMPTY
1403ecs_api_idc_get_job_ids 200 type101 test-owner EMPTY
1404
1405ecs_api_idc_get_job 404 test-job
1406
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001407ecs_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001408ecs_api_edp_get_producer_jobs_2 200 prod-ia EMPTY
1409
1410## Create a job for prod-ia
1411## job101 - prod-ia
1412ecs_api_idc_put_job 201 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ecs/job-template.json VALIDATE
1413
1414# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001415prodstub_check_jobdata_3 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001416
1417ecs_api_idc_get_job_ids 200 type101 NOWNER job101
1418ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1419
1420ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job1 job2 job3 job8 job10
1421
1422ecs_api_idc_get_job 200 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ecs/job-template.json
1423
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001424ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001425
1426prodstub_equal create/prod-ia/job101 1
1427
1428ecs_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json
1429
1430## Create a second job for prod-ia
1431## job102 - prod-ia
1432ecs_api_idc_put_job 201 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ecs/job-template.json VALIDATE
1433
1434# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001435prodstub_check_jobdata_3 200 prod-ia job102 type101 $TARGET102 info-owner-2 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001436ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1437ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1438ecs_api_idc_get_job_ids 200 type101 info-owner-2 job102
1439ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1440
1441ecs_api_idc_get_job 200 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ecs/job-template.json
1442
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001443ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001444
1445prodstub_equal create/prod-ia/job102 1
1446
1447ecs_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
1448
1449
1450## Setup prod-ib
1451ecs_api_edp_put_type_2 201 type102 testdata/ecs/info-type-2.json
1452ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1453
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001454if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1455 cr_equal received_callbacks 18 30
1456 cr_equal received_callbacks?id=type-status1 12
1457 cr_api_check_all_ecs_subscription_events 200 type-status1 type102 testdata/ecs/info-type-2.json REGISTERED
1458else
1459 cr_equal received_callbacks 6
1460fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001461
1462ecs_api_idc_get_type_ids 200 type101 type102 type1 type2 type4 type6
1463
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001464if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1465 ecs_api_idc_get_type 200 type101 testdata/ecs/info-type-1.json ENABLED 1
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001466
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001467 ecs_api_idc_get_type 200 type102 testdata/ecs/info-type-2.json ENABLED 1
1468else
1469 ecs_api_idc_get_type 200 type101 testdata/ecs/info-type-1.json
1470
1471 ecs_api_idc_get_type 200 type102 testdata/ecs/info-type-2.json
1472fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001473
1474ecs_api_edp_get_type_ids 200 type101 type102 type1 type2 type4 type6
1475ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1476ecs_api_edp_get_type_2 200 type102 testdata/ecs/info-type-2.json
1477
1478ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-b prod-c prod-d prod-e
1479
1480ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1481ecs_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1482
1483ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1484
1485## Create job for prod-ib
1486## job103 - prod-ib
1487ecs_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json VALIDATE
1488
1489prodstub_equal create/prod-ib/job103 1
1490
1491# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001492prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001493
1494ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1495ecs_api_idc_get_job_ids 200 type102 NOWNER job103
1496ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1497ecs_api_idc_get_job_ids 200 type101 info-owner-2 job102
1498ecs_api_idc_get_job_ids 200 type102 info-owner-3 job103
1499
1500ecs_api_idc_get_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json
1501
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001502ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001503
1504ecs_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
1505ecs_api_edp_get_producer_jobs_2 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json
1506
1507## Setup prod-ic (no types)
1508ecs_api_edp_put_producer_2 201 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic NOTYPE
1509
1510ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1511
1512ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1513ecs_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1514ecs_api_edp_get_producer_2 200 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic EMPTY
1515
1516ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1517
1518
1519## Delete job103 and prod-ib and re-create if different order
1520
1521# Delete job then producer
1522ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1523ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1524
1525ecs_api_idc_delete_job 204 job103
1526
1527ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1528ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1529
1530ecs_api_edp_delete_producer 204 prod-ib
1531
1532ecs_api_edp_get_producer_status 404 prod-ib
1533
1534ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1535ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
1536
1537prodstub_equal delete/prod-ib/job103 1
1538
1539ecs_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001540ecs_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001541
1542# Put producer then job
1543ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1544
1545ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1546
1547ecs_api_idc_put_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template2.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001548ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001549
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001550prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001551
1552ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1553ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1554
1555prodstub_equal create/prod-ib/job103 3
1556prodstub_equal delete/prod-ib/job103 1
1557
1558# Delete only the producer
1559ecs_api_edp_delete_producer 204 prod-ib
1560
1561ecs_api_edp_get_producer_status 404 prod-ib
1562
1563ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1564ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
1565
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001566ecs_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001567
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001568if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1569 cr_equal received_callbacks 19 30
1570
1571 cr_equal received_callbacks?id=info-job103-status 1
1572 cr_api_check_all_ecs_events 200 info-job103-status DISABLED
1573else
1574 cr_equal received_callbacks 7 30
1575 cr_equal received_callbacks?id=info-job103-status 1
1576 cr_api_check_all_ecs_events 200 info-job103-status DISABLED
1577fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001578
1579# Re-create the producer
1580ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1581
1582ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1583
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001584ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001585
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001586if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1587 cr_equal received_callbacks 20 30
1588 cr_equal received_callbacks?id=info-job103-status 2
1589 cr_api_check_all_ecs_events 200 info-job103-status ENABLED
1590else
1591 cr_equal received_callbacks 8 30
1592 cr_equal received_callbacks?id=info-job103-status 2
1593 cr_api_check_all_ecs_events 200 info-job103-status ENABLED
1594fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001595
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001596prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001597
1598## Setup prod-id
1599ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json
1600ecs_api_edp_put_producer_2 201 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
1601
1602ecs_api_idc_get_job_ids 200 type104 NOWNER EMPTY
1603
1604ecs_api_idc_put_job 201 job108 type104 $TARGET108 info-owner-4 $INFOSTATUS108 testdata/ecs/job-template.json VALIDATE
1605
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001606prodstub_check_jobdata_3 200 prod-id job108 type104 $TARGET108 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001607
1608prodstub_equal create/prod-id/job108 1
1609prodstub_equal delete/prod-id/job108 0
1610
1611ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1612
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001613ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001614
1615# Re-PUT the producer with zero types
1616ecs_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id NOTYPE
1617
1618ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1619ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
1620
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001621ecs_api_idc_get_job_status2 200 job108 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001622
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001623if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1624 cr_equal received_callbacks 22 30
1625 cr_equal received_callbacks?id=type-status1 13
1626 cr_api_check_all_ecs_subscription_events 200 type-status1 type104 testdata/ecs/info-type-4.json REGISTERED
1627
1628 cr_equal received_callbacks?id=info-job108-status 1
1629 cr_api_check_all_ecs_events 200 info-job108-status DISABLED
1630else
1631 cr_equal received_callbacks 9 30
1632 cr_equal received_callbacks?id=info-job108-status 1
1633 cr_api_check_all_ecs_events 200 info-job108-status DISABLED
1634fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001635
1636prodstub_equal create/prod-id/job108 1
1637prodstub_equal delete/prod-id/job108 0
1638
1639## Re-setup prod-id
1640ecs_api_edp_put_type_2 200 type104 testdata/ecs/info-type-4.json
1641ecs_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
1642
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001643
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001644ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1645ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
1646
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001647ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001648
1649ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1650ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1651ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1652ecs_api_edp_get_producer_status 200 prod-id ENABLED
1653
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001654if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1655 cr_equal received_callbacks 24 30
1656
1657 cr_equal received_callbacks?id=type-status1 14
1658 cr_api_check_all_ecs_subscription_events 200 type-status1 type104 testdata/ecs/info-type-4.json REGISTERED
1659
1660 cr_equal received_callbacks?id=info-job108-status 2
1661 cr_api_check_all_ecs_events 200 info-job108-status ENABLED
1662else
1663 cr_equal received_callbacks 10 30
1664 cr_equal received_callbacks?id=info-job108-status 2
1665 cr_api_check_all_ecs_events 200 info-job108-status ENABLED
1666fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001667
1668prodstub_equal create/prod-id/job108 2
1669prodstub_equal delete/prod-id/job108 0
1670
1671
1672## Setup prod-ie
1673ecs_api_edp_put_type_2 201 type106 testdata/ecs/info-type-6.json
1674ecs_api_edp_put_producer_2 201 prod-ie $CB_JOB/prod-ie $CB_SV/prod-ie type106
1675
1676ecs_api_idc_get_job_ids 200 type106 NOWNER EMPTY
1677
1678ecs_api_idc_put_job 201 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ecs/job-template.json VALIDATE
1679
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001680prodstub_check_jobdata_3 200 prod-ie job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001681
1682prodstub_equal create/prod-ie/job110 1
1683prodstub_equal delete/prod-ie/job110 0
1684
1685ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1686
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001687ecs_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001688
1689## Setup prod-if
1690ecs_api_edp_put_type_2 200 type106 testdata/ecs/info-type-6.json
1691ecs_api_edp_put_producer_2 201 prod-if $CB_JOB/prod-if $CB_SV/prod-if type106
1692
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001693if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1694 cr_equal received_callbacks 26 30
1695
1696 cr_equal received_callbacks?id=type-status1 16
1697 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
1698fi
1699
1700
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001701ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1702
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001703prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001704
1705prodstub_equal create/prod-if/job110 1
1706prodstub_equal delete/prod-if/job110 0
1707
1708ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1709
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001710ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001711
1712## Status updates prod-ia and jobs
1713
1714ecs_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
1715
1716ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1717ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1718ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1719ecs_api_edp_get_producer_status 200 prod-id ENABLED
1720ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1721ecs_api_edp_get_producer_status 200 prod-if ENABLED
1722
1723# Arm producer prod-ia for supervision failure
1724prodstub_arm_producer 200 prod-ia 400
1725
1726# Wait for producer prod-ia to go disabled
1727ecs_api_edp_get_producer_status 200 prod-ia DISABLED 360
1728
1729ecs_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
1730
1731ecs_api_edp_get_producer_status 200 prod-ia DISABLED
1732ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1733ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1734ecs_api_edp_get_producer_status 200 prod-id ENABLED
1735ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1736ecs_api_edp_get_producer_status 200 prod-if ENABLED
1737
1738
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001739ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1740ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1741ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1742ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1743ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001744
1745# Arm producer prod-ia for supervision
1746prodstub_arm_producer 200 prod-ia 200
1747
1748# Wait for producer prod-ia to go enabled
1749ecs_api_edp_get_producer_status 200 prod-ia ENABLED 360
1750
1751ecs_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
1752
1753ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1754ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1755ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1756ecs_api_edp_get_producer_status 200 prod-id ENABLED
1757ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1758ecs_api_edp_get_producer_status 200 prod-if ENABLED
1759
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001760ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1761ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1762ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1763ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1764ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001765
1766# Arm producer prod-ia for supervision failure
1767prodstub_arm_producer 200 prod-ia 400
1768
1769# Wait for producer prod-ia to go disabled
1770ecs_api_edp_get_producer_status 200 prod-ia DISABLED 360
1771
1772ecs_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
1773
1774ecs_api_edp_get_producer_status 200 prod-ia DISABLED
1775ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1776ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1777ecs_api_edp_get_producer_status 200 prod-id ENABLED
1778ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1779ecs_api_edp_get_producer_status 200 prod-if ENABLED
1780
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001781ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1782ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1783ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1784ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1785ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001786
1787# Wait for producer prod-ia to be removed
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001788if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1789 ecs_equal json:data-producer/v1/info-producers 9 1000
1790else
1791 ecs_equal json:ei-producer/v1/eiproducers 9 1000
1792fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001793
1794ecs_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
1795
1796
1797ecs_api_edp_get_producer_status 404 prod-ia
1798ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1799ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1800ecs_api_edp_get_producer_status 200 prod-id ENABLED
1801ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1802ecs_api_edp_get_producer_status 200 prod-if ENABLED
1803
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001804ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1805ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1806ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1807ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1808ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001809
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001810
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001811if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1812 cr_equal received_callbacks 28 30
1813
1814 cr_equal received_callbacks?id=info-job101-status 1
1815 cr_equal received_callbacks?id=info-job102-status 1
1816 cr_api_check_all_ecs_events 200 info-job101-status DISABLED
1817 cr_api_check_all_ecs_events 200 info-job102-status DISABLED
1818else
1819 cr_equal received_callbacks 12 30
1820
1821 cr_equal received_callbacks?id=info-job101-status 1
1822 cr_equal received_callbacks?id=info-job102-status 1
1823 cr_api_check_all_ecs_events 200 info-job101-status DISABLED
1824 cr_api_check_all_ecs_events 200 info-job102-status DISABLED
1825fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001826
1827
1828# Arm producer prod-ie for supervision failure
1829prodstub_arm_producer 200 prod-ie 400
1830
1831ecs_api_edp_get_producer_status 200 prod-ie DISABLED 1000
1832
1833ecs_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
1834
1835ecs_api_edp_get_producer_status 404 prod-ia
1836ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1837ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1838ecs_api_edp_get_producer_status 200 prod-id ENABLED
1839ecs_api_edp_get_producer_status 200 prod-ie DISABLED
1840ecs_api_edp_get_producer_status 200 prod-if ENABLED
1841
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001842ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1843ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1844ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1845ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1846ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001847
1848#Disable create for job110 in prod-ie
1849prodstub_arm_job_create 200 prod-ie job110 400
1850
1851#Update tjob 10 - only prod-if will be updated
1852ecs_api_idc_put_job 200 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ecs/job-template2.json VALIDATE
1853#Reset producer and job responses
1854prodstub_arm_producer 200 prod-ie 200
1855prodstub_arm_job_create 200 prod-ie job110 200
1856
1857ecs_api_edp_get_producer_status 200 prod-ie ENABLED 360
1858
1859ecs_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
1860
1861#Wait for job to be updated
1862sleep_wait 120
1863
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001864prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001865
1866prodstub_arm_producer 200 prod-if 400
1867
1868ecs_api_edp_get_producer_status 200 prod-if DISABLED 360
1869
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001870if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1871 ecs_equal json:data-producer/v1/info-producers 8 1000
1872else
1873 ecs_equal json:ei-producer/v1/eiproducers 8 1000
1874fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001875
1876ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-b prod-c prod-d prod-e
1877
1878ecs_api_edp_get_producer_status 404 prod-ia
1879ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1880ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1881ecs_api_edp_get_producer_status 200 prod-id ENABLED
1882ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1883ecs_api_edp_get_producer_status 404 prod-if
1884
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001885ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1886ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1887ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1888ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1889ecs_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001890
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001891if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1892 cr_equal received_callbacks 28
1893else
1894 cr_equal received_callbacks 12
1895fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001896### Test of pre and post validation
1897
1898ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
1899ecs_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1900ecs_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ecs/job-template.json
1901
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001902ecs_api_idc_get_job_status2 404 job150
1903ecs_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001904
1905prodstub_arm_producer 200 prod-ig
1906prodstub_arm_job_create 200 prod-ig job150
1907prodstub_arm_job_create 200 prod-ig job160
1908
1909ecs_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
1910ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1911
1912ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
1913
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001914ecs_api_idc_get_job_status2 404 job150
1915ecs_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001916
1917prodstub_arm_type 200 prod-ig type160
1918
1919ecs_api_edp_put_type_2 201 type160 testdata/ecs/info-type-60.json
1920ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160
1921
1922ecs_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1923ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1924ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1925
1926ecs_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1927
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001928ecs_api_idc_get_job_status2 404 job150
1929ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001930
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001931prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001932
1933prodstub_equal create/prod-ig/job160 1
1934prodstub_equal delete/prod-ig/job160 0
1935
1936prodstub_arm_type 200 prod-ig type150
1937
1938ecs_api_edp_put_type_2 201 type150 testdata/ecs/info-type-50.json
1939ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160 type150
1940
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001941if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1942 cr_equal received_callbacks 30 30
1943 cr_equal received_callbacks?id=type-status1 18
1944 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
1945else
1946 cr_equal received_callbacks 12
1947fi
1948
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001949ecs_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1950ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1951
1952ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1953
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001954ecs_api_idc_get_job_status2 404 job150
1955ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001956
1957ecs_api_idc_put_job 201 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1958
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001959ecs_api_idc_get_job_status2 200 job150 ENABLED 1 prod-ig 60
1960ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001961
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001962if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1963 cr_equal received_callbacks 30 30
1964 cr_equal received_callbacks?id=type-status1 18
1965else
1966 cr_equal received_callbacks 12
1967fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001968
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001969# Test job deletion at type delete
1970
1971if [[ "$ECS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1972
1973 ecs_api_edp_delete_type_2 406 type104
1974
1975 ecs_api_edp_delete_producer 204 prod-id
1976
1977 ecs_api_edp_delete_type_2 204 type104
1978
1979 cr_equal received_callbacks 32 30
1980 cr_equal received_callbacks?id=info-job108-status 3
1981 cr_equal received_callbacks?id=type-status1 19
1982 cr_api_check_all_ecs_subscription_events 200 type-status1 type104 testdata/ecs/info-type-4.json DEREGISTERED
1983 cr_api_check_all_ecs_events 200 info-job108-status DISABLED
1984
1985 ecs_api_edp_get_producer 404 prod-id
1986
1987 ecs_api_idc_get_job 404 job-108
1988
1989else
1990 cr_equal received_callbacks 12
1991fi
1992
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +02001993check_ecs_logs
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001994
1995store_logs END
1996
1997#### TEST COMPLETE ####
1998
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001999print_result
2000
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02002001auto_clean_environment