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
10 # http://www.apache.org/licenses/LICENSE-2.0
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=================================================
21 TC_ONELINE_DESCR="ECS full intefaces walkthrough"
23 #App names to include in the test, space separated list
24 INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP"
26 #SUPPORTED TEST ENV FILE
27 SUPPORTED_PROFILES="ONAP-MASTER ORAN-CHERRY"
29 . ../common/testcase_common.sh $@
30 . ../common/ecs_api_functions.sh
31 . ../common/prodstub_api_functions.sh
32 . ../common/cr_api_functions.sh
56 if [ "$PMS_VERSION" == "V2" ]; then
57 start_ric_simulators ricsim_g3 4 STD_2.0.0
62 CB_JOB="$PROD_STUB_HTTPX://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/job"
63 CB_SV="$PROD_STUB_HTTPX://$PROD_STUB_APP_NAME:$PROD_STUB_PORT/callbacks/supervision"
64 TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
65 TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
66 TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
67 TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
68 TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
70 STATUS1="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job1-status"
71 STATUS2="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job2-status"
72 STATUS3="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job3-status"
73 STATUS8="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job8-status"
74 STATUS10="$CR_HTTPX://$CR_APP_NAME:$CR_PORT/callbacks/job10-status"
76 ### Setup prodstub sim to accept calls for producers, types and jobs
78 ## prod-b type1 and type2
90 ## job10 -> prod-e and prod-f
92 prodstub_arm_producer 200 prod-a
93 prodstub_arm_producer 200 prod-b
94 prodstub_arm_producer 200 prod-c
95 prodstub_arm_producer 200 prod-d
96 prodstub_arm_producer 200 prod-e
97 prodstub_arm_producer 200 prod-f
99 prodstub_arm_type 200 prod-a type1
100 prodstub_arm_type 200 prod-b type2
101 prodstub_arm_type 200 prod-b type3
102 prodstub_arm_type 200 prod-d type4
103 prodstub_arm_type 200 prod-e type6
104 prodstub_arm_type 200 prod-f type6
106 prodstub_disarm_type 200 prod-b type3
107 prodstub_arm_type 200 prod-b type1
108 prodstub_disarm_type 200 prod-b type1
111 prodstub_arm_job_create 200 prod-a job1
112 prodstub_arm_job_create 200 prod-a job2
113 prodstub_arm_job_create 200 prod-b job3
115 prodstub_arm_job_delete 200 prod-a job1
116 prodstub_arm_job_delete 200 prod-a job2
117 prodstub_arm_job_delete 200 prod-b job3
119 prodstub_arm_job_create 200 prod-b job4
120 prodstub_arm_job_create 200 prod-a job4
122 prodstub_arm_job_create 200 prod-b job6
124 prodstub_arm_job_create 200 prod-d job8
126 prodstub_arm_job_create 200 prod-e job10
127 prodstub_arm_job_create 200 prod-f job10
130 ecs_api_service_status 200
132 cr_equal received_callbacks 0
134 ### Initial tests - no config made
135 ### GET: type ids, types, producer ids, producers, job ids, jobs
137 ecs_api_a1_get_type_ids 200 EMPTY
138 ecs_api_a1_get_type 404 test-type
140 ecs_api_edp_get_type_ids 200 EMPTY
141 ecs_api_edp_get_type 404 test-type
143 ecs_api_edp_get_producer_ids 200 EMPTY
144 ecs_api_edp_get_producer 404 test-prod
146 ecs_api_edp_get_producer_status 404 test-prod
148 ecs_api_edp_delete_producer 404 test-prod
150 if [ -z "$FLAT_A1_EI" ]; then
151 ecs_api_a1_get_job_ids 404 test-type NOWNER
152 ecs_api_a1_get_job_ids 404 test-type test-owner
154 ecs_api_a1_get_job 404 test-type test-job
156 ecs_api_a1_get_job_status 404 test-type test-job
158 ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY
159 ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY
161 ecs_api_a1_get_job 404 test-job
163 ecs_api_a1_get_job_status 404 test-job
166 if [ -z "$FLAT_A1_EI" ]; then
167 ecs_api_a1_delete_job 404 test-type test-job
169 ecs_api_a1_delete_job 404 test-job
172 ecs_api_edp_get_producer_jobs 404 test-prod
175 ### Setup of producer/job and testing apis ###
178 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
179 ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
182 ecs_api_a1_get_type_ids 200 type1
183 if [ -z "$FLAT_A1_EI" ]; then
184 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
186 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
189 ecs_api_edp_get_type_ids 200 type1
190 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
192 ecs_api_edp_get_producer_ids 200 prod-a
194 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
196 ecs_api_edp_get_producer_status 200 prod-a ENABLED
198 ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
199 ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
201 if [ -z "$FLAT_A1_EI" ]; then
202 ecs_api_a1_get_job 404 type1 test-job
204 ecs_api_a1_get_job_status 404 type1 test-job
206 ecs_api_a1_get_job 404 test-job
208 ecs_api_a1_get_job_status 404 test-job
211 ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
213 ## Create a job for prod-a
215 if [ -z "$FLAT_A1_EI" ]; then
216 ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
218 ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
221 # Check the job data in the producer
222 prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
224 ecs_api_a1_get_job_ids 200 type1 NOWNER job1
225 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
227 if [ ! -z "$FLAT_A1_EI" ]; then
228 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1
231 if [ -z "$FLAT_A1_EI" ]; then
232 ecs_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
234 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
236 ecs_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
238 ecs_api_a1_get_job_status 200 job1 ENABLED
241 prodstub_equal create/prod-a/job1 1
243 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
245 ## Create a second job for prod-a
247 if [ -z "$FLAT_A1_EI" ]; then
248 ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
250 ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
253 # Check the job data in the producer
254 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
256 ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
257 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
258 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
259 if [ ! -z "$FLAT_A1_EI" ]; then
260 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
263 if [ -z "$FLAT_A1_EI" ]; then
264 ecs_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
266 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
268 ecs_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
270 ecs_api_a1_get_job_status 200 job2 ENABLED
273 prodstub_equal create/prod-a/job2 1
275 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
278 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
280 ecs_api_a1_get_type_ids 200 type1 type2
281 if [ -z "$FLAT_A1_EI" ]; then
282 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
283 ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
285 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
286 ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json
289 ecs_api_edp_get_type_ids 200 type1 type2
290 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
291 ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
293 ecs_api_edp_get_producer_ids 200 prod-a prod-b
295 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
296 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
299 ecs_api_edp_get_producer_status 200 prod-b ENABLED
301 ## Create job for prod-b
303 if [ -z "$FLAT_A1_EI" ]; then
304 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
306 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
309 prodstub_equal create/prod-b/job3 1
311 # Check the job data in the producer
312 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
314 ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
315 ecs_api_a1_get_job_ids 200 type2 NOWNER job3
316 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
317 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
318 ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
320 if [ -z "$FLAT_A1_EI" ]; then
321 ecs_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
323 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
325 ecs_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
327 ecs_api_a1_get_job_status 200 job3 ENABLED
330 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
331 ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
334 ## Setup prod-c (no types)
335 ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
338 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
340 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
341 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
342 ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
344 ecs_api_edp_get_producer_status 200 prod-c ENABLED
347 ## Delete job3 and prod-b and re-create if different order
349 # Delete job then producer
350 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
351 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
353 if [ -z "$FLAT_A1_EI" ]; then
354 ecs_api_a1_delete_job 204 type2 job3
356 ecs_api_a1_delete_job 204 job3
359 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
360 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
362 ecs_api_edp_delete_producer 204 prod-b
364 ecs_api_edp_get_producer_status 404 prod-b
366 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
367 ecs_api_edp_get_producer_ids 200 prod-a prod-c
369 prodstub_equal delete/prod-b/job3 1
371 if [ -z "$FLAT_A1_EI" ]; then
372 ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
374 ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
377 # Put producer then job
378 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
380 ecs_api_edp_get_producer_status 200 prod-b ENABLED
382 if [ -z "$FLAT_A1_EI" ]; then
383 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
384 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
386 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
387 ecs_api_a1_get_job_status 200 job3 ENABLED
390 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
392 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
393 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
395 prodstub_equal create/prod-b/job3 2
396 prodstub_equal delete/prod-b/job3 1
398 # Delete only the producer
399 ecs_api_edp_delete_producer 204 prod-b
401 ecs_api_edp_get_producer_status 404 prod-b
403 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
404 ecs_api_edp_get_producer_ids 200 prod-a prod-c
406 if [ -z "$FLAT_A1_EI" ]; then
407 ecs_api_a1_get_job_status 200 type2 job3 DISABLED
409 ecs_api_a1_get_job_status 200 job3 DISABLED
412 cr_equal received_callbacks 1 30
413 cr_equal received_callbacks?id=job3-status 1
414 cr_api_check_all_ecs_events 200 job3-status DISABLED
416 # Re-create the producer
417 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
419 ecs_api_edp_get_producer_status 200 prod-b ENABLED
421 if [ -z "$FLAT_A1_EI" ]; then
422 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
424 ecs_api_a1_get_job_status 200 job3 ENABLED
427 cr_equal received_callbacks 2 30
428 cr_equal received_callbacks?id=job3-status 2
429 cr_api_check_all_ecs_events 200 job3-status ENABLED
431 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
435 ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json
437 ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
439 if [ -z "$FLAT_A1_EI" ]; then
440 ecs_api_a1_put_job 201 type4 job8 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
442 ecs_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json
445 prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
447 prodstub_equal create/prod-d/job8 1
448 prodstub_equal delete/prod-d/job8 0
450 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
452 if [ -z "$FLAT_A1_EI" ]; then
453 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
455 ecs_api_a1_get_job_status 200 job8 ENABLED
458 # Re-PUT the producer with zero types
459 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
461 if [ -z "$FLAT_A1_EI" ]; then
462 ecs_api_a1_get_job_ids 404 type4 NOWNER
464 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
465 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
468 if [ -z "$FLAT_A1_EI" ]; then
469 ecs_api_a1_get_job_status 200 type4 job8 DISABLED
471 ecs_api_a1_get_job_status 200 job8 DISABLED
474 cr_equal received_callbacks 3 30
475 cr_equal received_callbacks?id=job8-status 1
476 cr_api_check_all_ecs_events 200 job8-status DISABLED
478 prodstub_equal create/prod-d/job8 1
479 prodstub_equal delete/prod-d/job8 0
482 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json
484 if [ -z "$FLAT_A1_EI" ]; then
485 ecs_api_a1_get_job_ids 404 type4 NOWNER
487 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
488 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
491 if [ -z "$FLAT_A1_EI" ]; then
492 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
494 ecs_api_a1_get_job_status 200 job8 ENABLED
497 ecs_api_edp_get_producer_status 200 prod-a ENABLED
498 ecs_api_edp_get_producer_status 200 prod-b ENABLED
499 ecs_api_edp_get_producer_status 200 prod-c ENABLED
500 ecs_api_edp_get_producer_status 200 prod-d ENABLED
502 cr_equal received_callbacks 4 30
503 cr_equal received_callbacks?id=job8-status 2
504 cr_api_check_all_ecs_events 200 job8-status ENABLED
506 prodstub_equal create/prod-d/job8 2
507 prodstub_equal delete/prod-d/job8 0
511 ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
513 ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY
515 if [ -z "$FLAT_A1_EI" ]; then
516 ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
518 ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json
521 prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
523 prodstub_equal create/prod-e/job10 1
524 prodstub_equal delete/prod-e/job10 0
526 ecs_api_a1_get_job_ids 200 type6 NOWNER job10
528 if [ -z "$FLAT_A1_EI" ]; then
529 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
531 ecs_api_a1_get_job_status 200 job10 ENABLED
535 ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
537 ecs_api_a1_get_job_ids 200 type6 NOWNER job10
539 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
541 prodstub_equal create/prod-f/job10 1
542 prodstub_equal delete/prod-f/job10 0
544 ecs_api_a1_get_job_ids 200 type6 NOWNER job10
546 if [ -z "$FLAT_A1_EI" ]; then
547 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
549 ecs_api_a1_get_job_status 200 job10 ENABLED
552 ## Status updates prod-a and jobs
554 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
556 ecs_api_edp_get_producer_status 200 prod-a ENABLED
557 ecs_api_edp_get_producer_status 200 prod-b ENABLED
558 ecs_api_edp_get_producer_status 200 prod-c ENABLED
559 ecs_api_edp_get_producer_status 200 prod-d ENABLED
560 ecs_api_edp_get_producer_status 200 prod-e ENABLED
561 ecs_api_edp_get_producer_status 200 prod-f ENABLED
563 # Arm producer prod-a for supervision failure
564 prodstub_arm_producer 200 prod-a 400
566 # Wait for producer prod-a to go disabled
567 ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
569 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
571 ecs_api_edp_get_producer_status 200 prod-a DISABLED
572 ecs_api_edp_get_producer_status 200 prod-b ENABLED
573 ecs_api_edp_get_producer_status 200 prod-c ENABLED
574 ecs_api_edp_get_producer_status 200 prod-d ENABLED
575 ecs_api_edp_get_producer_status 200 prod-e ENABLED
576 ecs_api_edp_get_producer_status 200 prod-f ENABLED
579 if [ -z "$FLAT_A1_EI" ]; then
580 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
581 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
582 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
583 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
584 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
586 ecs_api_a1_get_job_status 200 job1 ENABLED
587 ecs_api_a1_get_job_status 200 job2 ENABLED
588 ecs_api_a1_get_job_status 200 job3 ENABLED
589 ecs_api_a1_get_job_status 200 job8 ENABLED
590 ecs_api_a1_get_job_status 200 job10 ENABLED
593 # Arm producer prod-a for supervision
594 prodstub_arm_producer 200 prod-a 200
596 # Wait for producer prod-a to go enabled
597 ecs_api_edp_get_producer_status 200 prod-a ENABLED 360
599 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
601 ecs_api_edp_get_producer_status 200 prod-a ENABLED
602 ecs_api_edp_get_producer_status 200 prod-b ENABLED
603 ecs_api_edp_get_producer_status 200 prod-c ENABLED
604 ecs_api_edp_get_producer_status 200 prod-d ENABLED
605 ecs_api_edp_get_producer_status 200 prod-e ENABLED
606 ecs_api_edp_get_producer_status 200 prod-f ENABLED
608 if [ -z "$FLAT_A1_EI" ]; then
609 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
610 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
611 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
612 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
613 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
615 ecs_api_a1_get_job_status 200 job1 ENABLED
616 ecs_api_a1_get_job_status 200 job2 ENABLED
617 ecs_api_a1_get_job_status 200 job3 ENABLED
618 ecs_api_a1_get_job_status 200 job8 ENABLED
619 ecs_api_a1_get_job_status 200 job10 ENABLED
622 # Arm producer prod-a for supervision failure
623 prodstub_arm_producer 200 prod-a 400
625 # Wait for producer prod-a to go disabled
626 ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
628 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
630 ecs_api_edp_get_producer_status 200 prod-a DISABLED
631 ecs_api_edp_get_producer_status 200 prod-b ENABLED
632 ecs_api_edp_get_producer_status 200 prod-c ENABLED
633 ecs_api_edp_get_producer_status 200 prod-d ENABLED
634 ecs_api_edp_get_producer_status 200 prod-e ENABLED
635 ecs_api_edp_get_producer_status 200 prod-f ENABLED
637 if [ -z "$FLAT_A1_EI" ]; then
638 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
639 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
640 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
641 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
642 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
644 ecs_api_a1_get_job_status 200 job1 ENABLED
645 ecs_api_a1_get_job_status 200 job2 ENABLED
646 ecs_api_a1_get_job_status 200 job3 ENABLED
647 ecs_api_a1_get_job_status 200 job8 ENABLED
648 ecs_api_a1_get_job_status 200 job10 ENABLED
651 # Wait for producer prod-a to be removed
652 ecs_equal json:ei-producer/v1/eiproducers 5 1000
654 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
656 ecs_api_edp_get_producer_status 404 prod-a
657 ecs_api_edp_get_producer_status 200 prod-b ENABLED
658 ecs_api_edp_get_producer_status 200 prod-c ENABLED
659 ecs_api_edp_get_producer_status 200 prod-d ENABLED
660 ecs_api_edp_get_producer_status 200 prod-e ENABLED
661 ecs_api_edp_get_producer_status 200 prod-f ENABLED
663 if [ -z "$FLAT_A1_EI" ]; then
664 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
665 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
666 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
667 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
668 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
670 ecs_api_a1_get_job_status 200 job1 DISABLED
671 ecs_api_a1_get_job_status 200 job2 DISABLED
672 ecs_api_a1_get_job_status 200 job3 ENABLED
673 ecs_api_a1_get_job_status 200 job8 ENABLED
674 ecs_api_a1_get_job_status 200 job10 ENABLED
677 cr_equal received_callbacks 6 30
678 cr_equal received_callbacks?id=job1-status 1
679 cr_equal received_callbacks?id=job2-status 1
681 cr_api_check_all_ecs_events 200 job1-status DISABLED
682 cr_api_check_all_ecs_events 200 job2-status DISABLED
685 # Arm producer prod-e for supervision failure
686 prodstub_arm_producer 200 prod-e 400
688 ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000
690 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
692 ecs_api_edp_get_producer_status 404 prod-a
693 ecs_api_edp_get_producer_status 200 prod-b ENABLED
694 ecs_api_edp_get_producer_status 200 prod-c ENABLED
695 ecs_api_edp_get_producer_status 200 prod-d ENABLED
696 ecs_api_edp_get_producer_status 200 prod-e DISABLED
697 ecs_api_edp_get_producer_status 200 prod-f ENABLED
699 if [ -z "$FLAT_A1_EI" ]; then
700 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
701 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
702 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
703 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
704 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
706 ecs_api_a1_get_job_status 200 job1 DISABLED
707 ecs_api_a1_get_job_status 200 job2 DISABLED
708 ecs_api_a1_get_job_status 200 job3 ENABLED
709 ecs_api_a1_get_job_status 200 job8 ENABLED
710 ecs_api_a1_get_job_status 200 job10 ENABLED
713 #Disable create for job10 in prod-e
714 prodstub_arm_job_create 200 prod-e job10 400
716 #Update tjob 10 - only prod-f will be updated
717 if [ -z "$FLAT_A1_EI" ]; then
718 ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
720 ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json
722 #Reset producer and job responses
723 prodstub_arm_producer 200 prod-e 200
724 prodstub_arm_job_create 200 prod-e job10 200
726 ecs_api_edp_get_producer_status 200 prod-e ENABLED 360
728 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
730 #Job 10 should be updated when the producer goes enabled
731 deviation "Job 10 should be updated when the producer prod-e goes enabled"
732 prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
733 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
735 prodstub_arm_producer 200 prod-f 400
737 ecs_api_edp_get_producer_status 200 prod-f DISABLED 360
739 ecs_equal json:ei-producer/v1/eiproducers 4 1000
741 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
743 ecs_api_edp_get_producer_status 404 prod-a
744 ecs_api_edp_get_producer_status 200 prod-b ENABLED
745 ecs_api_edp_get_producer_status 200 prod-c ENABLED
746 ecs_api_edp_get_producer_status 200 prod-d ENABLED
747 ecs_api_edp_get_producer_status 200 prod-e ENABLED
748 ecs_api_edp_get_producer_status 404 prod-f
750 if [ -z "$FLAT_A1_EI" ]; then
751 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
752 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
753 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
754 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
755 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
757 ecs_api_a1_get_job_status 200 job1 DISABLED
758 ecs_api_a1_get_job_status 200 job2 DISABLED
759 ecs_api_a1_get_job_status 200 job3 ENABLED
760 ecs_api_a1_get_job_status 200 job8 ENABLED
761 ecs_api_a1_get_job_status 200 job10 ENABLED
764 cr_equal received_callbacks 6
770 #### TEST COMPLETE ####
774 auto_clean_containers