blob: fa30fef519bf342d43654bd9a9fca3e8da8196a4 [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
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010021TC_ONELINE_DESCR="ECS full intefaces 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
24DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP"
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
27KUBE_INCLUDED_IMAGES=" PRODSTUB CR ECS RICSIM CP "
28#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
29KUBE_PRESTARTED_IMAGES=" "
30
31#Supported test environment profiles
BjornMagnussonXA89b64ab2020-12-16 09:21:01 +010032SUPPORTED_PROFILES="ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010033#Supported run modes
34SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020035
36. ../common/testcase_common.sh $@
37. ../common/ecs_api_functions.sh
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020038. ../common/prodstub_api_functions.sh
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010039. ../common/cr_api_functions.sh
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010040. ../common/control_panel_api_functions.sh
41. ../common/controller_api_functions.sh
42. ../common/ricsimulator_api_functions.sh
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020043
44#### TEST BEGIN ####
45
BjornMagnussonXA4207b832020-11-03 09:52:49 +010046FLAT_A1_EI="1"
47
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010048clean_environment
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020049
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010050use_ecs_rest_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020051
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010052use_prod_stub_https
53
54use_simulator_https
55
56use_cr_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020057
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010058start_ecs $SIM_GROUP/$ECS_COMPOSE_DIR/application.yaml
59
60if [ $RUNMODE == "KUBE" ]; then
61 ecs_api_admin_reset
62fi
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020063
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020064start_prod_stub
65
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020066set_ecs_trace
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020067
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010068start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010069
70if [ "$PMS_VERSION" == "V2" ]; then
71 start_ric_simulators ricsim_g3 4 STD_2.0.0
72fi
73
74start_cr
75
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010076CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
77CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010078TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
79TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
80TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
81TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
82TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
83
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010084STATUS1="$CR_SERVICE_PATH/job1-status"
85STATUS2="$CR_SERVICE_PATH/job2-status"
86STATUS3="$CR_SERVICE_PATH/job3-status"
87STATUS8="$CR_SERVICE_PATH/job8-status"
88STATUS10="$CR_SERVICE_PATH/job10-status"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010089
90### Setup prodstub sim to accept calls for producers, types and jobs
91## prod-a type1
92## prod-b type1 and type2
93## prod-c no-type
94## prod-d type4
95## prod-e type6
96## prod-f type6
97
98## job1 -> prod-a
99## job2 -> prod-a
100## job3 -> prod-b
101## job4 -> prod-a
102## job6 -> prod-b
103## job8 -> prod-d
104## job10 -> prod-e and prod-f
105
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200106prodstub_arm_producer 200 prod-a
107prodstub_arm_producer 200 prod-b
108prodstub_arm_producer 200 prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200109prodstub_arm_producer 200 prod-d
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100110prodstub_arm_producer 200 prod-e
111prodstub_arm_producer 200 prod-f
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200112
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200113prodstub_arm_type 200 prod-a type1
114prodstub_arm_type 200 prod-b type2
115prodstub_arm_type 200 prod-b type3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100116prodstub_arm_type 200 prod-d type4
117prodstub_arm_type 200 prod-e type6
118prodstub_arm_type 200 prod-f type6
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200119
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200120prodstub_disarm_type 200 prod-b type3
121prodstub_arm_type 200 prod-b type1
122prodstub_disarm_type 200 prod-b type1
123
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100124
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200125prodstub_arm_job_create 200 prod-a job1
126prodstub_arm_job_create 200 prod-a job2
127prodstub_arm_job_create 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200128
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200129prodstub_arm_job_delete 200 prod-a job1
130prodstub_arm_job_delete 200 prod-a job2
131prodstub_arm_job_delete 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200132
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200133prodstub_arm_job_create 200 prod-b job4
134prodstub_arm_job_create 200 prod-a job4
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200135
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200136prodstub_arm_job_create 200 prod-b job6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200137
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100138prodstub_arm_job_create 200 prod-d job8
139
140prodstub_arm_job_create 200 prod-e job10
141prodstub_arm_job_create 200 prod-f job10
142
143### ecs status
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200144ecs_api_service_status 200
145
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100146cr_equal received_callbacks 0
147
148### Initial tests - no config made
149### GET: type ids, types, producer ids, producers, job ids, jobs
150### DELETE: jobs
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200151ecs_api_a1_get_type_ids 200 EMPTY
152ecs_api_a1_get_type 404 test-type
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200153
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200154ecs_api_edp_get_type_ids 200 EMPTY
155ecs_api_edp_get_type 404 test-type
156
157ecs_api_edp_get_producer_ids 200 EMPTY
158ecs_api_edp_get_producer 404 test-prod
159
160ecs_api_edp_get_producer_status 404 test-prod
161
162ecs_api_edp_delete_producer 404 test-prod
163
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100164if [ -z "$FLAT_A1_EI" ]; then
165 ecs_api_a1_get_job_ids 404 test-type NOWNER
166 ecs_api_a1_get_job_ids 404 test-type test-owner
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200167
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100168 ecs_api_a1_get_job 404 test-type test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200169
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100170 ecs_api_a1_get_job_status 404 test-type test-job
171else
172 ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY
173 ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200174
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100175 ecs_api_a1_get_job 404 test-job
176
177 ecs_api_a1_get_job_status 404 test-job
178fi
179
180if [ -z "$FLAT_A1_EI" ]; then
181 ecs_api_a1_delete_job 404 test-type test-job
182else
183 ecs_api_a1_delete_job 404 test-job
184fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200185
186ecs_api_edp_get_producer_jobs 404 test-prod
187
188
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100189### Setup of producer/job and testing apis ###
190
191## Setup prod-a
192ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
193ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
194
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200195
196ecs_api_a1_get_type_ids 200 type1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100197if [ -z "$FLAT_A1_EI" ]; then
198 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
199else
200 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
201fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200202
203ecs_api_edp_get_type_ids 200 type1
204ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
205
206ecs_api_edp_get_producer_ids 200 prod-a
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100207
208ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200209
210ecs_api_edp_get_producer_status 200 prod-a ENABLED
211
212ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
213ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
214
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100215if [ -z "$FLAT_A1_EI" ]; then
216 ecs_api_a1_get_job 404 type1 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200217
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100218 ecs_api_a1_get_job_status 404 type1 test-job
219else
220 ecs_api_a1_get_job 404 test-job
221
222 ecs_api_a1_get_job_status 404 test-job
223fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200224
225ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
226
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100227## Create a job for prod-a
228## job1 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100229if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100230 ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100231else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100232 ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100233fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200234
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100235# Check the job data in the producer
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100236prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200237
238ecs_api_a1_get_job_ids 200 type1 NOWNER job1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100239ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
240
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100241if [ ! -z "$FLAT_A1_EI" ]; then
242 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1
243fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200244
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100245if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100246 ecs_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200247
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100248 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
249else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100250 ecs_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100251
252 ecs_api_a1_get_job_status 200 job1 ENABLED
253fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200254
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100255prodstub_equal create/prod-a/job1 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200256
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100257ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200258
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100259## Create a second job for prod-a
260## job2 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100261if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100262 ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100263else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100264 ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100265fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200266
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100267# Check the job data in the producer
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100268prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200269
270ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100271ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
272ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100273if [ ! -z "$FLAT_A1_EI" ]; then
274 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
275fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200276
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100277if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100278 ecs_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200279
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100280 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
281else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100282 ecs_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100283
284 ecs_api_a1_get_job_status 200 job2 ENABLED
285fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200286
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100287prodstub_equal create/prod-a/job2 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200288
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100289ecs_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
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200290
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100291## Setup prod-b
292ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200293
294ecs_api_a1_get_type_ids 200 type1 type2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100295if [ -z "$FLAT_A1_EI" ]; then
296 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
297 ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
298else
299 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
300 ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json
301fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200302
303ecs_api_edp_get_type_ids 200 type1 type2
304ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
305ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
306
307ecs_api_edp_get_producer_ids 200 prod-a prod-b
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100308
309ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
310ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
311
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200312
313ecs_api_edp_get_producer_status 200 prod-b ENABLED
314
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100315## Create job for prod-b
316## job3 - prod-b
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100317if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100318 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100319else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100320 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100321fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200322
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100323prodstub_equal create/prod-b/job3 1
324
325# Check the job data in the producer
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100326prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200327
328ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
329ecs_api_a1_get_job_ids 200 type2 NOWNER job3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100330ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
331ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
332ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200333
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100334if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100335 ecs_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200336
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100337 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
338else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100339 ecs_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100340
341 ecs_api_a1_get_job_status 200 job3 ENABLED
342fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200343
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100344ecs_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
345ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200346
347
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100348## Setup prod-c (no types)
349ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
350
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200351
352ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100353
354ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
355ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
356ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200357
358ecs_api_edp_get_producer_status 200 prod-c ENABLED
359
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100360
361## Delete job3 and prod-b and re-create if different order
362
363# Delete job then producer
364ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
365ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
366
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100367if [ -z "$FLAT_A1_EI" ]; then
368 ecs_api_a1_delete_job 204 type2 job3
369else
370 ecs_api_a1_delete_job 204 job3
371fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200372
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100373ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
374ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
375
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200376ecs_api_edp_delete_producer 204 prod-b
377
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100378ecs_api_edp_get_producer_status 404 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200379
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100380ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
381ecs_api_edp_get_producer_ids 200 prod-a prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200382
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100383prodstub_equal delete/prod-b/job3 1
384
385if [ -z "$FLAT_A1_EI" ]; then
386 ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
387else
388 ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
389fi
390
391# Put producer then job
392ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
393
394ecs_api_edp_get_producer_status 200 prod-b ENABLED
395
396if [ -z "$FLAT_A1_EI" ]; then
397 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
398 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
399else
400 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
401 ecs_api_a1_get_job_status 200 job3 ENABLED
402fi
403
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100404prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100405
406ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
407ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
408
409prodstub_equal create/prod-b/job3 2
410prodstub_equal delete/prod-b/job3 1
411
412# Delete only the producer
413ecs_api_edp_delete_producer 204 prod-b
414
415ecs_api_edp_get_producer_status 404 prod-b
416
417ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
418ecs_api_edp_get_producer_ids 200 prod-a prod-c
419
420if [ -z "$FLAT_A1_EI" ]; then
421 ecs_api_a1_get_job_status 200 type2 job3 DISABLED
422else
423 ecs_api_a1_get_job_status 200 job3 DISABLED
424fi
425
426cr_equal received_callbacks 1 30
427cr_equal received_callbacks?id=job3-status 1
428cr_api_check_all_ecs_events 200 job3-status DISABLED
429
430# Re-create the producer
431ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
432
433ecs_api_edp_get_producer_status 200 prod-b ENABLED
434
435if [ -z "$FLAT_A1_EI" ]; then
436 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
437else
438 ecs_api_a1_get_job_status 200 job3 ENABLED
439fi
440
441cr_equal received_callbacks 2 30
442cr_equal received_callbacks?id=job3-status 2
443cr_api_check_all_ecs_events 200 job3-status ENABLED
444
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100445prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100446
447
448## Setup prod-d
449ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200450
451ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
452
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 type4 job8 $TARGET8 ricsim_g3_4 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 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100457fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100458
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100459prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100460
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200461prodstub_equal create/prod-d/job8 1
462prodstub_equal delete/prod-d/job8 0
463
464ecs_api_a1_get_job_ids 200 type4 NOWNER job8
465
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100466if [ -z "$FLAT_A1_EI" ]; then
467 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
468else
469 ecs_api_a1_get_job_status 200 job8 ENABLED
470fi
471
472# Re-PUT the producer with zero types
473ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200474
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100475if [ -z "$FLAT_A1_EI" ]; then
476 ecs_api_a1_get_job_ids 404 type4 NOWNER
477else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100478 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
479 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100480fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200481
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100482if [ -z "$FLAT_A1_EI" ]; then
483 ecs_api_a1_get_job_status 200 type4 job8 DISABLED
484else
485 ecs_api_a1_get_job_status 200 job8 DISABLED
486fi
487
488cr_equal received_callbacks 3 30
489cr_equal received_callbacks?id=job8-status 1
490cr_api_check_all_ecs_events 200 job8-status DISABLED
491
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200492prodstub_equal create/prod-d/job8 1
493prodstub_equal delete/prod-d/job8 0
494
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100495## Re-setup prod-d
496ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100497
498if [ -z "$FLAT_A1_EI" ]; then
499 ecs_api_a1_get_job_ids 404 type4 NOWNER
500else
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100501 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
502 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100503fi
504
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100505if [ -z "$FLAT_A1_EI" ]; then
506 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
507else
508 ecs_api_a1_get_job_status 200 job8 ENABLED
509fi
510
511ecs_api_edp_get_producer_status 200 prod-a ENABLED
512ecs_api_edp_get_producer_status 200 prod-b ENABLED
513ecs_api_edp_get_producer_status 200 prod-c ENABLED
514ecs_api_edp_get_producer_status 200 prod-d ENABLED
515
516cr_equal received_callbacks 4 30
517cr_equal received_callbacks?id=job8-status 2
518cr_api_check_all_ecs_events 200 job8-status ENABLED
519
520prodstub_equal create/prod-d/job8 2
521prodstub_equal delete/prod-d/job8 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100522
523
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100524## Setup prod-e
525ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
526
527ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY
528
529if [ -z "$FLAT_A1_EI" ]; then
530 ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
531else
532 ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json
533fi
534
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100535prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100536
537prodstub_equal create/prod-e/job10 1
538prodstub_equal delete/prod-e/job10 0
539
540ecs_api_a1_get_job_ids 200 type6 NOWNER job10
541
542if [ -z "$FLAT_A1_EI" ]; then
543 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
544else
545 ecs_api_a1_get_job_status 200 job10 ENABLED
546fi
547
548## Setup prod-f
549ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
550
551ecs_api_a1_get_job_ids 200 type6 NOWNER job10
552
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100553prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100554
555prodstub_equal create/prod-f/job10 1
556prodstub_equal delete/prod-f/job10 0
557
558ecs_api_a1_get_job_ids 200 type6 NOWNER job10
559
560if [ -z "$FLAT_A1_EI" ]; then
561 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
562else
563 ecs_api_a1_get_job_status 200 job10 ENABLED
564fi
565
566## Status updates prod-a and jobs
567
568ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
569
570ecs_api_edp_get_producer_status 200 prod-a ENABLED
571ecs_api_edp_get_producer_status 200 prod-b ENABLED
572ecs_api_edp_get_producer_status 200 prod-c ENABLED
573ecs_api_edp_get_producer_status 200 prod-d ENABLED
574ecs_api_edp_get_producer_status 200 prod-e ENABLED
575ecs_api_edp_get_producer_status 200 prod-f ENABLED
576
577# Arm producer prod-a for supervision failure
578prodstub_arm_producer 200 prod-a 400
579
580# Wait for producer prod-a to go disabled
581ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
582
583ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
584
585ecs_api_edp_get_producer_status 200 prod-a DISABLED
586ecs_api_edp_get_producer_status 200 prod-b ENABLED
587ecs_api_edp_get_producer_status 200 prod-c ENABLED
588ecs_api_edp_get_producer_status 200 prod-d ENABLED
589ecs_api_edp_get_producer_status 200 prod-e ENABLED
590ecs_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100591
592
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100593if [ -z "$FLAT_A1_EI" ]; then
594 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
595 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
596 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
597 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
598 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
599else
600 ecs_api_a1_get_job_status 200 job1 ENABLED
601 ecs_api_a1_get_job_status 200 job2 ENABLED
602 ecs_api_a1_get_job_status 200 job3 ENABLED
603 ecs_api_a1_get_job_status 200 job8 ENABLED
604 ecs_api_a1_get_job_status 200 job10 ENABLED
605fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100606
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100607# Arm producer prod-a for supervision
608prodstub_arm_producer 200 prod-a 200
609
610# Wait for producer prod-a to go enabled
611ecs_api_edp_get_producer_status 200 prod-a ENABLED 360
612
613ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
614
615ecs_api_edp_get_producer_status 200 prod-a ENABLED
616ecs_api_edp_get_producer_status 200 prod-b ENABLED
617ecs_api_edp_get_producer_status 200 prod-c ENABLED
618ecs_api_edp_get_producer_status 200 prod-d ENABLED
619ecs_api_edp_get_producer_status 200 prod-e ENABLED
620ecs_api_edp_get_producer_status 200 prod-f ENABLED
621
622if [ -z "$FLAT_A1_EI" ]; then
623 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
624 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
625 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
626 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
627 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
628else
629 ecs_api_a1_get_job_status 200 job1 ENABLED
630 ecs_api_a1_get_job_status 200 job2 ENABLED
631 ecs_api_a1_get_job_status 200 job3 ENABLED
632 ecs_api_a1_get_job_status 200 job8 ENABLED
633 ecs_api_a1_get_job_status 200 job10 ENABLED
634fi
635
636# Arm producer prod-a for supervision failure
637prodstub_arm_producer 200 prod-a 400
638
639# Wait for producer prod-a to go disabled
640ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
641
642ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
643
644ecs_api_edp_get_producer_status 200 prod-a DISABLED
645ecs_api_edp_get_producer_status 200 prod-b ENABLED
646ecs_api_edp_get_producer_status 200 prod-c ENABLED
647ecs_api_edp_get_producer_status 200 prod-d ENABLED
648ecs_api_edp_get_producer_status 200 prod-e ENABLED
649ecs_api_edp_get_producer_status 200 prod-f ENABLED
650
651if [ -z "$FLAT_A1_EI" ]; then
652 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
653 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
654 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
655 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
656 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
657else
658 ecs_api_a1_get_job_status 200 job1 ENABLED
659 ecs_api_a1_get_job_status 200 job2 ENABLED
660 ecs_api_a1_get_job_status 200 job3 ENABLED
661 ecs_api_a1_get_job_status 200 job8 ENABLED
662 ecs_api_a1_get_job_status 200 job10 ENABLED
663fi
664
665# Wait for producer prod-a to be removed
666ecs_equal json:ei-producer/v1/eiproducers 5 1000
667
668ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
669
670ecs_api_edp_get_producer_status 404 prod-a
671ecs_api_edp_get_producer_status 200 prod-b ENABLED
672ecs_api_edp_get_producer_status 200 prod-c ENABLED
673ecs_api_edp_get_producer_status 200 prod-d ENABLED
674ecs_api_edp_get_producer_status 200 prod-e ENABLED
675ecs_api_edp_get_producer_status 200 prod-f ENABLED
676
677if [ -z "$FLAT_A1_EI" ]; then
678 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
679 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
680 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
681 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
682 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
683else
684 ecs_api_a1_get_job_status 200 job1 DISABLED
685 ecs_api_a1_get_job_status 200 job2 DISABLED
686 ecs_api_a1_get_job_status 200 job3 ENABLED
687 ecs_api_a1_get_job_status 200 job8 ENABLED
688 ecs_api_a1_get_job_status 200 job10 ENABLED
689fi
690
691cr_equal received_callbacks 6 30
692cr_equal received_callbacks?id=job1-status 1
693cr_equal received_callbacks?id=job2-status 1
694
695cr_api_check_all_ecs_events 200 job1-status DISABLED
696cr_api_check_all_ecs_events 200 job2-status DISABLED
697
698
699# Arm producer prod-e for supervision failure
700prodstub_arm_producer 200 prod-e 400
701
702ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000
703
704ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
705
706ecs_api_edp_get_producer_status 404 prod-a
707ecs_api_edp_get_producer_status 200 prod-b ENABLED
708ecs_api_edp_get_producer_status 200 prod-c ENABLED
709ecs_api_edp_get_producer_status 200 prod-d ENABLED
710ecs_api_edp_get_producer_status 200 prod-e DISABLED
711ecs_api_edp_get_producer_status 200 prod-f ENABLED
712
713if [ -z "$FLAT_A1_EI" ]; then
714 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
715 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
716 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
717 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
718 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
719else
720 ecs_api_a1_get_job_status 200 job1 DISABLED
721 ecs_api_a1_get_job_status 200 job2 DISABLED
722 ecs_api_a1_get_job_status 200 job3 ENABLED
723 ecs_api_a1_get_job_status 200 job8 ENABLED
724 ecs_api_a1_get_job_status 200 job10 ENABLED
725fi
726
727#Disable create for job10 in prod-e
728prodstub_arm_job_create 200 prod-e job10 400
729
730#Update tjob 10 - only prod-f will be updated
731if [ -z "$FLAT_A1_EI" ]; then
732 ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
733else
734 ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json
735fi
736#Reset producer and job responses
737prodstub_arm_producer 200 prod-e 200
738prodstub_arm_job_create 200 prod-e job10 200
739
740ecs_api_edp_get_producer_status 200 prod-e ENABLED 360
741
742ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
743
744#Job 10 should be updated when the producer goes enabled
745deviation "Job 10 should be updated when the producer prod-e goes enabled"
BjornMagnussonXA2138b632020-11-30 21:17:32 +0100746prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
747prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100748
749prodstub_arm_producer 200 prod-f 400
750
751ecs_api_edp_get_producer_status 200 prod-f DISABLED 360
752
753ecs_equal json:ei-producer/v1/eiproducers 4 1000
754
755ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
756
757ecs_api_edp_get_producer_status 404 prod-a
758ecs_api_edp_get_producer_status 200 prod-b ENABLED
759ecs_api_edp_get_producer_status 200 prod-c ENABLED
760ecs_api_edp_get_producer_status 200 prod-d ENABLED
761ecs_api_edp_get_producer_status 200 prod-e ENABLED
762ecs_api_edp_get_producer_status 404 prod-f
763
764if [ -z "$FLAT_A1_EI" ]; then
765 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
766 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
767 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
768 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
769 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
770else
771 ecs_api_a1_get_job_status 200 job1 DISABLED
772 ecs_api_a1_get_job_status 200 job2 DISABLED
773 ecs_api_a1_get_job_status 200 job3 ENABLED
774 ecs_api_a1_get_job_status 200 job8 ENABLED
775 ecs_api_a1_get_job_status 200 job10 ENABLED
776fi
777
778cr_equal received_callbacks 6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200779
780check_ecs_logs
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200781
782store_logs END
783
784#### TEST COMPLETE ####
785
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200786print_result
787
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100788auto_clean_environment