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="Experimental ECS test case"
23 #App names to include in the test, space separated list
24 INCLUDED_IMAGES="ECS PRODSTUB"
26 . ../common/testcase_common.sh $@
27 . ../common/ecs_api_functions.sh
28 . ../common/prodstub_api_functions.sh
46 # Setup prodstub sim to accept calls for producers, types and jobs
47 prodstub_arm_supervision 200 prod-a
48 prodstub_arm_supervision 200 prod-b
49 prodstub_arm_supervision 200 prod-c
51 prodstub_arm_type 200 prod-a type1
52 prodstub_arm_type 200 prod-b type2
53 prodstub_arm_type 200 prod-b type3
55 prodstub_disarm_type 200 prod-b type3
56 prodstub_arm_type 200 prod-b type1
57 prodstub_disarm_type 200 prod-b type1
59 prodstub_arm_create 200 prod-a job1
60 prodstub_arm_create 200 prod-a job2
61 prodstub_arm_create 200 prod-b job3
63 prodstub_arm_delete 200 prod-a job1
64 prodstub_arm_delete 200 prod-a job2
65 prodstub_arm_delete 200 prod-b job3
67 prodstub_arm_create 200 prod-b job4
68 prodstub_arm_create 200 prod-a job4
70 prodstub_arm_create 200 prod-b job5
71 prodstub_arm_create 200 prod-a job5
72 prodstub_arm_delete 200 prod-a job5
74 prodstub_arm_create 200 prod-b job6
77 ecs_api_service_status 200
79 # Initial tests - no config made
80 ecs_api_a1_get_type_ids 200 EMPTY
81 ecs_api_a1_get_type 404 test-type
83 ecs_api_edp_get_type_ids 200 EMPTY
84 ecs_api_edp_get_type 404 test-type
86 ecs_api_edp_get_producer_ids 200 EMPTY
87 ecs_api_edp_get_producer 404 test-prod
89 ecs_api_edp_get_producer_status 404 test-prod
91 ecs_api_edp_delete_producer 404 test-prod
93 ecs_api_a1_get_job_ids 404 test-type NOWNER
94 ecs_api_a1_get_job_ids 404 test-type test-owner
96 ecs_api_a1_get_job 404 test-type test-job
98 ecs_api_a1_get_job_status 404 test-type test-job
100 ecs_api_a1_delete_job 404 test-type test-job
102 ecs_api_edp_get_producer_jobs 404 test-prod
105 # Setup of producer/job and test apis
107 ecs_api_edp_put_producer 201 prod-a http://producer-stub:8092/callbacks/create/prod-a http://producer-stub:8092/callbacks/delete/prod-a http://producer-stub:8092/callbacks/supervision/prod-a type1 testdata/ecs/ei-type-1.json
108 ecs_api_edp_put_producer 200 prod-a http://producer-stub:8092/callbacks/create/prod-a http://producer-stub:8092/callbacks/delete/prod-a http://producer-stub:8092/callbacks/supervision/prod-a type1 testdata/ecs/ei-type-1.json
110 ecs_api_a1_get_type_ids 200 type1
111 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
113 ecs_api_edp_get_type_ids 200 type1
114 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
116 ecs_api_edp_get_producer_ids 200 prod-a
117 ecs_api_edp_get_producer 200 prod-a http://producer-stub:8092/callbacks/create/prod-a http://producer-stub:8092/callbacks/delete/prod-a http://producer-stub:8092/callbacks/supervision/prod-a type1 testdata/ecs/ei-type-1.json
119 ecs_api_edp_get_producer_status 200 prod-a ENABLED
121 ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY
122 ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY
124 ecs_api_a1_get_job 404 type1 test-job
126 ecs_api_a1_get_job_status 404 type1 test-job
128 ecs_api_edp_get_producer_jobs 200 prod-a EMPTY
132 ecs_api_a1_put_job 201 type1 job1 http://localhost:80/target1 ric1 testdata/ecs/job-template.json
134 prodstub_check_jobdata 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json
136 ecs_api_a1_get_job_ids 200 type1 NOWNER job1
137 ecs_api_a1_get_job_ids 200 type1 ric1 job1
139 ecs_api_a1_get_job 200 type1 job1 http://localhost:80/target1 ric1 testdata/ecs/job-template.json
141 ecs_api_a1_get_job_status 200 type1 job1 ENABLED
143 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json
147 ecs_api_a1_put_job 201 type1 job2 http://localhost:80/target2 ric2 testdata/ecs/job-template.json
149 prodstub_check_jobdata 200 prod-a job2 type1 http://localhost:80/target2 testdata/ecs/job-template.json
151 ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
152 ecs_api_a1_get_job_ids 200 type1 ric1 job1
153 ecs_api_a1_get_job_ids 200 type1 ric2 job2
155 ecs_api_a1_get_job 200 type1 job2 http://localhost:80/target2 ric2 testdata/ecs/job-template.json
157 ecs_api_a1_get_job_status 200 type1 job2 ENABLED
159 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json job2 type1 http://localhost:80/target2 testdata/ecs/job-template.json
163 ecs_api_edp_put_producer 201 prod-b http://producer-stub:8092/callbacks/create/prod-b http://producer-stub:8092/callbacks/delete/prod-b http://producer-stub:8092/callbacks/supervision/prod-b type2 testdata/ecs/ei-type-2.json
165 ecs_api_a1_get_type_ids 200 type1 type2
166 ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json
167 ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json
169 ecs_api_edp_get_type_ids 200 type1 type2
170 ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
171 ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
173 ecs_api_edp_get_producer_ids 200 prod-a prod-b
174 ecs_api_edp_get_producer 200 prod-a http://producer-stub:8092/callbacks/create/prod-a http://producer-stub:8092/callbacks/delete/prod-a http://producer-stub:8092/callbacks/supervision/prod-a type1 testdata/ecs/ei-type-1.json
175 ecs_api_edp_get_producer 200 prod-b http://producer-stub:8092/callbacks/create/prod-b http://producer-stub:8092/callbacks/delete/prod-b http://producer-stub:8092/callbacks/supervision/prod-b type2 testdata/ecs/ei-type-2.json
177 ecs_api_edp_get_producer_status 200 prod-b ENABLED
181 ecs_api_a1_put_job 201 type2 job3 http://localhost:80/target3 ric3 testdata/ecs/job-template.json
183 prodstub_check_jobdata 200 prod-b job3 type2 http://localhost:80/target3 testdata/ecs/job-template.json
185 ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2
186 ecs_api_a1_get_job_ids 200 type2 NOWNER job3
187 ecs_api_a1_get_job_ids 200 type1 ric1 job1
188 ecs_api_a1_get_job_ids 200 type1 ric2 job2
189 ecs_api_a1_get_job_ids 200 type2 ric3 job3
191 ecs_api_a1_get_job 200 type2 job3 http://localhost:80/target3 ric3 testdata/ecs/job-template.json
193 ecs_api_a1_get_job_status 200 type2 job3 ENABLED
195 ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 http://localhost:80/target1 testdata/ecs/job-template.json job2 type1 http://localhost:80/target2 testdata/ecs/job-template.json
196 ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 http://localhost:80/target3 testdata/ecs/job-template.json
200 ecs_api_edp_put_producer 201 prod-c http://producer-stub:8092/callbacks/create/prod-c http://producer-stub:8092/callbacks/delete/prod-c http://producer-stub:8092/callbacks/supervision/prod-c NOTYPE
202 ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
203 ecs_api_edp_get_producer 200 prod-a http://producer-stub:8092/callbacks/create/prod-a http://producer-stub:8092/callbacks/delete/prod-a http://producer-stub:8092/callbacks/supervision/prod-a type1 testdata/ecs/ei-type-1.json
204 ecs_api_edp_get_producer 200 prod-b http://producer-stub:8092/callbacks/create/prod-b http://producer-stub:8092/callbacks/delete/prod-b http://producer-stub:8092/callbacks/supervision/prod-b type2 testdata/ecs/ei-type-2.json
205 ecs_api_edp_get_producer 200 prod-c http://producer-stub:8092/callbacks/create/prod-c http://producer-stub:8092/callbacks/delete/prod-c http://producer-stub:8092/callbacks/supervision/prod-c EMPTY
207 ecs_api_edp_get_producer_status 200 prod-c ENABLED
209 ecs_api_a1_delete_job 204 type2 job3
211 ecs_api_edp_delete_producer 204 prod-b
220 #### TEST COMPLETE ####
225 auto_clean_containers