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 interfaces walkthrough"
23 #App names to include in the test when running docker, space separated list
24 DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP HTTPPROXY NGW"
26 #App names to include in the test when running kubernetes, space separated list
27 KUBE_INCLUDED_IMAGES="PRODSTUB CR ECS RICSIM CP HTTPPROXY KUBEPROXY NGW"
28 #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
29 KUBE_PRESTARTED_IMAGES=""
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
34 CONDITIONALLY_IGNORED_IMAGES="NGW"
36 #Supported test environment profiles
37 SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE"
39 SUPPORTED_RUNMODES="DOCKER KUBE"
41 . ../common/testcase_common.sh $@
42 . ../common/ecs_api_functions.sh
43 . ../common/prodstub_api_functions.sh
44 . ../common/cr_api_functions.sh
45 . ../common/control_panel_api_functions.sh
46 . ../common/controller_api_functions.sh
47 . ../common/ricsimulator_api_functions.sh
48 . ../common/http_proxy_api_functions.sh
49 . ../common/kube_proxy_api_functions.sh
50 . ../common/gateway_api_functions.sh
60 if [ $RUNMODE == "KUBE" ]; then
74 start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE #Change NOPROXY to PROXY to run with http proxy
76 if [ $RUNMODE == "KUBE" ]; then
84 start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
86 if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
87 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
90 if [ "$PMS_VERSION" == "V2" ]; then
91 start_ric_simulators ricsim_g3 4 STD_2.0.0
96 CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
97 CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
98 TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
99 TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
100 TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
101 TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
102 TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
104 STATUS1="$CR_SERVICE_PATH/job1-status"
105 STATUS2="$CR_SERVICE_PATH/job2-status"
106 STATUS3="$CR_SERVICE_PATH/job3-status"
107 STATUS8="$CR_SERVICE_PATH/job8-status"
108 STATUS10="$CR_SERVICE_PATH/job10-status"
110 ### Setup prodstub sim to accept calls for producers, types and jobs
112 ## prod-b type1 and type2
124 ## job10 -> prod-e and prod-f
126 prodstub_arm_producer 200 prod-a
127 prodstub_arm_producer 200 prod-b
128 prodstub_arm_producer 200 prod-c
129 prodstub_arm_producer 200 prod-d
130 prodstub_arm_producer 200 prod-e
131 prodstub_arm_producer 200 prod-f
133 prodstub_arm_type 200 prod-a type1
134 prodstub_arm_type 200 prod-b type2
135 prodstub_arm_type 200 prod-b type3
136 prodstub_arm_type 200 prod-d type4
137 prodstub_arm_type 200 prod-e type6
138 prodstub_arm_type 200 prod-f type6
140 prodstub_disarm_type 200 prod-b type3
141 prodstub_arm_type 200 prod-b type1
142 prodstub_disarm_type 200 prod-b type1
145 prodstub_arm_job_create 200 prod-a job1
146 prodstub_arm_job_create 200 prod-a job2
147 prodstub_arm_job_create 200 prod-b job3
149 prodstub_arm_job_delete 200 prod-a job1
150 prodstub_arm_job_delete 200 prod-a job2
151 prodstub_arm_job_delete 200 prod-b job3
153 prodstub_arm_job_create 200 prod-b job4
154 prodstub_arm_job_create 200 prod-a job4
156 prodstub_arm_job_create 200 prod-b job6
158 prodstub_arm_job_create 200 prod-d job8
160 prodstub_arm_job_create 200 prod-e job10
161 prodstub_arm_job_create 200 prod-f job10
164 ecs_api_service_status 200
166 cr_equal received_callbacks 0
168 ### Initial tests - no config made
169 ### GET: type ids, types, producer ids, producers, job ids, jobs
171 ecs_api_a1_get_type_ids 200 EMPTY
172 ecs_api_a1_get_type 404 test-type
174 ecs_api_edp_get_type_ids 200 EMPTY
175 if [ $ECS_VERSION == "V1-1" ]; then
176 ecs_api_edp_get_type 404 test-type
178 ecs_api_edp_get_type_2 404 test-type
181 if [ $ECS_VERSION == "V1-1" ]; then
182 ecs_api_edp_get_producer_ids 200 EMPTY
183 ecs_api_edp_get_producer 404 test-prod
185 ecs_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
186 ecs_api_edp_get_producer_2 404 test-prod
188 ecs_api_edp_get_producer_status 404 test-prod
190 ecs_api_edp_delete_producer 404 test-prod
192 if [ -z "$FLAT_A1_EI" ]; then
193 ecs_api_a1_get_job_ids 404 test-type NOWNER
194 ecs_api_a1_get_job_ids 404 test-type test-owner
196 ecs_api_a1_get_job 404 test-type test-job
198 ecs_api_a1_get_job_status 404 test-type test-job
200 ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY
201 ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY
203 ecs_api_a1_get_job 404 test-job
205 ecs_api_a1_get_job_status 404 test-job
208 if [ -z "$FLAT_A1_EI" ]; then
209 ecs_api_a1_delete_job 404 test-type test-job
211 ecs_api_a1_delete_job 404 test-job
214 if [ $ECS_VERSION == "V1-1" ]; then
215 ecs_api_edp_get_producer_jobs 404 test-prod
217 ecs_api_edp_get_producer_jobs_2 404 test-prod
220 if [ $ECS_VERSION == "V1-2" ]; then
221 ecs_api_edp_get_type_2 404 test-type
222 ecs_api_edp_delete_type_2 404 test-type
225 ### Setup of producer/job and testing apis ###
228 if [ $ECS_VERSION == "V1-1" ]; then
229 ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
230 ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
233 ecs_api_edp_get_type_ids 200 EMPTY
234 ecs_api_edp_get_type_2 404 type1
235 ecs_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
237 # Create type, delete and create again
238 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
239 ecs_api_edp_get_type_2 200 type1
240 ecs_api_edp_get_type_ids 200 type1
241 ecs_api_edp_delete_type_2 204 type1
242 ecs_api_edp_get_type_2 404 type1
243 ecs_api_edp_get_type_ids 200 EMPTY
244 ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
245 ecs_api_edp_get_type_ids 200 type1
246 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
248 ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
249 ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
251 ecs_api_edp_delete_type_2 406 type1
255 ecs_api_a1_get_type_ids 200 type1
256 if [ -z "$FLAT_A1_EI" ]; then
257 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
259 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
262 ecs_api_edp_get_type_ids 200 type1
263 if [ $ECS_VERSION == "V1-1" ]; then
264 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
266 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
269 if [ $ECS_VERSION == "V1-1" ]; then
270 ecs_api_edp_get_producer_ids 200 prod-a
272 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a
273 ecs_api_edp_get_producer_ids_2 200 type1 prod-a
274 ecs_api_edp_get_producer_ids_2 200 type2 EMPTY
277 if [ $ECS_VERSION == "V1-1" ]; then
278 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
280 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
283 ecs_api_edp_get_producer_status 200 prod-a ENABLED
285 ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
286 ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
288 if [ -z "$FLAT_A1_EI" ]; then
289 ecs_api_a1_get_job 404 type1 test-job
291 ecs_api_a1_get_job_status 404 type1 test-job
293 ecs_api_a1_get_job 404 test-job
295 ecs_api_a1_get_job_status 404 test-job
297 if [ $ECS_VERSION == "V1-1" ]; then
298 ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
300 ecs_api_edp_get_producer_jobs_2 200 prod-a EMPTY
303 ## Create a job for prod-a
305 if [ -z "$FLAT_A1_EI" ]; then
306 ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
308 ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
311 # Check the job data in the producer
312 if [ $ECS_VERSION == "V1-1" ]; then
313 prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
315 prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
318 ecs_api_a1_get_job_ids 200 type1 NOWNER job1
319 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
321 if [ ! -z "$FLAT_A1_EI" ]; then
322 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1
325 if [ -z "$FLAT_A1_EI" ]; then
326 ecs_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
328 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
330 ecs_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json
332 ecs_api_a1_get_job_status 200 job1 ENABLED
335 prodstub_equal create/prod-a/job1 1
337 if [ $ECS_VERSION == "V1-1" ]; then
338 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
340 ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json
343 ## Create a second job for prod-a
345 if [ -z "$FLAT_A1_EI" ]; then
346 ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
348 ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
351 # Check the job data in the producer
352 if [ $ECS_VERSION == "V1-1" ]; then
353 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
355 prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
357 ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
358 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
359 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
360 if [ ! -z "$FLAT_A1_EI" ]; then
361 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
364 if [ -z "$FLAT_A1_EI" ]; then
365 ecs_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
367 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
369 ecs_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json
371 ecs_api_a1_get_job_status 200 job2 ENABLED
374 prodstub_equal create/prod-a/job2 1
376 if [ $ECS_VERSION == "V1-1" ]; then
377 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
379 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
383 if [ $ECS_VERSION == "V1-1" ]; then
384 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
386 ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
387 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
391 ecs_api_a1_get_type_ids 200 type1 type2
392 if [ -z "$FLAT_A1_EI" ]; then
393 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
394 ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
396 ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json
397 ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json
400 ecs_api_edp_get_type_ids 200 type1 type2
401 if [ $ECS_VERSION == "V1-1" ]; then
402 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
403 ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
405 ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
406 ecs_api_edp_get_type_2 200 type2 testdata/ecs/ei-type-2.json
409 if [ $ECS_VERSION == "V1-1" ]; then
410 ecs_api_edp_get_producer_ids 200 prod-a prod-b
412 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b
415 if [ $ECS_VERSION == "V1-1" ]; then
416 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
417 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
419 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
420 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
423 ecs_api_edp_get_producer_status 200 prod-b ENABLED
425 ## Create job for prod-b
427 if [ -z "$FLAT_A1_EI" ]; then
428 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
430 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
433 prodstub_equal create/prod-b/job3 1
435 # Check the job data in the producer
436 if [ $ECS_VERSION == "V1-1" ]; then
437 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
439 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
442 ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
443 ecs_api_a1_get_job_ids 200 type2 NOWNER job3
444 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
445 ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
446 ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
448 if [ -z "$FLAT_A1_EI" ]; then
449 ecs_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
451 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
453 ecs_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
455 ecs_api_a1_get_job_status 200 job3 ENABLED
458 if [ $ECS_VERSION == "V1-1" ]; then
459 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
460 ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
462 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
463 ecs_api_edp_get_producer_jobs_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
466 ## Setup prod-c (no types)
467 if [ $ECS_VERSION == "V1-1" ]; then
468 ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
470 ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
473 if [ $ECS_VERSION == "V1-1" ]; then
474 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
476 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
479 if [ $ECS_VERSION == "V1-1" ]; then
480 ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
481 ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
482 ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
484 ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
485 ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
486 ecs_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
489 ecs_api_edp_get_producer_status 200 prod-c ENABLED
492 ## Delete job3 and prod-b and re-create if different order
494 # Delete job then producer
495 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
496 if [ $ECS_VERSION == "V1-1" ]; then
497 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
499 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
502 if [ -z "$FLAT_A1_EI" ]; then
503 ecs_api_a1_delete_job 204 type2 job3
505 ecs_api_a1_delete_job 204 job3
508 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
509 if [ $ECS_VERSION == "V1-1" ]; then
510 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
512 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
515 ecs_api_edp_delete_producer 204 prod-b
517 ecs_api_edp_get_producer_status 404 prod-b
519 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
520 if [ $ECS_VERSION == "V1-1" ]; then
521 ecs_api_edp_get_producer_ids 200 prod-a prod-c
523 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
526 prodstub_equal delete/prod-b/job3 1
528 if [ -z "$FLAT_A1_EI" ]; then
529 ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
531 if [ $ECS_VERSION == "V1-1" ]; then
532 ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
534 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
535 ecs_api_a1_get_job_status 200 job3 DISABLED
539 # Put producer then job
540 if [ $ECS_VERSION == "V1-1" ]; then
541 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
543 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
546 ecs_api_edp_get_producer_status 200 prod-b ENABLED
548 if [ -z "$FLAT_A1_EI" ]; then
549 ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
550 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
552 if [ $ECS_VERSION == "V1-1" ]; then
553 ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
555 ecs_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
557 ecs_api_a1_get_job_status 200 job3 ENABLED
560 if [ $ECS_VERSION == "V1-1" ]; then
561 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
563 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
566 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
567 if [ $ECS_VERSION == "V1-1" ]; then
568 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
570 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
573 if [ $ECS_VERSION == "V1-1" ]; then
574 prodstub_equal create/prod-b/job3 2
576 prodstub_equal create/prod-b/job3 3
578 prodstub_equal delete/prod-b/job3 1
580 # Delete only the producer
581 ecs_api_edp_delete_producer 204 prod-b
583 ecs_api_edp_get_producer_status 404 prod-b
585 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
586 if [ $ECS_VERSION == "V1-1" ]; then
587 ecs_api_edp_get_producer_ids 200 prod-a prod-c
589 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
592 if [ -z "$FLAT_A1_EI" ]; then
593 ecs_api_a1_get_job_status 200 type2 job3 DISABLED
595 ecs_api_a1_get_job_status 200 job3 DISABLED
598 cr_equal received_callbacks 1 30
599 cr_equal received_callbacks?id=job3-status 1
600 cr_api_check_all_ecs_events 200 job3-status DISABLED
602 # Re-create the producer
603 if [ $ECS_VERSION == "V1-1" ]; then
604 ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
606 ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
609 ecs_api_edp_get_producer_status 200 prod-b ENABLED
611 if [ -z "$FLAT_A1_EI" ]; then
612 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
614 ecs_api_a1_get_job_status 200 job3 ENABLED
617 cr_equal received_callbacks 2 30
618 cr_equal received_callbacks?id=job3-status 2
619 cr_api_check_all_ecs_events 200 job3-status ENABLED
621 if [ $ECS_VERSION == "V1-1" ]; then
622 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
624 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
628 if [ $ECS_VERSION == "V1-1" ]; then
629 ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
631 ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-1.json
632 ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
635 ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
637 if [ -z "$FLAT_A1_EI" ]; then
638 ecs_api_a1_put_job 201 type4 job8 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
640 ecs_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json
643 if [ $ECS_VERSION == "V1-1" ]; then
644 prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
646 prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json
649 prodstub_equal create/prod-d/job8 1
650 prodstub_equal delete/prod-d/job8 0
652 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
654 if [ -z "$FLAT_A1_EI" ]; then
655 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
657 ecs_api_a1_get_job_status 200 job8 ENABLED
660 # Re-PUT the producer with zero types
661 if [ $ECS_VERSION == "V1-1" ]; then
662 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
664 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
667 if [ -z "$FLAT_A1_EI" ]; then
668 ecs_api_a1_get_job_ids 404 type4 NOWNER
670 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
671 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
674 if [ -z "$FLAT_A1_EI" ]; then
675 ecs_api_a1_get_job_status 200 type4 job8 DISABLED
677 ecs_api_a1_get_job_status 200 job8 DISABLED
680 cr_equal received_callbacks 3 30
681 cr_equal received_callbacks?id=job8-status 1
682 cr_api_check_all_ecs_events 200 job8-status DISABLED
684 prodstub_equal create/prod-d/job8 1
685 prodstub_equal delete/prod-d/job8 0
688 if [ $ECS_VERSION == "V1-1" ]; then
689 ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
691 ecs_api_edp_put_type_2 200 type4 testdata/ecs/ei-type-4.json
692 ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
695 if [ -z "$FLAT_A1_EI" ]; then
696 ecs_api_a1_get_job_ids 404 type4 NOWNER
698 ecs_api_a1_get_job_ids 200 type4 NOWNER job8
699 ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
702 if [ -z "$FLAT_A1_EI" ]; then
703 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
705 ecs_api_a1_get_job_status 200 job8 ENABLED
708 ecs_api_edp_get_producer_status 200 prod-a ENABLED
709 ecs_api_edp_get_producer_status 200 prod-b ENABLED
710 ecs_api_edp_get_producer_status 200 prod-c ENABLED
711 ecs_api_edp_get_producer_status 200 prod-d ENABLED
713 cr_equal received_callbacks 4 30
714 cr_equal received_callbacks?id=job8-status 2
715 cr_api_check_all_ecs_events 200 job8-status ENABLED
717 prodstub_equal create/prod-d/job8 2
718 prodstub_equal delete/prod-d/job8 0
722 if [ $ECS_VERSION == "V1-1" ]; then
723 ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
725 ecs_api_edp_put_type_2 201 type6 testdata/ecs/ei-type-6.json
726 ecs_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6
729 ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY
731 if [ -z "$FLAT_A1_EI" ]; then
732 ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
734 ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json
737 if [ $ECS_VERSION == "V1-1" ]; then
738 prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
740 prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
743 prodstub_equal create/prod-e/job10 1
744 prodstub_equal delete/prod-e/job10 0
746 ecs_api_a1_get_job_ids 200 type6 NOWNER job10
748 if [ -z "$FLAT_A1_EI" ]; then
749 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
751 ecs_api_a1_get_job_status 200 job10 ENABLED
755 if [ $ECS_VERSION == "V1-1" ]; then
756 ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
758 ecs_api_edp_put_type_2 200 type6 testdata/ecs/ei-type-6.json
759 ecs_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6
762 ecs_api_a1_get_job_ids 200 type6 NOWNER job10
764 if [ $ECS_VERSION == "V1-1" ]; then
765 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
767 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json
770 prodstub_equal create/prod-f/job10 1
771 prodstub_equal delete/prod-f/job10 0
773 ecs_api_a1_get_job_ids 200 type6 NOWNER job10
775 if [ -z "$FLAT_A1_EI" ]; then
776 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
778 ecs_api_a1_get_job_status 200 job10 ENABLED
781 ## Status updates prod-a and jobs
783 if [ $ECS_VERSION == "V1-1" ]; then
784 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
786 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
789 ecs_api_edp_get_producer_status 200 prod-a ENABLED
790 ecs_api_edp_get_producer_status 200 prod-b ENABLED
791 ecs_api_edp_get_producer_status 200 prod-c ENABLED
792 ecs_api_edp_get_producer_status 200 prod-d ENABLED
793 ecs_api_edp_get_producer_status 200 prod-e ENABLED
794 ecs_api_edp_get_producer_status 200 prod-f ENABLED
796 # Arm producer prod-a for supervision failure
797 prodstub_arm_producer 200 prod-a 400
799 # Wait for producer prod-a to go disabled
800 ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
802 if [ $ECS_VERSION == "V1-1" ]; then
803 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
805 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
808 ecs_api_edp_get_producer_status 200 prod-a DISABLED
809 ecs_api_edp_get_producer_status 200 prod-b ENABLED
810 ecs_api_edp_get_producer_status 200 prod-c ENABLED
811 ecs_api_edp_get_producer_status 200 prod-d ENABLED
812 ecs_api_edp_get_producer_status 200 prod-e ENABLED
813 ecs_api_edp_get_producer_status 200 prod-f ENABLED
816 if [ -z "$FLAT_A1_EI" ]; then
817 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
818 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
819 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
820 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
821 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
823 ecs_api_a1_get_job_status 200 job1 ENABLED
824 ecs_api_a1_get_job_status 200 job2 ENABLED
825 ecs_api_a1_get_job_status 200 job3 ENABLED
826 ecs_api_a1_get_job_status 200 job8 ENABLED
827 ecs_api_a1_get_job_status 200 job10 ENABLED
830 # Arm producer prod-a for supervision
831 prodstub_arm_producer 200 prod-a 200
833 # Wait for producer prod-a to go enabled
834 ecs_api_edp_get_producer_status 200 prod-a ENABLED 360
836 if [ $ECS_VERSION == "V1-1" ]; then
837 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
839 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
842 ecs_api_edp_get_producer_status 200 prod-a ENABLED
843 ecs_api_edp_get_producer_status 200 prod-b ENABLED
844 ecs_api_edp_get_producer_status 200 prod-c ENABLED
845 ecs_api_edp_get_producer_status 200 prod-d ENABLED
846 ecs_api_edp_get_producer_status 200 prod-e ENABLED
847 ecs_api_edp_get_producer_status 200 prod-f ENABLED
849 if [ -z "$FLAT_A1_EI" ]; then
850 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
851 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
852 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
853 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
854 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
856 ecs_api_a1_get_job_status 200 job1 ENABLED
857 ecs_api_a1_get_job_status 200 job2 ENABLED
858 ecs_api_a1_get_job_status 200 job3 ENABLED
859 ecs_api_a1_get_job_status 200 job8 ENABLED
860 ecs_api_a1_get_job_status 200 job10 ENABLED
863 # Arm producer prod-a for supervision failure
864 prodstub_arm_producer 200 prod-a 400
866 # Wait for producer prod-a to go disabled
867 ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
869 if [ $ECS_VERSION == "V1-1" ]; then
870 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
872 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
875 ecs_api_edp_get_producer_status 200 prod-a DISABLED
876 ecs_api_edp_get_producer_status 200 prod-b ENABLED
877 ecs_api_edp_get_producer_status 200 prod-c ENABLED
878 ecs_api_edp_get_producer_status 200 prod-d ENABLED
879 ecs_api_edp_get_producer_status 200 prod-e ENABLED
880 ecs_api_edp_get_producer_status 200 prod-f ENABLED
882 if [ -z "$FLAT_A1_EI" ]; then
883 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
884 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
885 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
886 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
887 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
889 ecs_api_a1_get_job_status 200 job1 ENABLED
890 ecs_api_a1_get_job_status 200 job2 ENABLED
891 ecs_api_a1_get_job_status 200 job3 ENABLED
892 ecs_api_a1_get_job_status 200 job8 ENABLED
893 ecs_api_a1_get_job_status 200 job10 ENABLED
896 # Wait for producer prod-a to be removed
897 ecs_equal json:ei-producer/v1/eiproducers 5 1000
899 if [ $ECS_VERSION == "V1-1" ]; then
900 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
902 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
906 ecs_api_edp_get_producer_status 404 prod-a
907 ecs_api_edp_get_producer_status 200 prod-b ENABLED
908 ecs_api_edp_get_producer_status 200 prod-c ENABLED
909 ecs_api_edp_get_producer_status 200 prod-d ENABLED
910 ecs_api_edp_get_producer_status 200 prod-e ENABLED
911 ecs_api_edp_get_producer_status 200 prod-f ENABLED
913 if [ -z "$FLAT_A1_EI" ]; then
914 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
915 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
916 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
917 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
918 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
920 ecs_api_a1_get_job_status 200 job1 DISABLED
921 ecs_api_a1_get_job_status 200 job2 DISABLED
922 ecs_api_a1_get_job_status 200 job3 ENABLED
923 ecs_api_a1_get_job_status 200 job8 ENABLED
924 ecs_api_a1_get_job_status 200 job10 ENABLED
927 cr_equal received_callbacks 6 30
928 cr_equal received_callbacks?id=job1-status 1
929 cr_equal received_callbacks?id=job2-status 1
931 cr_api_check_all_ecs_events 200 job1-status DISABLED
932 cr_api_check_all_ecs_events 200 job2-status DISABLED
935 # Arm producer prod-e for supervision failure
936 prodstub_arm_producer 200 prod-e 400
938 ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000
940 if [ $ECS_VERSION == "V1-1" ]; then
941 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
943 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
946 ecs_api_edp_get_producer_status 404 prod-a
947 ecs_api_edp_get_producer_status 200 prod-b ENABLED
948 ecs_api_edp_get_producer_status 200 prod-c ENABLED
949 ecs_api_edp_get_producer_status 200 prod-d ENABLED
950 ecs_api_edp_get_producer_status 200 prod-e DISABLED
951 ecs_api_edp_get_producer_status 200 prod-f ENABLED
953 if [ -z "$FLAT_A1_EI" ]; then
954 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
955 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
956 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
957 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
958 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
960 ecs_api_a1_get_job_status 200 job1 DISABLED
961 ecs_api_a1_get_job_status 200 job2 DISABLED
962 ecs_api_a1_get_job_status 200 job3 ENABLED
963 ecs_api_a1_get_job_status 200 job8 ENABLED
964 ecs_api_a1_get_job_status 200 job10 ENABLED
967 #Disable create for job10 in prod-e
968 prodstub_arm_job_create 200 prod-e job10 400
970 #Update tjob 10 - only prod-f will be updated
971 if [ -z "$FLAT_A1_EI" ]; then
972 ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
974 ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json
976 #Reset producer and job responses
977 prodstub_arm_producer 200 prod-e 200
978 prodstub_arm_job_create 200 prod-e job10 200
980 ecs_api_edp_get_producer_status 200 prod-e ENABLED 360
982 if [ $ECS_VERSION == "V1-1" ]; then
983 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
985 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
988 #Wait for job to be updated
991 if [ $ECS_VERSION == "V1-1" ]; then
992 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
994 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
997 prodstub_arm_producer 200 prod-f 400
999 ecs_api_edp_get_producer_status 200 prod-f DISABLED 360
1001 ecs_equal json:ei-producer/v1/eiproducers 4 1000
1003 if [ $ECS_VERSION == "V1-1" ]; then
1004 ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
1006 ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1009 ecs_api_edp_get_producer_status 404 prod-a
1010 ecs_api_edp_get_producer_status 200 prod-b ENABLED
1011 ecs_api_edp_get_producer_status 200 prod-c ENABLED
1012 ecs_api_edp_get_producer_status 200 prod-d ENABLED
1013 ecs_api_edp_get_producer_status 200 prod-e ENABLED
1014 ecs_api_edp_get_producer_status 404 prod-f
1016 if [ -z "$FLAT_A1_EI" ]; then
1017 ecs_api_a1_get_job_status 200 type1 job1 DISABLED
1018 ecs_api_a1_get_job_status 200 type1 job2 DISABLED
1019 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
1020 ecs_api_a1_get_job_status 200 type4 job8 ENABLED
1021 ecs_api_a1_get_job_status 200 type6 job10 ENABLED
1023 ecs_api_a1_get_job_status 200 job1 DISABLED
1024 ecs_api_a1_get_job_status 200 job2 DISABLED
1025 ecs_api_a1_get_job_status 200 job3 ENABLED
1026 ecs_api_a1_get_job_status 200 job8 ENABLED
1027 ecs_api_a1_get_job_status 200 job10 ENABLED
1030 cr_equal received_callbacks 6
1036 #### TEST COMPLETE ####
1040 auto_clean_environment