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 | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 23 | #App names to include in the test when running docker, space separated list |
| 24 | DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 25 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 26 | #App names to include in the test when running kubernetes, space separated list |
| 27 | KUBE_INCLUDED_IMAGES=" PRODSTUB CR ECS RICSIM CP " |
| 28 | #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list |
| 29 | KUBE_PRESTARTED_IMAGES=" " |
| 30 | |
| 31 | #Supported test environment profiles |
BjornMagnussonXA | 89b64ab | 2020-12-16 09:21:01 +0100 | [diff] [blame] | 32 | SUPPORTED_PROFILES="ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 33 | #Supported run modes |
| 34 | SUPPORTED_RUNMODES="DOCKER KUBE" |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 35 | |
| 36 | . ../common/testcase_common.sh $@ |
| 37 | . ../common/ecs_api_functions.sh |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 38 | . ../common/prodstub_api_functions.sh |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 39 | . ../common/cr_api_functions.sh |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 40 | . ../common/control_panel_api_functions.sh |
| 41 | . ../common/controller_api_functions.sh |
| 42 | . ../common/ricsimulator_api_functions.sh |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 43 | |
| 44 | #### TEST BEGIN #### |
| 45 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 46 | FLAT_A1_EI="1" |
| 47 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 48 | clean_environment |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 49 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 50 | use_ecs_rest_https |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 51 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 52 | use_prod_stub_https |
| 53 | |
| 54 | use_simulator_https |
| 55 | |
| 56 | use_cr_https |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 57 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 58 | start_ecs $SIM_GROUP/$ECS_COMPOSE_DIR/application.yaml |
| 59 | |
| 60 | if [ $RUNMODE == "KUBE" ]; then |
| 61 | ecs_api_admin_reset |
| 62 | fi |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 63 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 64 | start_prod_stub |
| 65 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 66 | set_ecs_trace |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 67 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 68 | start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/application.properties |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 69 | |
| 70 | if [ "$PMS_VERSION" == "V2" ]; then |
| 71 | start_ric_simulators ricsim_g3 4 STD_2.0.0 |
| 72 | fi |
| 73 | |
| 74 | start_cr |
| 75 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 76 | CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK" |
| 77 | CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 78 | TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery" |
| 79 | TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery" |
| 80 | TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery" |
| 81 | TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery" |
| 82 | TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery" |
| 83 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 84 | STATUS1="$CR_SERVICE_PATH/job1-status" |
| 85 | STATUS2="$CR_SERVICE_PATH/job2-status" |
| 86 | STATUS3="$CR_SERVICE_PATH/job3-status" |
| 87 | STATUS8="$CR_SERVICE_PATH/job8-status" |
| 88 | STATUS10="$CR_SERVICE_PATH/job10-status" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 89 | |
| 90 | ### Setup prodstub sim to accept calls for producers, types and jobs |
| 91 | ## prod-a type1 |
| 92 | ## prod-b type1 and type2 |
| 93 | ## prod-c no-type |
| 94 | ## prod-d type4 |
| 95 | ## prod-e type6 |
| 96 | ## prod-f type6 |
| 97 | |
| 98 | ## job1 -> prod-a |
| 99 | ## job2 -> prod-a |
| 100 | ## job3 -> prod-b |
| 101 | ## job4 -> prod-a |
| 102 | ## job6 -> prod-b |
| 103 | ## job8 -> prod-d |
| 104 | ## job10 -> prod-e and prod-f |
| 105 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 106 | prodstub_arm_producer 200 prod-a |
| 107 | prodstub_arm_producer 200 prod-b |
| 108 | prodstub_arm_producer 200 prod-c |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 109 | prodstub_arm_producer 200 prod-d |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 110 | prodstub_arm_producer 200 prod-e |
| 111 | prodstub_arm_producer 200 prod-f |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 112 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 113 | prodstub_arm_type 200 prod-a type1 |
| 114 | prodstub_arm_type 200 prod-b type2 |
| 115 | prodstub_arm_type 200 prod-b type3 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 116 | prodstub_arm_type 200 prod-d type4 |
| 117 | prodstub_arm_type 200 prod-e type6 |
| 118 | prodstub_arm_type 200 prod-f type6 |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 119 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 120 | prodstub_disarm_type 200 prod-b type3 |
| 121 | prodstub_arm_type 200 prod-b type1 |
| 122 | prodstub_disarm_type 200 prod-b type1 |
| 123 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 124 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 125 | prodstub_arm_job_create 200 prod-a job1 |
| 126 | prodstub_arm_job_create 200 prod-a job2 |
| 127 | prodstub_arm_job_create 200 prod-b job3 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 128 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 129 | prodstub_arm_job_delete 200 prod-a job1 |
| 130 | prodstub_arm_job_delete 200 prod-a job2 |
| 131 | prodstub_arm_job_delete 200 prod-b job3 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 132 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 133 | prodstub_arm_job_create 200 prod-b job4 |
| 134 | prodstub_arm_job_create 200 prod-a job4 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 135 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 136 | prodstub_arm_job_create 200 prod-b job6 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 137 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 138 | prodstub_arm_job_create 200 prod-d job8 |
| 139 | |
| 140 | prodstub_arm_job_create 200 prod-e job10 |
| 141 | prodstub_arm_job_create 200 prod-f job10 |
| 142 | |
| 143 | ### ecs status |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 144 | ecs_api_service_status 200 |
| 145 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 146 | cr_equal received_callbacks 0 |
| 147 | |
| 148 | ### Initial tests - no config made |
| 149 | ### GET: type ids, types, producer ids, producers, job ids, jobs |
| 150 | ### DELETE: jobs |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 151 | ecs_api_a1_get_type_ids 200 EMPTY |
| 152 | ecs_api_a1_get_type 404 test-type |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 153 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 154 | ecs_api_edp_get_type_ids 200 EMPTY |
| 155 | ecs_api_edp_get_type 404 test-type |
| 156 | |
| 157 | ecs_api_edp_get_producer_ids 200 EMPTY |
| 158 | ecs_api_edp_get_producer 404 test-prod |
| 159 | |
| 160 | ecs_api_edp_get_producer_status 404 test-prod |
| 161 | |
| 162 | ecs_api_edp_delete_producer 404 test-prod |
| 163 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 164 | if [ -z "$FLAT_A1_EI" ]; then |
| 165 | ecs_api_a1_get_job_ids 404 test-type NOWNER |
| 166 | ecs_api_a1_get_job_ids 404 test-type test-owner |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 167 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 168 | ecs_api_a1_get_job 404 test-type test-job |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 169 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 170 | ecs_api_a1_get_job_status 404 test-type test-job |
| 171 | else |
| 172 | ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY |
| 173 | ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 174 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 175 | ecs_api_a1_get_job 404 test-job |
| 176 | |
| 177 | ecs_api_a1_get_job_status 404 test-job |
| 178 | fi |
| 179 | |
| 180 | if [ -z "$FLAT_A1_EI" ]; then |
| 181 | ecs_api_a1_delete_job 404 test-type test-job |
| 182 | else |
| 183 | ecs_api_a1_delete_job 404 test-job |
| 184 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 185 | |
| 186 | ecs_api_edp_get_producer_jobs 404 test-prod |
| 187 | |
| 188 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 189 | ### Setup of producer/job and testing apis ### |
| 190 | |
| 191 | ## Setup prod-a |
| 192 | ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 193 | ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 194 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 195 | |
| 196 | ecs_api_a1_get_type_ids 200 type1 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 197 | if [ -z "$FLAT_A1_EI" ]; then |
| 198 | ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json |
| 199 | else |
| 200 | ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json |
| 201 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 202 | |
| 203 | ecs_api_edp_get_type_ids 200 type1 |
| 204 | ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a |
| 205 | |
| 206 | ecs_api_edp_get_producer_ids 200 prod-a |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 207 | |
| 208 | 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] | 209 | |
| 210 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 211 | |
| 212 | ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY |
| 213 | ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY |
| 214 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 215 | if [ -z "$FLAT_A1_EI" ]; then |
| 216 | ecs_api_a1_get_job 404 type1 test-job |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 217 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 218 | ecs_api_a1_get_job_status 404 type1 test-job |
| 219 | else |
| 220 | ecs_api_a1_get_job 404 test-job |
| 221 | |
| 222 | ecs_api_a1_get_job_status 404 test-job |
| 223 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 224 | |
| 225 | ecs_api_edp_get_producer_jobs 200 prod-a EMPTY |
| 226 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 227 | ## Create a job for prod-a |
| 228 | ## job1 - prod-a |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 229 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 230 | 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] | 231 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 232 | 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] | 233 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 234 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 235 | # Check the job data in the producer |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 236 | prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 237 | |
| 238 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 239 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 |
| 240 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 241 | if [ ! -z "$FLAT_A1_EI" ]; then |
| 242 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 |
| 243 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 244 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 245 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 246 | 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] | 247 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 248 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 249 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 250 | 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] | 251 | |
| 252 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 253 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 254 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 255 | prodstub_equal create/prod-a/job1 1 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 256 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 257 | ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 258 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 259 | ## Create a second job for prod-a |
| 260 | ## job2 - prod-a |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 261 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 262 | 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] | 263 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 264 | 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] | 265 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 266 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 267 | # Check the job data in the producer |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 268 | prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 269 | |
| 270 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 271 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 |
| 272 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 273 | if [ ! -z "$FLAT_A1_EI" ]; then |
| 274 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
| 275 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 276 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 277 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 278 | 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] | 279 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 280 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 281 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 282 | 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] | 283 | |
| 284 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 285 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 286 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 287 | prodstub_equal create/prod-a/job2 1 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 288 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 289 | 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 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 290 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 291 | ## Setup prod-b |
| 292 | 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] | 293 | |
| 294 | ecs_api_a1_get_type_ids 200 type1 type2 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 295 | if [ -z "$FLAT_A1_EI" ]; then |
| 296 | ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json |
| 297 | ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json |
| 298 | else |
| 299 | ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json |
| 300 | ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json |
| 301 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 302 | |
| 303 | ecs_api_edp_get_type_ids 200 type1 type2 |
| 304 | ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a |
| 305 | ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b |
| 306 | |
| 307 | ecs_api_edp_get_producer_ids 200 prod-a prod-b |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 308 | |
| 309 | ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 310 | ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 311 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 312 | |
| 313 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 314 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 315 | ## Create job for prod-b |
| 316 | ## job3 - prod-b |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 317 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 318 | 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] | 319 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 320 | 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] | 321 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 322 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 323 | prodstub_equal create/prod-b/job3 1 |
| 324 | |
| 325 | # Check the job data in the producer |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 326 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 327 | |
| 328 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 |
| 329 | ecs_api_a1_get_job_ids 200 type2 NOWNER job3 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 330 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 |
| 331 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2 |
| 332 | ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 333 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 334 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 335 | 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] | 336 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 337 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 338 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 339 | 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] | 340 | |
| 341 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 342 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 343 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 344 | 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 |
| 345 | ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 346 | |
| 347 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 348 | ## Setup prod-c (no types) |
| 349 | ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE |
| 350 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 351 | |
| 352 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 353 | |
| 354 | ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 355 | ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 356 | 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] | 357 | |
| 358 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 359 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 360 | |
| 361 | ## Delete job3 and prod-b and re-create if different order |
| 362 | |
| 363 | # Delete job then producer |
| 364 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 |
| 365 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
| 366 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 367 | if [ -z "$FLAT_A1_EI" ]; then |
| 368 | ecs_api_a1_delete_job 204 type2 job3 |
| 369 | else |
| 370 | ecs_api_a1_delete_job 204 job3 |
| 371 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 372 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 373 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
| 374 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
| 375 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 376 | ecs_api_edp_delete_producer 204 prod-b |
| 377 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 378 | ecs_api_edp_get_producer_status 404 prod-b |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 379 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 380 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
| 381 | ecs_api_edp_get_producer_ids 200 prod-a prod-c |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 382 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 383 | prodstub_equal delete/prod-b/job3 1 |
| 384 | |
| 385 | if [ -z "$FLAT_A1_EI" ]; then |
| 386 | ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
| 387 | else |
| 388 | ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json |
| 389 | fi |
| 390 | |
| 391 | # Put producer then job |
| 392 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 393 | |
| 394 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 395 | |
| 396 | if [ -z "$FLAT_A1_EI" ]; then |
| 397 | ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
| 398 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 399 | else |
| 400 | ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json |
| 401 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 402 | fi |
| 403 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 404 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 405 | |
| 406 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 |
| 407 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
| 408 | |
| 409 | prodstub_equal create/prod-b/job3 2 |
| 410 | prodstub_equal delete/prod-b/job3 1 |
| 411 | |
| 412 | # Delete only the producer |
| 413 | ecs_api_edp_delete_producer 204 prod-b |
| 414 | |
| 415 | ecs_api_edp_get_producer_status 404 prod-b |
| 416 | |
| 417 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 |
| 418 | ecs_api_edp_get_producer_ids 200 prod-a prod-c |
| 419 | |
| 420 | if [ -z "$FLAT_A1_EI" ]; then |
| 421 | ecs_api_a1_get_job_status 200 type2 job3 DISABLED |
| 422 | else |
| 423 | ecs_api_a1_get_job_status 200 job3 DISABLED |
| 424 | fi |
| 425 | |
| 426 | cr_equal received_callbacks 1 30 |
| 427 | cr_equal received_callbacks?id=job3-status 1 |
| 428 | cr_api_check_all_ecs_events 200 job3-status DISABLED |
| 429 | |
| 430 | # Re-create the producer |
| 431 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 432 | |
| 433 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 434 | |
| 435 | if [ -z "$FLAT_A1_EI" ]; then |
| 436 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 437 | else |
| 438 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 439 | fi |
| 440 | |
| 441 | cr_equal received_callbacks 2 30 |
| 442 | cr_equal received_callbacks?id=job3-status 2 |
| 443 | cr_api_check_all_ecs_events 200 job3-status ENABLED |
| 444 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 445 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 446 | |
| 447 | |
| 448 | ## Setup prod-d |
| 449 | 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] | 450 | |
| 451 | ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY |
| 452 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 453 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 454 | 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] | 455 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 456 | 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] | 457 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 458 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 459 | prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 460 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 461 | prodstub_equal create/prod-d/job8 1 |
| 462 | prodstub_equal delete/prod-d/job8 0 |
| 463 | |
| 464 | ecs_api_a1_get_job_ids 200 type4 NOWNER job8 |
| 465 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 466 | if [ -z "$FLAT_A1_EI" ]; then |
| 467 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 468 | else |
| 469 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 470 | fi |
| 471 | |
| 472 | # Re-PUT the producer with zero types |
| 473 | 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] | 474 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 475 | if [ -z "$FLAT_A1_EI" ]; then |
| 476 | ecs_api_a1_get_job_ids 404 type4 NOWNER |
| 477 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 478 | ecs_api_a1_get_job_ids 200 type4 NOWNER job8 |
| 479 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 480 | fi |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 481 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 482 | if [ -z "$FLAT_A1_EI" ]; then |
| 483 | ecs_api_a1_get_job_status 200 type4 job8 DISABLED |
| 484 | else |
| 485 | ecs_api_a1_get_job_status 200 job8 DISABLED |
| 486 | fi |
| 487 | |
| 488 | cr_equal received_callbacks 3 30 |
| 489 | cr_equal received_callbacks?id=job8-status 1 |
| 490 | cr_api_check_all_ecs_events 200 job8-status DISABLED |
| 491 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 492 | prodstub_equal create/prod-d/job8 1 |
| 493 | prodstub_equal delete/prod-d/job8 0 |
| 494 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 495 | ## Re-setup prod-d |
| 496 | 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] | 497 | |
| 498 | if [ -z "$FLAT_A1_EI" ]; then |
| 499 | ecs_api_a1_get_job_ids 404 type4 NOWNER |
| 500 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 501 | ecs_api_a1_get_job_ids 200 type4 NOWNER job8 |
| 502 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 503 | fi |
| 504 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 505 | if [ -z "$FLAT_A1_EI" ]; then |
| 506 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 507 | else |
| 508 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 509 | fi |
| 510 | |
| 511 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 512 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 513 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 514 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 515 | |
| 516 | cr_equal received_callbacks 4 30 |
| 517 | cr_equal received_callbacks?id=job8-status 2 |
| 518 | cr_api_check_all_ecs_events 200 job8-status ENABLED |
| 519 | |
| 520 | prodstub_equal create/prod-d/job8 2 |
| 521 | prodstub_equal delete/prod-d/job8 0 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 522 | |
| 523 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 524 | ## Setup prod-e |
| 525 | ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json |
| 526 | |
| 527 | ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY |
| 528 | |
| 529 | if [ -z "$FLAT_A1_EI" ]; then |
| 530 | ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
| 531 | else |
| 532 | ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json |
| 533 | fi |
| 534 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 535 | prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 536 | |
| 537 | prodstub_equal create/prod-e/job10 1 |
| 538 | prodstub_equal delete/prod-e/job10 0 |
| 539 | |
| 540 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 541 | |
| 542 | if [ -z "$FLAT_A1_EI" ]; then |
| 543 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 544 | else |
| 545 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 546 | fi |
| 547 | |
| 548 | ## Setup prod-f |
| 549 | ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json |
| 550 | |
| 551 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 552 | |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 553 | prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 554 | |
| 555 | prodstub_equal create/prod-f/job10 1 |
| 556 | prodstub_equal delete/prod-f/job10 0 |
| 557 | |
| 558 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 559 | |
| 560 | if [ -z "$FLAT_A1_EI" ]; then |
| 561 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 562 | else |
| 563 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 564 | fi |
| 565 | |
| 566 | ## Status updates prod-a and jobs |
| 567 | |
| 568 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 569 | |
| 570 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 571 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 572 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 573 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 574 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 575 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 576 | |
| 577 | # Arm producer prod-a for supervision failure |
| 578 | prodstub_arm_producer 200 prod-a 400 |
| 579 | |
| 580 | # Wait for producer prod-a to go disabled |
| 581 | ecs_api_edp_get_producer_status 200 prod-a DISABLED 360 |
| 582 | |
| 583 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 584 | |
| 585 | ecs_api_edp_get_producer_status 200 prod-a DISABLED |
| 586 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 587 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 588 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 589 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 590 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 591 | |
| 592 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 593 | if [ -z "$FLAT_A1_EI" ]; then |
| 594 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 595 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 596 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 597 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 598 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 599 | else |
| 600 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 601 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 602 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 603 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 604 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 605 | fi |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 606 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 607 | # Arm producer prod-a for supervision |
| 608 | prodstub_arm_producer 200 prod-a 200 |
| 609 | |
| 610 | # Wait for producer prod-a to go enabled |
| 611 | ecs_api_edp_get_producer_status 200 prod-a ENABLED 360 |
| 612 | |
| 613 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 614 | |
| 615 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 616 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 617 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 618 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 619 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 620 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 621 | |
| 622 | if [ -z "$FLAT_A1_EI" ]; then |
| 623 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 624 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 625 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 626 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 627 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 628 | else |
| 629 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 630 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 631 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 632 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 633 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 634 | fi |
| 635 | |
| 636 | # Arm producer prod-a for supervision failure |
| 637 | prodstub_arm_producer 200 prod-a 400 |
| 638 | |
| 639 | # Wait for producer prod-a to go disabled |
| 640 | ecs_api_edp_get_producer_status 200 prod-a DISABLED 360 |
| 641 | |
| 642 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 643 | |
| 644 | ecs_api_edp_get_producer_status 200 prod-a DISABLED |
| 645 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 646 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 647 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 648 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 649 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 650 | |
| 651 | if [ -z "$FLAT_A1_EI" ]; then |
| 652 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 653 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 654 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 655 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 656 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 657 | else |
| 658 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 659 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 660 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 661 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 662 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 663 | fi |
| 664 | |
| 665 | # Wait for producer prod-a to be removed |
| 666 | ecs_equal json:ei-producer/v1/eiproducers 5 1000 |
| 667 | |
| 668 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 669 | |
| 670 | ecs_api_edp_get_producer_status 404 prod-a |
| 671 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 672 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 673 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 674 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 675 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 676 | |
| 677 | if [ -z "$FLAT_A1_EI" ]; then |
| 678 | ecs_api_a1_get_job_status 200 type1 job1 DISABLED |
| 679 | ecs_api_a1_get_job_status 200 type1 job2 DISABLED |
| 680 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 681 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 682 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 683 | else |
| 684 | ecs_api_a1_get_job_status 200 job1 DISABLED |
| 685 | ecs_api_a1_get_job_status 200 job2 DISABLED |
| 686 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 687 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 688 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 689 | fi |
| 690 | |
| 691 | cr_equal received_callbacks 6 30 |
| 692 | cr_equal received_callbacks?id=job1-status 1 |
| 693 | cr_equal received_callbacks?id=job2-status 1 |
| 694 | |
| 695 | cr_api_check_all_ecs_events 200 job1-status DISABLED |
| 696 | cr_api_check_all_ecs_events 200 job2-status DISABLED |
| 697 | |
| 698 | |
| 699 | # Arm producer prod-e for supervision failure |
| 700 | prodstub_arm_producer 200 prod-e 400 |
| 701 | |
| 702 | ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000 |
| 703 | |
| 704 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 705 | |
| 706 | ecs_api_edp_get_producer_status 404 prod-a |
| 707 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 708 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 709 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 710 | ecs_api_edp_get_producer_status 200 prod-e DISABLED |
| 711 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 712 | |
| 713 | if [ -z "$FLAT_A1_EI" ]; then |
| 714 | ecs_api_a1_get_job_status 200 type1 job1 DISABLED |
| 715 | ecs_api_a1_get_job_status 200 type1 job2 DISABLED |
| 716 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 717 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 718 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 719 | else |
| 720 | ecs_api_a1_get_job_status 200 job1 DISABLED |
| 721 | ecs_api_a1_get_job_status 200 job2 DISABLED |
| 722 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 723 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 724 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 725 | fi |
| 726 | |
| 727 | #Disable create for job10 in prod-e |
| 728 | prodstub_arm_job_create 200 prod-e job10 400 |
| 729 | |
| 730 | #Update tjob 10 - only prod-f will be updated |
| 731 | if [ -z "$FLAT_A1_EI" ]; then |
| 732 | ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json |
| 733 | else |
| 734 | ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json |
| 735 | fi |
| 736 | #Reset producer and job responses |
| 737 | prodstub_arm_producer 200 prod-e 200 |
| 738 | prodstub_arm_job_create 200 prod-e job10 200 |
| 739 | |
| 740 | ecs_api_edp_get_producer_status 200 prod-e ENABLED 360 |
| 741 | |
| 742 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 743 | |
| 744 | #Job 10 should be updated when the producer goes enabled |
| 745 | deviation "Job 10 should be updated when the producer prod-e goes enabled" |
BjornMagnussonXA | 2138b63 | 2020-11-30 21:17:32 +0100 | [diff] [blame] | 746 | prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json |
| 747 | prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 748 | |
| 749 | prodstub_arm_producer 200 prod-f 400 |
| 750 | |
| 751 | ecs_api_edp_get_producer_status 200 prod-f DISABLED 360 |
| 752 | |
| 753 | ecs_equal json:ei-producer/v1/eiproducers 4 1000 |
| 754 | |
| 755 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e |
| 756 | |
| 757 | ecs_api_edp_get_producer_status 404 prod-a |
| 758 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 759 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 760 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 761 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 762 | ecs_api_edp_get_producer_status 404 prod-f |
| 763 | |
| 764 | if [ -z "$FLAT_A1_EI" ]; then |
| 765 | ecs_api_a1_get_job_status 200 type1 job1 DISABLED |
| 766 | ecs_api_a1_get_job_status 200 type1 job2 DISABLED |
| 767 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 768 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 769 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 770 | else |
| 771 | ecs_api_a1_get_job_status 200 job1 DISABLED |
| 772 | ecs_api_a1_get_job_status 200 job2 DISABLED |
| 773 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 774 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 775 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 776 | fi |
| 777 | |
| 778 | cr_equal received_callbacks 6 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 779 | |
| 780 | check_ecs_logs |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 781 | |
| 782 | store_logs END |
| 783 | |
| 784 | #### TEST COMPLETE #### |
| 785 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 786 | print_result |
| 787 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame^] | 788 | auto_clean_environment |