BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 1 | #!/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 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 21 | TC_ONELINE_DESCR="ECS full intefaces walkthrough" |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 22 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 23 | #App names to include in the test, space separated list |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 24 | INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP" |
| 25 | |
| 26 | #SUPPORTED TEST ENV FILE |
| 27 | SUPPORTED_PROFILES="ONAP-MASTER ORAN-MASTER" |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 28 | |
| 29 | . ../common/testcase_common.sh $@ |
| 30 | . ../common/ecs_api_functions.sh |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 31 | . ../common/prodstub_api_functions.sh |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 32 | . ../common/cr_api_functions.sh |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 33 | |
| 34 | #### TEST BEGIN #### |
| 35 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 36 | FLAT_A1_EI="1" |
| 37 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 38 | clean_containers |
| 39 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 40 | use_ecs_rest_https |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 41 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 42 | use_prod_stub_https |
| 43 | |
| 44 | use_simulator_https |
| 45 | |
| 46 | use_cr_https |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 47 | |
| 48 | start_ecs |
| 49 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 50 | start_prod_stub |
| 51 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 52 | set_ecs_trace |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 53 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 54 | start_control_panel |
| 55 | |
| 56 | if [ "$PMS_VERSION" == "V2" ]; then |
| 57 | start_ric_simulators ricsim_g3 4 STD_2.0.0 |
| 58 | fi |
| 59 | |
| 60 | start_cr |
| 61 | |
| 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" |
| 69 | |
| 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" |
| 75 | |
| 76 | ### Setup prodstub sim to accept calls for producers, types and jobs |
| 77 | ## prod-a type1 |
| 78 | ## prod-b type1 and type2 |
| 79 | ## prod-c no-type |
| 80 | ## prod-d type4 |
| 81 | ## prod-e type6 |
| 82 | ## prod-f type6 |
| 83 | |
| 84 | ## job1 -> prod-a |
| 85 | ## job2 -> prod-a |
| 86 | ## job3 -> prod-b |
| 87 | ## job4 -> prod-a |
| 88 | ## job6 -> prod-b |
| 89 | ## job8 -> prod-d |
| 90 | ## job10 -> prod-e and prod-f |
| 91 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 92 | prodstub_arm_producer 200 prod-a |
| 93 | prodstub_arm_producer 200 prod-b |
| 94 | prodstub_arm_producer 200 prod-c |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 95 | prodstub_arm_producer 200 prod-d |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 96 | prodstub_arm_producer 200 prod-e |
| 97 | prodstub_arm_producer 200 prod-f |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 98 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 99 | prodstub_arm_type 200 prod-a type1 |
| 100 | prodstub_arm_type 200 prod-b type2 |
| 101 | prodstub_arm_type 200 prod-b type3 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 102 | prodstub_arm_type 200 prod-d type4 |
| 103 | prodstub_arm_type 200 prod-e type6 |
| 104 | prodstub_arm_type 200 prod-f type6 |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 105 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 106 | prodstub_disarm_type 200 prod-b type3 |
| 107 | prodstub_arm_type 200 prod-b type1 |
| 108 | prodstub_disarm_type 200 prod-b type1 |
| 109 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 110 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 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 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 114 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 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 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 118 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 119 | prodstub_arm_job_create 200 prod-b job4 |
| 120 | prodstub_arm_job_create 200 prod-a job4 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 121 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 122 | prodstub_arm_job_create 200 prod-b job6 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 123 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 124 | prodstub_arm_job_create 200 prod-d job8 |
| 125 | |
| 126 | prodstub_arm_job_create 200 prod-e job10 |
| 127 | prodstub_arm_job_create 200 prod-f job10 |
| 128 | |
| 129 | ### ecs status |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 130 | ecs_api_service_status 200 |
| 131 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 132 | cr_equal received_callbacks 0 |
| 133 | |
| 134 | ### Initial tests - no config made |
| 135 | ### GET: type ids, types, producer ids, producers, job ids, jobs |
| 136 | ### DELETE: jobs |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 137 | ecs_api_a1_get_type_ids 200 EMPTY |
| 138 | ecs_api_a1_get_type 404 test-type |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 139 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 140 | ecs_api_edp_get_type_ids 200 EMPTY |
| 141 | ecs_api_edp_get_type 404 test-type |
| 142 | |
| 143 | ecs_api_edp_get_producer_ids 200 EMPTY |
| 144 | ecs_api_edp_get_producer 404 test-prod |
| 145 | |
| 146 | ecs_api_edp_get_producer_status 404 test-prod |
| 147 | |
| 148 | ecs_api_edp_delete_producer 404 test-prod |
| 149 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 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 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 153 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 154 | ecs_api_a1_get_job 404 test-type test-job |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 155 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 156 | ecs_api_a1_get_job_status 404 test-type test-job |
| 157 | else |
| 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 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 160 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 161 | ecs_api_a1_get_job 404 test-job |
| 162 | |
| 163 | ecs_api_a1_get_job_status 404 test-job |
| 164 | fi |
| 165 | |
| 166 | if [ -z "$FLAT_A1_EI" ]; then |
| 167 | ecs_api_a1_delete_job 404 test-type test-job |
| 168 | else |
| 169 | ecs_api_a1_delete_job 404 test-job |
| 170 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 171 | |
| 172 | ecs_api_edp_get_producer_jobs 404 test-prod |
| 173 | |
| 174 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 175 | ### Setup of producer/job and testing apis ### |
| 176 | |
| 177 | ## Setup prod-a |
| 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 |
| 180 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 181 | |
| 182 | ecs_api_a1_get_type_ids 200 type1 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 183 | if [ -z "$FLAT_A1_EI" ]; then |
| 184 | ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json |
| 185 | else |
| 186 | ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json |
| 187 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 188 | |
| 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 |
| 191 | |
| 192 | ecs_api_edp_get_producer_ids 200 prod-a |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 193 | |
| 194 | ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 195 | |
| 196 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 197 | |
| 198 | ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY |
| 199 | ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY |
| 200 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 201 | if [ -z "$FLAT_A1_EI" ]; then |
| 202 | ecs_api_a1_get_job 404 type1 test-job |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 203 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 204 | ecs_api_a1_get_job_status 404 type1 test-job |
| 205 | else |
| 206 | ecs_api_a1_get_job 404 test-job |
| 207 | |
| 208 | ecs_api_a1_get_job_status 404 test-job |
| 209 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 210 | |
| 211 | ecs_api_edp_get_producer_jobs 200 prod-a EMPTY |
| 212 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 213 | ## Create a job for prod-a |
| 214 | ## job1 - prod-a |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 215 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 216 | ecs_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 217 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 218 | ecs_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 219 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 220 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 221 | # Check the job data in the producer |
| 222 | prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 223 | |
| 224 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 225 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 |
| 226 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 227 | if [ ! -z "$FLAT_A1_EI" ]; then |
| 228 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 |
| 229 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 230 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 231 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 232 | ecs_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 233 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 234 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 235 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 236 | ecs_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 237 | |
| 238 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 239 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 240 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 241 | prodstub_equal create/prod-a/job1 1 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 242 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 243 | ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 244 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 245 | ## Create a second job for prod-a |
| 246 | ## job2 - prod-a |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 247 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 248 | ecs_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 249 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 250 | ecs_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 251 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 252 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 253 | # Check the job data in the producer |
| 254 | prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 255 | |
| 256 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 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 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 259 | if [ ! -z "$FLAT_A1_EI" ]; then |
| 260 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
| 261 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 262 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 263 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 264 | ecs_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 265 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 266 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 267 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 268 | ecs_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 269 | |
| 270 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 271 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 272 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 273 | prodstub_equal create/prod-a/job2 1 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 274 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 275 | ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json job2 type1 $TARGET2 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 276 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 277 | ## Setup prod-b |
| 278 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 279 | |
| 280 | ecs_api_a1_get_type_ids 200 type1 type2 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 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 |
| 284 | else |
| 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 |
| 287 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 288 | |
| 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 |
| 292 | |
| 293 | ecs_api_edp_get_producer_ids 200 prod-a prod-b |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 294 | |
| 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 |
| 297 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 298 | |
| 299 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 300 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 301 | ## Create job for prod-b |
| 302 | ## job3 - prod-b |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 303 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 304 | ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 305 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 306 | ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 307 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 308 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 309 | prodstub_equal create/prod-b/job3 1 |
| 310 | |
| 311 | # Check the job data in the producer |
| 312 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 313 | |
| 314 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 |
| 315 | ecs_api_a1_get_job_ids 200 type2 NOWNER job3 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 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 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 319 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 320 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 321 | ecs_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 322 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 323 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 324 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 325 | ecs_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 326 | |
| 327 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 328 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 329 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 330 | ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 testdata/ecs/job-template.json job2 type1 $TARGET2 testdata/ecs/job-template.json |
| 331 | ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 332 | |
| 333 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 334 | ## Setup prod-c (no types) |
| 335 | ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE |
| 336 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 337 | |
| 338 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 339 | |
| 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 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 343 | |
| 344 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 345 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 346 | |
| 347 | ## Delete job3 and prod-b and re-create if different order |
| 348 | |
| 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 |
| 352 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 353 | if [ -z "$FLAT_A1_EI" ]; then |
| 354 | ecs_api_a1_delete_job 204 type2 job3 |
| 355 | else |
| 356 | ecs_api_a1_delete_job 204 job3 |
| 357 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 358 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 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 |
| 361 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 362 | ecs_api_edp_delete_producer 204 prod-b |
| 363 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 364 | ecs_api_edp_get_producer_status 404 prod-b |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 365 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 366 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
| 367 | ecs_api_edp_get_producer_ids 200 prod-a prod-c |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 368 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 369 | prodstub_equal delete/prod-b/job3 1 |
| 370 | |
| 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 |
| 373 | else |
| 374 | ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json |
| 375 | fi |
| 376 | |
| 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 |
| 379 | |
| 380 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 381 | |
| 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 |
| 385 | else |
| 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 |
| 388 | fi |
| 389 | |
| 390 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template2.json |
| 391 | |
| 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 |
| 394 | |
| 395 | prodstub_equal create/prod-b/job3 2 |
| 396 | prodstub_equal delete/prod-b/job3 1 |
| 397 | |
| 398 | # Delete only the producer |
| 399 | ecs_api_edp_delete_producer 204 prod-b |
| 400 | |
| 401 | ecs_api_edp_get_producer_status 404 prod-b |
| 402 | |
| 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 |
| 405 | |
| 406 | if [ -z "$FLAT_A1_EI" ]; then |
| 407 | ecs_api_a1_get_job_status 200 type2 job3 DISABLED |
| 408 | else |
| 409 | ecs_api_a1_get_job_status 200 job3 DISABLED |
| 410 | fi |
| 411 | |
| 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 |
| 415 | |
| 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 |
| 418 | |
| 419 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 420 | |
| 421 | if [ -z "$FLAT_A1_EI" ]; then |
| 422 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 423 | else |
| 424 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 425 | fi |
| 426 | |
| 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 |
| 430 | |
| 431 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 testdata/ecs/job-template2.json |
| 432 | |
| 433 | |
| 434 | ## Setup prod-d |
| 435 | ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 436 | |
| 437 | ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY |
| 438 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 439 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 440 | ecs_api_a1_put_job 201 type4 job8 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 441 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 442 | ecs_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ecs/job-template.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 443 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 444 | |
| 445 | prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 testdata/ecs/job-template.json |
| 446 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 447 | prodstub_equal create/prod-d/job8 1 |
| 448 | prodstub_equal delete/prod-d/job8 0 |
| 449 | |
| 450 | ecs_api_a1_get_job_ids 200 type4 NOWNER job8 |
| 451 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 452 | if [ -z "$FLAT_A1_EI" ]; then |
| 453 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 454 | else |
| 455 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 456 | fi |
| 457 | |
| 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 |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 460 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 461 | if [ -z "$FLAT_A1_EI" ]; then |
| 462 | ecs_api_a1_get_job_ids 404 type4 NOWNER |
| 463 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 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 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 466 | fi |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 467 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 468 | if [ -z "$FLAT_A1_EI" ]; then |
| 469 | ecs_api_a1_get_job_status 200 type4 job8 DISABLED |
| 470 | else |
| 471 | ecs_api_a1_get_job_status 200 job8 DISABLED |
| 472 | fi |
| 473 | |
| 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 |
| 477 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 478 | prodstub_equal create/prod-d/job8 1 |
| 479 | prodstub_equal delete/prod-d/job8 0 |
| 480 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 481 | ## Re-setup prod-d |
| 482 | ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 483 | |
| 484 | if [ -z "$FLAT_A1_EI" ]; then |
| 485 | ecs_api_a1_get_job_ids 404 type4 NOWNER |
| 486 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 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 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 489 | fi |
| 490 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 491 | if [ -z "$FLAT_A1_EI" ]; then |
| 492 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 493 | else |
| 494 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 495 | fi |
| 496 | |
| 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 |
| 501 | |
| 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 |
| 505 | |
| 506 | prodstub_equal create/prod-d/job8 2 |
| 507 | prodstub_equal delete/prod-d/job8 0 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 508 | |
| 509 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 510 | ## Setup prod-e |
| 511 | ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json |
| 512 | |
| 513 | ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY |
| 514 | |
| 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 |
| 517 | else |
| 518 | ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json |
| 519 | fi |
| 520 | |
| 521 | prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 testdata/ecs/job-template.json |
| 522 | |
| 523 | prodstub_equal create/prod-e/job10 1 |
| 524 | prodstub_equal delete/prod-e/job10 0 |
| 525 | |
| 526 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 527 | |
| 528 | if [ -z "$FLAT_A1_EI" ]; then |
| 529 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 530 | else |
| 531 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 532 | fi |
| 533 | |
| 534 | ## Setup prod-f |
| 535 | ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json |
| 536 | |
| 537 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 538 | |
| 539 | prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 testdata/ecs/job-template.json |
| 540 | |
| 541 | prodstub_equal create/prod-f/job10 1 |
| 542 | prodstub_equal delete/prod-f/job10 0 |
| 543 | |
| 544 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 545 | |
| 546 | if [ -z "$FLAT_A1_EI" ]; then |
| 547 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 548 | else |
| 549 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 550 | fi |
| 551 | |
| 552 | ## Status updates prod-a and jobs |
| 553 | |
| 554 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 555 | |
| 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 |
| 562 | |
| 563 | # Arm producer prod-a for supervision failure |
| 564 | prodstub_arm_producer 200 prod-a 400 |
| 565 | |
| 566 | # Wait for producer prod-a to go disabled |
| 567 | ecs_api_edp_get_producer_status 200 prod-a DISABLED 360 |
| 568 | |
| 569 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 570 | |
| 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 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 577 | |
| 578 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 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 |
| 585 | else |
| 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 |
| 591 | fi |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 592 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame^] | 593 | # Arm producer prod-a for supervision |
| 594 | prodstub_arm_producer 200 prod-a 200 |
| 595 | |
| 596 | # Wait for producer prod-a to go enabled |
| 597 | ecs_api_edp_get_producer_status 200 prod-a ENABLED 360 |
| 598 | |
| 599 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 600 | |
| 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 |
| 607 | |
| 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 |
| 614 | else |
| 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 |
| 620 | fi |
| 621 | |
| 622 | # Arm producer prod-a for supervision failure |
| 623 | prodstub_arm_producer 200 prod-a 400 |
| 624 | |
| 625 | # Wait for producer prod-a to go disabled |
| 626 | ecs_api_edp_get_producer_status 200 prod-a DISABLED 360 |
| 627 | |
| 628 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 629 | |
| 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 |
| 636 | |
| 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 |
| 643 | else |
| 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 |
| 649 | fi |
| 650 | |
| 651 | # Wait for producer prod-a to be removed |
| 652 | ecs_equal json:ei-producer/v1/eiproducers 5 1000 |
| 653 | |
| 654 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 655 | |
| 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 |
| 662 | |
| 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 |
| 669 | else |
| 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 |
| 675 | fi |
| 676 | |
| 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 |
| 680 | |
| 681 | cr_api_check_all_ecs_events 200 job1-status DISABLED |
| 682 | cr_api_check_all_ecs_events 200 job2-status DISABLED |
| 683 | |
| 684 | |
| 685 | # Arm producer prod-e for supervision failure |
| 686 | prodstub_arm_producer 200 prod-e 400 |
| 687 | |
| 688 | ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000 |
| 689 | |
| 690 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 691 | |
| 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 |
| 698 | |
| 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 |
| 705 | else |
| 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 |
| 711 | fi |
| 712 | |
| 713 | #Disable create for job10 in prod-e |
| 714 | prodstub_arm_job_create 200 prod-e job10 400 |
| 715 | |
| 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 |
| 719 | else |
| 720 | ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json |
| 721 | fi |
| 722 | #Reset producer and job responses |
| 723 | prodstub_arm_producer 200 prod-e 200 |
| 724 | prodstub_arm_job_create 200 prod-e job10 200 |
| 725 | |
| 726 | ecs_api_edp_get_producer_status 200 prod-e ENABLED 360 |
| 727 | |
| 728 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 729 | |
| 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 testdata/ecs/job-template2.json |
| 733 | prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 testdata/ecs/job-template2.json |
| 734 | |
| 735 | prodstub_arm_producer 200 prod-f 400 |
| 736 | |
| 737 | ecs_api_edp_get_producer_status 200 prod-f DISABLED 360 |
| 738 | |
| 739 | ecs_equal json:ei-producer/v1/eiproducers 4 1000 |
| 740 | |
| 741 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e |
| 742 | |
| 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 |
| 749 | |
| 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 |
| 756 | else |
| 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 |
| 762 | fi |
| 763 | |
| 764 | cr_equal received_callbacks 6 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 765 | |
| 766 | check_ecs_logs |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 767 | |
| 768 | store_logs END |
| 769 | |
| 770 | #### TEST COMPLETE #### |
| 771 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 772 | print_result |
| 773 | |
| 774 | auto_clean_containers |