blob: 14652d0119af560b0339d08c9ce25ebb4664859b [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
BjornMagnussonXA674793d2021-05-06 19:49:17 +020037SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-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
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100130### Setup prodstub sim to accept calls for producers, types and jobs
131## prod-a type1
132## prod-b type1 and type2
133## prod-c no-type
134## prod-d type4
135## prod-e type6
136## prod-f type6
137
138## job1 -> prod-a
139## job2 -> prod-a
140## job3 -> prod-b
141## job4 -> prod-a
142## job6 -> prod-b
143## job8 -> prod-d
144## job10 -> prod-e and prod-f
145
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200146prodstub_arm_producer 200 prod-a
147prodstub_arm_producer 200 prod-b
148prodstub_arm_producer 200 prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200149prodstub_arm_producer 200 prod-d
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100150prodstub_arm_producer 200 prod-e
151prodstub_arm_producer 200 prod-f
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200152
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200153prodstub_arm_type 200 prod-a type1
154prodstub_arm_type 200 prod-b type2
155prodstub_arm_type 200 prod-b type3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100156prodstub_arm_type 200 prod-d type4
157prodstub_arm_type 200 prod-e type6
158prodstub_arm_type 200 prod-f type6
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200159
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200160prodstub_disarm_type 200 prod-b type3
161prodstub_arm_type 200 prod-b type1
162prodstub_disarm_type 200 prod-b type1
163
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100164
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200165prodstub_arm_job_create 200 prod-a job1
166prodstub_arm_job_create 200 prod-a job2
167prodstub_arm_job_create 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200168
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200169prodstub_arm_job_delete 200 prod-a job1
170prodstub_arm_job_delete 200 prod-a job2
171prodstub_arm_job_delete 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200172
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200173prodstub_arm_job_create 200 prod-b job4
174prodstub_arm_job_create 200 prod-a job4
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200175
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200176prodstub_arm_job_create 200 prod-b job6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200177
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100178prodstub_arm_job_create 200 prod-d job8
179
180prodstub_arm_job_create 200 prod-e job10
181prodstub_arm_job_create 200 prod-f job10
182
183### ecs status
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200184ecs_api_service_status 200
185
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100186cr_equal received_callbacks 0
187
188### Initial tests - no config made
189### GET: type ids, types, producer ids, producers, job ids, jobs
190### DELETE: jobs
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200191ecs_api_a1_get_type_ids 200 EMPTY
192ecs_api_a1_get_type 404 test-type
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200193
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200194ecs_api_edp_get_type_ids 200 EMPTY
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100195if [ $ECS_VERSION == "V1-1" ]; then
196 ecs_api_edp_get_type 404 test-type
197else
198 ecs_api_edp_get_type_2 404 test-type
199fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200200
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100201if [ $ECS_VERSION == "V1-1" ]; then
202 ecs_api_edp_get_producer_ids 200 EMPTY
203 ecs_api_edp_get_producer 404 test-prod
204else
205 ecs_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
206 ecs_api_edp_get_producer_2 404 test-prod
207fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200208ecs_api_edp_get_producer_status 404 test-prod
209
210ecs_api_edp_delete_producer 404 test-prod
211
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100212if [ -z "$FLAT_A1_EI" ]; then
213 ecs_api_a1_get_job_ids 404 test-type NOWNER
214 ecs_api_a1_get_job_ids 404 test-type test-owner
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200215
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100216 ecs_api_a1_get_job 404 test-type test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200217
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100218 ecs_api_a1_get_job_status 404 test-type test-job
219else
220 ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY
221 ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200222
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100223 ecs_api_a1_get_job 404 test-job
224
225 ecs_api_a1_get_job_status 404 test-job
226fi
227
228if [ -z "$FLAT_A1_EI" ]; then
229 ecs_api_a1_delete_job 404 test-type test-job
230else
231 ecs_api_a1_delete_job 404 test-job
232fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200233
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100234if [ $ECS_VERSION == "V1-1" ]; then
235 ecs_api_edp_get_producer_jobs 404 test-prod
236else
237 ecs_api_edp_get_producer_jobs_2 404 test-prod
238fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200239
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100240if [ $ECS_VERSION == "V1-2" ]; then
241 ecs_api_edp_get_type_2 404 test-type
242 ecs_api_edp_delete_type_2 404 test-type
243fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200244
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100245### Setup of producer/job and testing apis ###
246
247## Setup prod-a
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100248if [ $ECS_VERSION == "V1-1" ]; then
249 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
250 ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
251else
252 #V1-2
253 ecs_api_edp_get_type_ids 200 EMPTY
254 ecs_api_edp_get_type_2 404 type1
255 ecs_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
256
257 # Create type, delete and create again
258 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
259 ecs_api_edp_get_type_2 200 type1
260 ecs_api_edp_get_type_ids 200 type1
261 ecs_api_edp_delete_type_2 204 type1
262 ecs_api_edp_get_type_2 404 type1
263 ecs_api_edp_get_type_ids 200 EMPTY
264 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
265 ecs_api_edp_get_type_ids 200 type1
266 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
267
268 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
269 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100270fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100271
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200272
273ecs_api_a1_get_type_ids 200 type1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100274if [ -z "$FLAT_A1_EI" ]; then
275 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
276else
277 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
278fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200279
280ecs_api_edp_get_type_ids 200 type1
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100281if [ $ECS_VERSION == "V1-1" ]; then
282 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
283else
284 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
285fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200286
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100287if [ $ECS_VERSION == "V1-1" ]; then
288 ecs_api_edp_get_producer_ids 200 prod-a
289else
290 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a
291 ecs_api_edp_get_producer_ids_2 200 type1 prod-a
292 ecs_api_edp_get_producer_ids_2 200 type2 EMPTY
293fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100294
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100295if [ $ECS_VERSION == "V1-1" ]; then
296 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
297else
298 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
299fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200300
301ecs_api_edp_get_producer_status 200 prod-a ENABLED
302
303ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
304ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
305
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100306if [ -z "$FLAT_A1_EI" ]; then
307 ecs_api_a1_get_job 404 type1 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200308
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100309 ecs_api_a1_get_job_status 404 type1 test-job
310else
311 ecs_api_a1_get_job 404 test-job
312
313 ecs_api_a1_get_job_status 404 test-job
314fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100315if [ $ECS_VERSION == "V1-1" ]; then
316 ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
317else
318 ecs_api_edp_get_producer_jobs_2 200 prod-a EMPTY
319fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200320
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100321## Create a job for prod-a
322## job1 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100323if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100324 ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100325else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100326 ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100327fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200328
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100329# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100330if [ $ECS_VERSION == "V1-1" ]; then
331 prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
332else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200333 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
334 prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
335 else
336 prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
337 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100338fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200339
340ecs_api_a1_get_job_ids 200 type1 NOWNER job1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100341ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
342
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100343if [ ! -z "$FLAT_A1_EI" ]; then
344 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1
345fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200346
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100347if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100348 ecs_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200349
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100350 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
351else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100352 ecs_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100353
354 ecs_api_a1_get_job_status 200 job1 ENABLED
355fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200356
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100357prodstub_equal create/prod-a/job1 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200358
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100359if [ $ECS_VERSION == "V1-1" ]; then
360 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
361else
362 ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
363fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200364
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100365## Create a second job for prod-a
366## job2 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100367if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100368 ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100369else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100370 ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100371fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200372
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100373# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100374if [ $ECS_VERSION == "V1-1" ]; then
375 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
376else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200377 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
378 prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
379 else
380 prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
381 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100382fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200383ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100384ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
385ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100386if [ ! -z "$FLAT_A1_EI" ]; then
387 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
388fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200389
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100390if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100391 ecs_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200392
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100393 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
394else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100395 ecs_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100396
397 ecs_api_a1_get_job_status 200 job2 ENABLED
398fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200399
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100400prodstub_equal create/prod-a/job2 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200401
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100402if [ $ECS_VERSION == "V1-1" ]; then
403 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
404else
405 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
406fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200407
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100408## Setup prod-b
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100409if [ $ECS_VERSION == "V1-1" ]; then
410 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
411else
412 ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
413 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
414fi
415
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200416
417ecs_api_a1_get_type_ids 200 type1 type2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100418if [ -z "$FLAT_A1_EI" ]; then
419 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
420 ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
421else
422 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
423 ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json
424fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200425
426ecs_api_edp_get_type_ids 200 type1 type2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100427if [ $ECS_VERSION == "V1-1" ]; then
428 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
429 ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
430else
431 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
432 ecs_api_edp_get_type_2 200 type2 testdata/ecs/ei-type-2.json
433fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200434
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100435if [ $ECS_VERSION == "V1-1" ]; then
436 ecs_api_edp_get_producer_ids 200 prod-a prod-b
437else
438 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b
439fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100440
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100441if [ $ECS_VERSION == "V1-1" ]; then
442 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
443 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
444else
445 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
446 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
447fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200448
449ecs_api_edp_get_producer_status 200 prod-b ENABLED
450
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100451## Create job for prod-b
452## job3 - prod-b
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100453if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100454 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100455else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100456 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100457fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200458
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100459prodstub_equal create/prod-b/job3 1
460
461# Check the job data in the producer
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100462if [ $ECS_VERSION == "V1-1" ]; then
463 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
464else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200465 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
466 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
467 else
468 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
469 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100470fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200471
472ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
473ecs_api_a1_get_job_ids 200 type2 NOWNER job3
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
476ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200477
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100478if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100479 ecs_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200480
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100481 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
482else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100483 ecs_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100484
485 ecs_api_a1_get_job_status 200 job3 ENABLED
486fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200487
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100488if [ $ECS_VERSION == "V1-1" ]; then
489 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
490 ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
491else
492 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
493 ecs_api_edp_get_producer_jobs_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
494fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200495
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100496## Setup prod-c (no types)
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100497if [ $ECS_VERSION == "V1-1" ]; then
498 ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
499else
500 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
501fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100502
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100503if [ $ECS_VERSION == "V1-1" ]; then
504 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
505else
506 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
507fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200508
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100509if [ $ECS_VERSION == "V1-1" ]; then
510 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
511 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
512 ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
513else
514 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
515 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
516 ecs_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
517fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200518
519ecs_api_edp_get_producer_status 200 prod-c ENABLED
520
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100521
522## Delete job3 and prod-b and re-create if different order
523
524# Delete job then producer
525ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100526if [ $ECS_VERSION == "V1-1" ]; then
527 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
528else
529 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
530fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100531
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100532if [ -z "$FLAT_A1_EI" ]; then
533 ecs_api_a1_delete_job 204 type2 job3
534else
535 ecs_api_a1_delete_job 204 job3
536fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200537
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100538ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100539if [ $ECS_VERSION == "V1-1" ]; then
540 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
541else
542 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
543fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100544
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200545ecs_api_edp_delete_producer 204 prod-b
546
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100547ecs_api_edp_get_producer_status 404 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200548
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100549ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100550if [ $ECS_VERSION == "V1-1" ]; then
551 ecs_api_edp_get_producer_ids 200 prod-a prod-c
552else
553 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
554fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200555
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100556prodstub_equal delete/prod-b/job3 1
557
558if [ -z "$FLAT_A1_EI" ]; then
559 ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
560else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100561 if [ $ECS_VERSION == "V1-1" ]; then
562 ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
563 else
564 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
565 ecs_api_a1_get_job_status 200 job3 DISABLED
566 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100567fi
568
569# Put producer then job
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100570if [ $ECS_VERSION == "V1-1" ]; then
571 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
572else
573 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
574fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100575
576ecs_api_edp_get_producer_status 200 prod-b ENABLED
577
578if [ -z "$FLAT_A1_EI" ]; then
579 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
580 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
581else
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100582 if [ $ECS_VERSION == "V1-1" ]; then
583 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
584 else
585 ecs_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
586 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100587 ecs_api_a1_get_job_status 200 job3 ENABLED
588fi
589
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100590if [ $ECS_VERSION == "V1-1" ]; then
591 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
592else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200593 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
594 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
595 else
596 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
597 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100598fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100599
600ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100601if [ $ECS_VERSION == "V1-1" ]; then
602 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
603else
604 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
605fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100606
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100607if [ $ECS_VERSION == "V1-1" ]; then
608 prodstub_equal create/prod-b/job3 2
609else
610 prodstub_equal create/prod-b/job3 3
611fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100612prodstub_equal delete/prod-b/job3 1
613
614# Delete only the producer
615ecs_api_edp_delete_producer 204 prod-b
616
617ecs_api_edp_get_producer_status 404 prod-b
618
619ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100620if [ $ECS_VERSION == "V1-1" ]; then
621 ecs_api_edp_get_producer_ids 200 prod-a prod-c
622else
623 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
624fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100625
626if [ -z "$FLAT_A1_EI" ]; then
627 ecs_api_a1_get_job_status 200 type2 job3 DISABLED
628else
629 ecs_api_a1_get_job_status 200 job3 DISABLED
630fi
631
632cr_equal received_callbacks 1 30
633cr_equal received_callbacks?id=job3-status 1
634cr_api_check_all_ecs_events 200 job3-status DISABLED
635
636# Re-create the producer
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100637if [ $ECS_VERSION == "V1-1" ]; then
638 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
639else
640 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
641fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100642
643ecs_api_edp_get_producer_status 200 prod-b ENABLED
644
645if [ -z "$FLAT_A1_EI" ]; then
646 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
647else
648 ecs_api_a1_get_job_status 200 job3 ENABLED
649fi
650
651cr_equal received_callbacks 2 30
652cr_equal received_callbacks?id=job3-status 2
653cr_api_check_all_ecs_events 200 job3-status ENABLED
654
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100655if [ $ECS_VERSION == "V1-1" ]; then
656 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
657else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200658 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
659 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
660 else
661 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
662 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100663fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100664
665## Setup prod-d
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100666if [ $ECS_VERSION == "V1-1" ]; then
667 ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
668else
669 ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-1.json
670 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
671fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200672
673ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
674
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100675if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100676 ecs_api_a1_put_job 201 type4 job8 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100677else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100678 ecs_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100679fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100680
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100681if [ $ECS_VERSION == "V1-1" ]; then
682 prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
683else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200684 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
685 prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
686 else
687 prodstub_check_jobdata_3 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
688 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100689fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100690
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200691prodstub_equal create/prod-d/job8 1
692prodstub_equal delete/prod-d/job8 0
693
694ecs_api_a1_get_job_ids 200 type4 NOWNER job8
695
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100696if [ -z "$FLAT_A1_EI" ]; then
697 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
698else
699 ecs_api_a1_get_job_status 200 job8 ENABLED
700fi
701
702# Re-PUT the producer with zero types
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100703if [ $ECS_VERSION == "V1-1" ]; then
704 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
705else
706 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
707fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200708
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100709if [ -z "$FLAT_A1_EI" ]; then
710 ecs_api_a1_get_job_ids 404 type4 NOWNER
711else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100712 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
713 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100714fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200715
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100716if [ -z "$FLAT_A1_EI" ]; then
717 ecs_api_a1_get_job_status 200 type4 job8 DISABLED
718else
719 ecs_api_a1_get_job_status 200 job8 DISABLED
720fi
721
722cr_equal received_callbacks 3 30
723cr_equal received_callbacks?id=job8-status 1
724cr_api_check_all_ecs_events 200 job8-status DISABLED
725
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200726prodstub_equal create/prod-d/job8 1
727prodstub_equal delete/prod-d/job8 0
728
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100729## Re-setup prod-d
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100730if [ $ECS_VERSION == "V1-1" ]; then
731 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
732else
733 ecs_api_edp_put_type_2 200 type4 testdata/ecs/ei-type-4.json
734 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
735fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100736
737if [ -z "$FLAT_A1_EI" ]; then
738 ecs_api_a1_get_job_ids 404 type4 NOWNER
739else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100740 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
741 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100742fi
743
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100744if [ -z "$FLAT_A1_EI" ]; then
745 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
746else
747 ecs_api_a1_get_job_status 200 job8 ENABLED
748fi
749
750ecs_api_edp_get_producer_status 200 prod-a ENABLED
751ecs_api_edp_get_producer_status 200 prod-b ENABLED
752ecs_api_edp_get_producer_status 200 prod-c ENABLED
753ecs_api_edp_get_producer_status 200 prod-d ENABLED
754
755cr_equal received_callbacks 4 30
756cr_equal received_callbacks?id=job8-status 2
757cr_api_check_all_ecs_events 200 job8-status ENABLED
758
759prodstub_equal create/prod-d/job8 2
760prodstub_equal delete/prod-d/job8 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100761
762
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100763## Setup prod-e
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100764if [ $ECS_VERSION == "V1-1" ]; then
765 ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
766else
767 ecs_api_edp_put_type_2 201 type6 testdata/ecs/ei-type-6.json
768 ecs_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6
769fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100770
771ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY
772
773if [ -z "$FLAT_A1_EI" ]; then
774 ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
775else
776 ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json
777fi
778
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100779if [ $ECS_VERSION == "V1-1" ]; then
780 prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
781else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200782 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
783 prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
784 else
785 prodstub_check_jobdata_3 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
786 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100787fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100788
789prodstub_equal create/prod-e/job10 1
790prodstub_equal delete/prod-e/job10 0
791
792ecs_api_a1_get_job_ids 200 type6 NOWNER job10
793
794if [ -z "$FLAT_A1_EI" ]; then
795 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
796else
797 ecs_api_a1_get_job_status 200 job10 ENABLED
798fi
799
800## Setup prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100801if [ $ECS_VERSION == "V1-1" ]; then
802 ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
803else
804 ecs_api_edp_put_type_2 200 type6 testdata/ecs/ei-type-6.json
805 ecs_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6
806fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100807
808ecs_api_a1_get_job_ids 200 type6 NOWNER job10
809
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100810if [ $ECS_VERSION == "V1-1" ]; then
811 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
812else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200813 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
814 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
815 else
816 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
817 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100818fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100819
820prodstub_equal create/prod-f/job10 1
821prodstub_equal delete/prod-f/job10 0
822
823ecs_api_a1_get_job_ids 200 type6 NOWNER job10
824
825if [ -z "$FLAT_A1_EI" ]; then
826 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
827else
828 ecs_api_a1_get_job_status 200 job10 ENABLED
829fi
830
831## Status updates prod-a and jobs
832
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100833if [ $ECS_VERSION == "V1-1" ]; then
834 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
835else
836 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
837fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100838
839ecs_api_edp_get_producer_status 200 prod-a ENABLED
840ecs_api_edp_get_producer_status 200 prod-b ENABLED
841ecs_api_edp_get_producer_status 200 prod-c ENABLED
842ecs_api_edp_get_producer_status 200 prod-d ENABLED
843ecs_api_edp_get_producer_status 200 prod-e ENABLED
844ecs_api_edp_get_producer_status 200 prod-f ENABLED
845
846# Arm producer prod-a for supervision failure
847prodstub_arm_producer 200 prod-a 400
848
849# Wait for producer prod-a to go disabled
850ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
851
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100852if [ $ECS_VERSION == "V1-1" ]; then
853 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
854else
855 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
856fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100857
858ecs_api_edp_get_producer_status 200 prod-a DISABLED
859ecs_api_edp_get_producer_status 200 prod-b ENABLED
860ecs_api_edp_get_producer_status 200 prod-c ENABLED
861ecs_api_edp_get_producer_status 200 prod-d ENABLED
862ecs_api_edp_get_producer_status 200 prod-e ENABLED
863ecs_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100864
865
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100866if [ -z "$FLAT_A1_EI" ]; then
867 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
868 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
869 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
870 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
871 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
872else
873 ecs_api_a1_get_job_status 200 job1 ENABLED
874 ecs_api_a1_get_job_status 200 job2 ENABLED
875 ecs_api_a1_get_job_status 200 job3 ENABLED
876 ecs_api_a1_get_job_status 200 job8 ENABLED
877 ecs_api_a1_get_job_status 200 job10 ENABLED
878fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100879
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100880# Arm producer prod-a for supervision
881prodstub_arm_producer 200 prod-a 200
882
883# Wait for producer prod-a to go enabled
884ecs_api_edp_get_producer_status 200 prod-a ENABLED 360
885
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100886if [ $ECS_VERSION == "V1-1" ]; then
887 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
888else
889 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
890fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100891
892ecs_api_edp_get_producer_status 200 prod-a ENABLED
893ecs_api_edp_get_producer_status 200 prod-b ENABLED
894ecs_api_edp_get_producer_status 200 prod-c ENABLED
895ecs_api_edp_get_producer_status 200 prod-d ENABLED
896ecs_api_edp_get_producer_status 200 prod-e ENABLED
897ecs_api_edp_get_producer_status 200 prod-f ENABLED
898
899if [ -z "$FLAT_A1_EI" ]; then
900 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
901 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
902 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
903 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
904 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
905else
906 ecs_api_a1_get_job_status 200 job1 ENABLED
907 ecs_api_a1_get_job_status 200 job2 ENABLED
908 ecs_api_a1_get_job_status 200 job3 ENABLED
909 ecs_api_a1_get_job_status 200 job8 ENABLED
910 ecs_api_a1_get_job_status 200 job10 ENABLED
911fi
912
913# Arm producer prod-a for supervision failure
914prodstub_arm_producer 200 prod-a 400
915
916# Wait for producer prod-a to go disabled
917ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
918
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100919if [ $ECS_VERSION == "V1-1" ]; then
920 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
921else
922 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
923fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100924
925ecs_api_edp_get_producer_status 200 prod-a DISABLED
926ecs_api_edp_get_producer_status 200 prod-b ENABLED
927ecs_api_edp_get_producer_status 200 prod-c ENABLED
928ecs_api_edp_get_producer_status 200 prod-d ENABLED
929ecs_api_edp_get_producer_status 200 prod-e ENABLED
930ecs_api_edp_get_producer_status 200 prod-f ENABLED
931
932if [ -z "$FLAT_A1_EI" ]; then
933 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
934 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
935 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
936 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
937 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
938else
939 ecs_api_a1_get_job_status 200 job1 ENABLED
940 ecs_api_a1_get_job_status 200 job2 ENABLED
941 ecs_api_a1_get_job_status 200 job3 ENABLED
942 ecs_api_a1_get_job_status 200 job8 ENABLED
943 ecs_api_a1_get_job_status 200 job10 ENABLED
944fi
945
946# Wait for producer prod-a to be removed
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200947if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
948 ecs_equal json:data-producer/v1/info-producers 5 1000
949else
950 ecs_equal json:ei-producer/v1/eiproducers 5 1000
951fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100952
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100953if [ $ECS_VERSION == "V1-1" ]; then
954 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
955else
956 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
957fi
958
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100959
960ecs_api_edp_get_producer_status 404 prod-a
961ecs_api_edp_get_producer_status 200 prod-b ENABLED
962ecs_api_edp_get_producer_status 200 prod-c ENABLED
963ecs_api_edp_get_producer_status 200 prod-d ENABLED
964ecs_api_edp_get_producer_status 200 prod-e ENABLED
965ecs_api_edp_get_producer_status 200 prod-f ENABLED
966
967if [ -z "$FLAT_A1_EI" ]; then
968 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
969 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
970 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
971 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
972 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
973else
974 ecs_api_a1_get_job_status 200 job1 DISABLED
975 ecs_api_a1_get_job_status 200 job2 DISABLED
976 ecs_api_a1_get_job_status 200 job3 ENABLED
977 ecs_api_a1_get_job_status 200 job8 ENABLED
978 ecs_api_a1_get_job_status 200 job10 ENABLED
979fi
980
981cr_equal received_callbacks 6 30
982cr_equal received_callbacks?id=job1-status 1
983cr_equal received_callbacks?id=job2-status 1
984
985cr_api_check_all_ecs_events 200 job1-status DISABLED
986cr_api_check_all_ecs_events 200 job2-status DISABLED
987
988
989# Arm producer prod-e for supervision failure
990prodstub_arm_producer 200 prod-e 400
991
992ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000
993
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100994if [ $ECS_VERSION == "V1-1" ]; then
995 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
996else
997 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
998fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100999
1000ecs_api_edp_get_producer_status 404 prod-a
1001ecs_api_edp_get_producer_status 200 prod-b ENABLED
1002ecs_api_edp_get_producer_status 200 prod-c ENABLED
1003ecs_api_edp_get_producer_status 200 prod-d ENABLED
1004ecs_api_edp_get_producer_status 200 prod-e DISABLED
1005ecs_api_edp_get_producer_status 200 prod-f ENABLED
1006
1007if [ -z "$FLAT_A1_EI" ]; then
1008 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1009 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1010 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1011 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1012 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1013else
1014 ecs_api_a1_get_job_status 200 job1 DISABLED
1015 ecs_api_a1_get_job_status 200 job2 DISABLED
1016 ecs_api_a1_get_job_status 200 job3 ENABLED
1017 ecs_api_a1_get_job_status 200 job8 ENABLED
1018 ecs_api_a1_get_job_status 200 job10 ENABLED
1019fi
1020
1021#Disable create for job10 in prod-e
1022prodstub_arm_job_create 200 prod-e job10 400
1023
1024#Update tjob 10 - only prod-f will be updated
1025if [ -z "$FLAT_A1_EI" ]; then
1026 ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1027else
1028 ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json
1029fi
1030#Reset producer and job responses
1031prodstub_arm_producer 200 prod-e 200
1032prodstub_arm_job_create 200 prod-e job10 200
1033
1034ecs_api_edp_get_producer_status 200 prod-e ENABLED 360
1035
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001036if [ $ECS_VERSION == "V1-1" ]; then
1037 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
1038else
1039 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
1040fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001041
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001042#Wait for job to be updated
1043sleep_wait 120
1044
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001045if [ $ECS_VERSION == "V1-1" ]; then
1046 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1047else
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001048 if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
1049 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1050 else
1051 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
1052 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001053fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001054
1055prodstub_arm_producer 200 prod-f 400
1056
1057ecs_api_edp_get_producer_status 200 prod-f DISABLED 360
1058
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001059if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1060 ecs_equal json:data-producer/v1/info-producers 4 1000
1061else
1062 ecs_equal json:ei-producer/v1/eiproducers 4 1000
1063fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001064
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001065if [ $ECS_VERSION == "V1-1" ]; then
1066 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
1067else
1068 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1069fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001070
1071ecs_api_edp_get_producer_status 404 prod-a
1072ecs_api_edp_get_producer_status 200 prod-b ENABLED
1073ecs_api_edp_get_producer_status 200 prod-c ENABLED
1074ecs_api_edp_get_producer_status 200 prod-d ENABLED
1075ecs_api_edp_get_producer_status 200 prod-e ENABLED
1076ecs_api_edp_get_producer_status 404 prod-f
1077
1078if [ -z "$FLAT_A1_EI" ]; then
1079 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1080 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1081 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1082 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1083 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1084else
1085 ecs_api_a1_get_job_status 200 job1 DISABLED
1086 ecs_api_a1_get_job_status 200 job2 DISABLED
1087 ecs_api_a1_get_job_status 200 job3 ENABLED
1088 ecs_api_a1_get_job_status 200 job8 ENABLED
1089 ecs_api_a1_get_job_status 200 job10 ENABLED
1090fi
1091
1092cr_equal received_callbacks 6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +02001093
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001094
1095if [[ "$ECS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
1096
1097 # End test if info types is not impl in tested version
1098 check_ecs_logs
1099
1100 store_logs END
1101
1102 #### TEST COMPLETE ####
1103
1104 print_result
1105
1106 auto_clean_environment
1107fi
1108
1109
1110############################################
1111# Test of info types
1112############################################
1113
1114### Setup prodstub sim to accept calls for producers, info types and jobs
1115## prod-ia type101
1116## prod-ib type101 and type102
1117## prod-ic no-type
1118## prod-id type104
1119## prod-ie type106
1120## prod-if type106
1121## prod-ig type150 (configured later)
1122## prod-ig type160 (configured later)
1123
1124## job101 -> prod-ia
1125## job102 -> prod-ia
1126## job103 -> prod-ib
1127## job104 -> prod-ia
1128## job106 -> prod-ib
1129## job108 -> prod-id
1130## job110 -> prod-ie and prod-if
1131## job150 -> prod-ig (configured later)
1132
1133prodstub_arm_producer 200 prod-ia
1134prodstub_arm_producer 200 prod-ib
1135prodstub_arm_producer 200 prod-ic
1136prodstub_arm_producer 200 prod-id
1137prodstub_arm_producer 200 prod-ie
1138prodstub_arm_producer 200 prod-if
1139
1140prodstub_arm_type 200 prod-ia type101
1141prodstub_arm_type 200 prod-ib type102
1142prodstub_arm_type 200 prod-ib type103
1143prodstub_arm_type 200 prod-id type104
1144prodstub_arm_type 200 prod-ie type106
1145prodstub_arm_type 200 prod-if type106
1146
1147prodstub_disarm_type 200 prod-ib type103
1148prodstub_arm_type 200 prod-ib type101
1149prodstub_disarm_type 200 prod-ib type101
1150
1151
1152prodstub_arm_job_create 200 prod-ia job101
1153prodstub_arm_job_create 200 prod-ia job102
1154prodstub_arm_job_create 200 prod-ib job103
1155
1156prodstub_arm_job_delete 200 prod-ia job101
1157prodstub_arm_job_delete 200 prod-ia job102
1158prodstub_arm_job_delete 200 prod-ib job103
1159
1160prodstub_arm_job_create 200 prod-ib job104
1161prodstub_arm_job_create 200 prod-ia job104
1162
1163prodstub_arm_job_create 200 prod-ib job106
1164
1165prodstub_arm_job_create 200 prod-id job108
1166
1167prodstub_arm_job_create 200 prod-ie job110
1168prodstub_arm_job_create 200 prod-if job110
1169
1170
1171# NOTE: types, jobs and producers are still present related to eitypes
1172
1173
1174### Initial tests - no config made
1175### GET: type ids, types, producer ids, producers, job ids, jobs
1176### DELETE: jobs
1177ecs_api_idc_get_type_ids 200 type1 type2 type4 type6
1178ecs_api_idc_get_type 404 test-type
1179
1180ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1181ecs_api_edp_get_type_2 404 test-type
1182
1183ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1184ecs_api_edp_get_producer_2 404 test-prod
1185ecs_api_edp_get_producer_status 404 test-prod
1186
1187ecs_api_edp_delete_producer 404 test-prod
1188
1189ecs_api_idc_get_job_ids 200 test-type NOWNER EMPTY
1190ecs_api_idc_get_job_ids 200 test-type test-owner EMPTY
1191
1192ecs_api_idc_get_job 404 test-job
1193
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001194ecs_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001195
1196ecs_api_idc_delete_job 404 test-job
1197
1198ecs_api_edp_get_producer_jobs_2 404 test-prod
1199
1200ecs_api_edp_get_type_2 404 test-type
1201ecs_api_edp_delete_type_2 404 test-type
1202
1203### Setup of producer/job and testing apis ###
1204
1205## Setup prod-ia
1206ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1207ecs_api_edp_get_type_2 404 type101
1208ecs_api_edp_put_producer_2 404 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1209
1210# Create type, delete and create again
1211ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
1212ecs_api_edp_get_type_2 200 type101
1213ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1214ecs_api_edp_delete_type_2 204 type101
1215ecs_api_edp_get_type_2 404 type101
1216ecs_api_edp_get_type_ids 200 type1 type2 type4 type6
1217ecs_api_edp_put_type_2 201 type101 testdata/ecs/info-type-1.json
1218ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1219ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1220
1221ecs_api_edp_put_producer_2 201 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1222ecs_api_edp_put_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1223
1224ecs_api_edp_delete_type_2 406 type101
1225
1226
1227#ecs_api_idc_get_type_ids 200 type101
1228#ecs_api_idc_get_type 200 type101 testdata/ecs/empty-type.json
1229
1230ecs_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1231ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1232
1233ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-b prod-c prod-d prod-e
1234ecs_api_edp_get_producer_ids_2 200 type101 prod-ia
1235ecs_api_edp_get_producer_ids_2 200 type102 EMPTY
1236
1237ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1238
1239ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1240
1241ecs_api_idc_get_job_ids 200 type101 NOWNER EMPTY
1242ecs_api_idc_get_job_ids 200 type101 test-owner EMPTY
1243
1244ecs_api_idc_get_job 404 test-job
1245
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001246ecs_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001247ecs_api_edp_get_producer_jobs_2 200 prod-ia EMPTY
1248
1249## Create a job for prod-ia
1250## job101 - prod-ia
1251ecs_api_idc_put_job 201 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ecs/job-template.json VALIDATE
1252
1253# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001254prodstub_check_jobdata_3 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001255
1256ecs_api_idc_get_job_ids 200 type101 NOWNER job101
1257ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1258
1259ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job1 job2 job3 job8 job10
1260
1261ecs_api_idc_get_job 200 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ecs/job-template.json
1262
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001263ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001264
1265prodstub_equal create/prod-ia/job101 1
1266
1267ecs_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ecs/job-template.json
1268
1269## Create a second job for prod-ia
1270## job102 - prod-ia
1271ecs_api_idc_put_job 201 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ecs/job-template.json VALIDATE
1272
1273# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001274prodstub_check_jobdata_3 200 prod-ia job102 type101 $TARGET102 info-owner-2 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001275ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1276ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1277ecs_api_idc_get_job_ids 200 type101 info-owner-2 job102
1278ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1279
1280ecs_api_idc_get_job 200 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ecs/job-template.json
1281
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001282ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001283
1284prodstub_equal create/prod-ia/job102 1
1285
1286ecs_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
1287
1288
1289## Setup prod-ib
1290ecs_api_edp_put_type_2 201 type102 testdata/ecs/info-type-2.json
1291ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1292
1293
1294ecs_api_idc_get_type_ids 200 type101 type102 type1 type2 type4 type6
1295
1296ecs_api_idc_get_type 200 type101 testdata/ecs/info-type-1.json
1297
1298ecs_api_idc_get_type 200 type102 testdata/ecs/info-type-2.json
1299
1300ecs_api_edp_get_type_ids 200 type101 type102 type1 type2 type4 type6
1301ecs_api_edp_get_type_2 200 type101 testdata/ecs/info-type-1.json
1302ecs_api_edp_get_type_2 200 type102 testdata/ecs/info-type-2.json
1303
1304ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-b prod-c prod-d prod-e
1305
1306ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1307ecs_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1308
1309ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1310
1311## Create job for prod-ib
1312## job103 - prod-ib
1313ecs_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json VALIDATE
1314
1315prodstub_equal create/prod-ib/job103 1
1316
1317# Check the job data in the producer
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001318prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001319
1320ecs_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1321ecs_api_idc_get_job_ids 200 type102 NOWNER job103
1322ecs_api_idc_get_job_ids 200 type101 info-owner-1 job101
1323ecs_api_idc_get_job_ids 200 type101 info-owner-2 job102
1324ecs_api_idc_get_job_ids 200 type102 info-owner-3 job103
1325
1326ecs_api_idc_get_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json
1327
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001328ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001329
1330ecs_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
1331ecs_api_edp_get_producer_jobs_2 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template.json
1332
1333## Setup prod-ic (no types)
1334ecs_api_edp_put_producer_2 201 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic NOTYPE
1335
1336ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1337
1338ecs_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1339ecs_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1340ecs_api_edp_get_producer_2 200 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic EMPTY
1341
1342ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1343
1344
1345## Delete job103 and prod-ib and re-create if different order
1346
1347# Delete job then producer
1348ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1349ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1350
1351ecs_api_idc_delete_job 204 job103
1352
1353ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1354ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1355
1356ecs_api_edp_delete_producer 204 prod-ib
1357
1358ecs_api_edp_get_producer_status 404 prod-ib
1359
1360ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1361ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
1362
1363prodstub_equal delete/prod-ib/job103 1
1364
1365ecs_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001366ecs_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001367
1368# Put producer then job
1369ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1370
1371ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1372
1373ecs_api_idc_put_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ecs/job-template2.json VALIDATE
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001374ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001375
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001376prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001377
1378ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1379ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
1380
1381prodstub_equal create/prod-ib/job103 3
1382prodstub_equal delete/prod-ib/job103 1
1383
1384# Delete only the producer
1385ecs_api_edp_delete_producer 204 prod-ib
1386
1387ecs_api_edp_get_producer_status 404 prod-ib
1388
1389ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1390ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
1391
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001392ecs_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001393
1394cr_equal received_callbacks 7 30
1395cr_equal received_callbacks?id=info-job103-status 1
1396cr_api_check_all_ecs_events 200 info-job103-status DISABLED
1397
1398# Re-create the producer
1399ecs_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1400
1401ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1402
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001403ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001404
1405cr_equal received_callbacks 8 30
1406cr_equal received_callbacks?id=info-job103-status 2
1407cr_api_check_all_ecs_events 200 info-job103-status ENABLED
1408
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001409prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001410
1411## Setup prod-id
1412ecs_api_edp_put_type_2 201 type104 testdata/ecs/info-type-4.json
1413ecs_api_edp_put_producer_2 201 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
1414
1415ecs_api_idc_get_job_ids 200 type104 NOWNER EMPTY
1416
1417ecs_api_idc_put_job 201 job108 type104 $TARGET108 info-owner-4 $INFOSTATUS108 testdata/ecs/job-template.json VALIDATE
1418
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001419prodstub_check_jobdata_3 200 prod-id job108 type104 $TARGET108 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001420
1421prodstub_equal create/prod-id/job108 1
1422prodstub_equal delete/prod-id/job108 0
1423
1424ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1425
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001426ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001427
1428# Re-PUT the producer with zero types
1429ecs_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id NOTYPE
1430
1431ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1432ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
1433
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001434ecs_api_idc_get_job_status2 200 job108 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001435
1436cr_equal received_callbacks 9 30
1437cr_equal received_callbacks?id=info-job108-status 1
1438cr_api_check_all_ecs_events 200 info-job108-status DISABLED
1439
1440prodstub_equal create/prod-id/job108 1
1441prodstub_equal delete/prod-id/job108 0
1442
1443## Re-setup prod-id
1444ecs_api_edp_put_type_2 200 type104 testdata/ecs/info-type-4.json
1445ecs_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
1446
1447ecs_api_idc_get_job_ids 200 type104 NOWNER job108
1448ecs_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
1449
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001450ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001451
1452ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1453ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1454ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1455ecs_api_edp_get_producer_status 200 prod-id ENABLED
1456
1457cr_equal received_callbacks 10 30
1458cr_equal received_callbacks?id=info-job108-status 2
1459cr_api_check_all_ecs_events 200 info-job108-status ENABLED
1460
1461prodstub_equal create/prod-id/job108 2
1462prodstub_equal delete/prod-id/job108 0
1463
1464
1465## Setup prod-ie
1466ecs_api_edp_put_type_2 201 type106 testdata/ecs/info-type-6.json
1467ecs_api_edp_put_producer_2 201 prod-ie $CB_JOB/prod-ie $CB_SV/prod-ie type106
1468
1469ecs_api_idc_get_job_ids 200 type106 NOWNER EMPTY
1470
1471ecs_api_idc_put_job 201 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ecs/job-template.json VALIDATE
1472
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001473prodstub_check_jobdata_3 200 prod-ie job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001474
1475prodstub_equal create/prod-ie/job110 1
1476prodstub_equal delete/prod-ie/job110 0
1477
1478ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1479
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001480ecs_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001481
1482## Setup prod-if
1483ecs_api_edp_put_type_2 200 type106 testdata/ecs/info-type-6.json
1484ecs_api_edp_put_producer_2 201 prod-if $CB_JOB/prod-if $CB_SV/prod-if type106
1485
1486ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1487
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001488prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001489
1490prodstub_equal create/prod-if/job110 1
1491prodstub_equal delete/prod-if/job110 0
1492
1493ecs_api_idc_get_job_ids 200 type106 NOWNER job110
1494
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001495ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001496
1497## Status updates prod-ia and jobs
1498
1499ecs_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
1500
1501ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1502ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1503ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1504ecs_api_edp_get_producer_status 200 prod-id ENABLED
1505ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1506ecs_api_edp_get_producer_status 200 prod-if ENABLED
1507
1508# Arm producer prod-ia for supervision failure
1509prodstub_arm_producer 200 prod-ia 400
1510
1511# Wait for producer prod-ia to go disabled
1512ecs_api_edp_get_producer_status 200 prod-ia DISABLED 360
1513
1514ecs_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
1515
1516ecs_api_edp_get_producer_status 200 prod-ia DISABLED
1517ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1518ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1519ecs_api_edp_get_producer_status 200 prod-id ENABLED
1520ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1521ecs_api_edp_get_producer_status 200 prod-if ENABLED
1522
1523
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001524ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1525ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1526ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1527ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1528ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001529
1530# Arm producer prod-ia for supervision
1531prodstub_arm_producer 200 prod-ia 200
1532
1533# Wait for producer prod-ia to go enabled
1534ecs_api_edp_get_producer_status 200 prod-ia ENABLED 360
1535
1536ecs_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
1537
1538ecs_api_edp_get_producer_status 200 prod-ia ENABLED
1539ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1540ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1541ecs_api_edp_get_producer_status 200 prod-id ENABLED
1542ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1543ecs_api_edp_get_producer_status 200 prod-if ENABLED
1544
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001545ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1546ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1547ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1548ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1549ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001550
1551# Arm producer prod-ia for supervision failure
1552prodstub_arm_producer 200 prod-ia 400
1553
1554# Wait for producer prod-ia to go disabled
1555ecs_api_edp_get_producer_status 200 prod-ia DISABLED 360
1556
1557ecs_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
1558
1559ecs_api_edp_get_producer_status 200 prod-ia DISABLED
1560ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1561ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1562ecs_api_edp_get_producer_status 200 prod-id ENABLED
1563ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1564ecs_api_edp_get_producer_status 200 prod-if ENABLED
1565
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001566ecs_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1567ecs_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1568ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1569ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1570ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001571
1572# Wait for producer prod-ia to be removed
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001573if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1574 ecs_equal json:data-producer/v1/info-producers 9 1000
1575else
1576 ecs_equal json:ei-producer/v1/eiproducers 9 1000
1577fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001578
1579ecs_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
1580
1581
1582ecs_api_edp_get_producer_status 404 prod-ia
1583ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1584ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1585ecs_api_edp_get_producer_status 200 prod-id ENABLED
1586ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1587ecs_api_edp_get_producer_status 200 prod-if ENABLED
1588
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001589ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1590ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1591ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1592ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1593ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001594
1595cr_equal received_callbacks 12 30
1596cr_equal received_callbacks?id=info-job101-status 1
1597cr_equal received_callbacks?id=info-job102-status 1
1598
1599cr_api_check_all_ecs_events 200 info-job101-status DISABLED
1600cr_api_check_all_ecs_events 200 info-job102-status DISABLED
1601
1602
1603# Arm producer prod-ie for supervision failure
1604prodstub_arm_producer 200 prod-ie 400
1605
1606ecs_api_edp_get_producer_status 200 prod-ie DISABLED 1000
1607
1608ecs_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
1609
1610ecs_api_edp_get_producer_status 404 prod-ia
1611ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1612ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1613ecs_api_edp_get_producer_status 200 prod-id ENABLED
1614ecs_api_edp_get_producer_status 200 prod-ie DISABLED
1615ecs_api_edp_get_producer_status 200 prod-if ENABLED
1616
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001617ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1618ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1619ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1620ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1621ecs_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001622
1623#Disable create for job110 in prod-ie
1624prodstub_arm_job_create 200 prod-ie job110 400
1625
1626#Update tjob 10 - only prod-if will be updated
1627ecs_api_idc_put_job 200 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ecs/job-template2.json VALIDATE
1628#Reset producer and job responses
1629prodstub_arm_producer 200 prod-ie 200
1630prodstub_arm_job_create 200 prod-ie job110 200
1631
1632ecs_api_edp_get_producer_status 200 prod-ie ENABLED 360
1633
1634ecs_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
1635
1636#Wait for job to be updated
1637sleep_wait 120
1638
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001639prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ecs/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001640
1641prodstub_arm_producer 200 prod-if 400
1642
1643ecs_api_edp_get_producer_status 200 prod-if DISABLED 360
1644
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001645if [[ "$ECS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1646 ecs_equal json:data-producer/v1/info-producers 8 1000
1647else
1648 ecs_equal json:ei-producer/v1/eiproducers 8 1000
1649fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001650
1651ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-b prod-c prod-d prod-e
1652
1653ecs_api_edp_get_producer_status 404 prod-ia
1654ecs_api_edp_get_producer_status 200 prod-ib ENABLED
1655ecs_api_edp_get_producer_status 200 prod-ic ENABLED
1656ecs_api_edp_get_producer_status 200 prod-id ENABLED
1657ecs_api_edp_get_producer_status 200 prod-ie ENABLED
1658ecs_api_edp_get_producer_status 404 prod-if
1659
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001660ecs_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1661ecs_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1662ecs_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1663ecs_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1664ecs_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001665
1666cr_equal received_callbacks 12
1667
1668### Test of pre and post validation
1669
1670ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
1671ecs_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1672ecs_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ecs/job-template.json
1673
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001674ecs_api_idc_get_job_status2 404 job150
1675ecs_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001676
1677prodstub_arm_producer 200 prod-ig
1678prodstub_arm_job_create 200 prod-ig job150
1679prodstub_arm_job_create 200 prod-ig job160
1680
1681ecs_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
1682ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1683
1684ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
1685
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001686ecs_api_idc_get_job_status2 404 job150
1687ecs_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001688
1689prodstub_arm_type 200 prod-ig type160
1690
1691ecs_api_edp_put_type_2 201 type160 testdata/ecs/info-type-60.json
1692ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160
1693
1694ecs_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1695ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1696ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1697
1698ecs_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1699
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001700ecs_api_idc_get_job_status2 404 job150
1701ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001702
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001703prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ecs/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001704
1705prodstub_equal create/prod-ig/job160 1
1706prodstub_equal delete/prod-ig/job160 0
1707
1708prodstub_arm_type 200 prod-ig type150
1709
1710ecs_api_edp_put_type_2 201 type150 testdata/ecs/info-type-50.json
1711ecs_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160 type150
1712
1713ecs_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1714ecs_api_edp_get_producer_status 200 prod-ig ENABLED 360
1715
1716ecs_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1717
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001718ecs_api_idc_get_job_status2 404 job150
1719ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001720
1721ecs_api_idc_put_job 201 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ecs/job-template.json VALIDATE
1722
BjornMagnussonXAe45cd2c2021-06-18 09:00:49 +02001723ecs_api_idc_get_job_status2 200 job150 ENABLED 1 prod-ig 60
1724ecs_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001725
1726cr_equal received_callbacks 12
1727
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +02001728check_ecs_logs
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001729
1730store_logs END
1731
1732#### TEST COMPLETE ####
1733
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001734print_result
1735
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001736auto_clean_environment