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 | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 21 | TC_ONELINE_DESCR="ECS full interfaces 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 |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 24 | DOCKER_INCLUDED_IMAGES="ECS PRODSTUB CR RICSIM CP HTTPPROXY NGW" |
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 |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 27 | KUBE_INCLUDED_IMAGES="PRODSTUB CR ECS RICSIM CP HTTPPROXY KUBEPROXY NGW" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 28 | #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 29 | KUBE_PRESTARTED_IMAGES="" |
| 30 | |
| 31 | #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if |
| 32 | #the image is not configured in the supplied env_file |
| 33 | #Used for images not applicable to all supported profile |
| 34 | CONDITIONALLY_IGNORED_IMAGES="NGW" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 35 | |
| 36 | #Supported test environment profiles |
BjornMagnussonXA | 89b64ab | 2020-12-16 09:21:01 +0100 | [diff] [blame] | 37 | SUPPORTED_PROFILES="ONAP-HONOLULU ORAN-CHERRY ORAN-DAWN" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 38 | #Supported run modes |
| 39 | SUPPORTED_RUNMODES="DOCKER KUBE" |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 40 | |
| 41 | . ../common/testcase_common.sh $@ |
| 42 | . ../common/ecs_api_functions.sh |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 43 | . ../common/prodstub_api_functions.sh |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 44 | . ../common/cr_api_functions.sh |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 45 | . ../common/control_panel_api_functions.sh |
| 46 | . ../common/controller_api_functions.sh |
| 47 | . ../common/ricsimulator_api_functions.sh |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 48 | . ../common/http_proxy_api_functions.sh |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 49 | . ../common/kube_proxy_api_functions.sh |
| 50 | . ../common/gateway_api_functions.sh |
| 51 | |
| 52 | setup_testenvironment |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 53 | |
| 54 | #### TEST BEGIN #### |
| 55 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 56 | FLAT_A1_EI="1" |
| 57 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 58 | clean_environment |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 59 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 60 | if [ $RUNMODE == "KUBE" ]; then |
| 61 | start_kube_proxy |
| 62 | fi |
| 63 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 64 | use_ecs_rest_https |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 65 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 66 | use_prod_stub_https |
| 67 | |
| 68 | use_simulator_https |
| 69 | |
| 70 | use_cr_https |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 71 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 72 | start_http_proxy |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 73 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 74 | start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE #Change NOPROXY to PROXY to run with http proxy |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 75 | |
| 76 | if [ $RUNMODE == "KUBE" ]; then |
| 77 | ecs_api_admin_reset |
| 78 | fi |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 79 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 80 | start_prod_stub |
| 81 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 82 | set_ecs_trace |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 83 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame^] | 84 | start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE |
| 85 | |
| 86 | if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then |
| 87 | start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE |
| 88 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 89 | |
| 90 | if [ "$PMS_VERSION" == "V2" ]; then |
| 91 | start_ric_simulators ricsim_g3 4 STD_2.0.0 |
| 92 | fi |
| 93 | |
| 94 | start_cr |
| 95 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 96 | CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK" |
| 97 | CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 98 | TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery" |
| 99 | TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery" |
| 100 | TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery" |
| 101 | TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery" |
| 102 | TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery" |
| 103 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 104 | STATUS1="$CR_SERVICE_PATH/job1-status" |
| 105 | STATUS2="$CR_SERVICE_PATH/job2-status" |
| 106 | STATUS3="$CR_SERVICE_PATH/job3-status" |
| 107 | STATUS8="$CR_SERVICE_PATH/job8-status" |
| 108 | STATUS10="$CR_SERVICE_PATH/job10-status" |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 109 | |
| 110 | ### Setup prodstub sim to accept calls for producers, types and jobs |
| 111 | ## prod-a type1 |
| 112 | ## prod-b type1 and type2 |
| 113 | ## prod-c no-type |
| 114 | ## prod-d type4 |
| 115 | ## prod-e type6 |
| 116 | ## prod-f type6 |
| 117 | |
| 118 | ## job1 -> prod-a |
| 119 | ## job2 -> prod-a |
| 120 | ## job3 -> prod-b |
| 121 | ## job4 -> prod-a |
| 122 | ## job6 -> prod-b |
| 123 | ## job8 -> prod-d |
| 124 | ## job10 -> prod-e and prod-f |
| 125 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 126 | prodstub_arm_producer 200 prod-a |
| 127 | prodstub_arm_producer 200 prod-b |
| 128 | prodstub_arm_producer 200 prod-c |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 129 | prodstub_arm_producer 200 prod-d |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 130 | prodstub_arm_producer 200 prod-e |
| 131 | prodstub_arm_producer 200 prod-f |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 132 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 133 | prodstub_arm_type 200 prod-a type1 |
| 134 | prodstub_arm_type 200 prod-b type2 |
| 135 | prodstub_arm_type 200 prod-b type3 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 136 | prodstub_arm_type 200 prod-d type4 |
| 137 | prodstub_arm_type 200 prod-e type6 |
| 138 | prodstub_arm_type 200 prod-f type6 |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 139 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 140 | prodstub_disarm_type 200 prod-b type3 |
| 141 | prodstub_arm_type 200 prod-b type1 |
| 142 | prodstub_disarm_type 200 prod-b type1 |
| 143 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 144 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 145 | prodstub_arm_job_create 200 prod-a job1 |
| 146 | prodstub_arm_job_create 200 prod-a job2 |
| 147 | prodstub_arm_job_create 200 prod-b job3 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 148 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 149 | prodstub_arm_job_delete 200 prod-a job1 |
| 150 | prodstub_arm_job_delete 200 prod-a job2 |
| 151 | prodstub_arm_job_delete 200 prod-b job3 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 152 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 153 | prodstub_arm_job_create 200 prod-b job4 |
| 154 | prodstub_arm_job_create 200 prod-a job4 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 155 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 156 | prodstub_arm_job_create 200 prod-b job6 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 157 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 158 | prodstub_arm_job_create 200 prod-d job8 |
| 159 | |
| 160 | prodstub_arm_job_create 200 prod-e job10 |
| 161 | prodstub_arm_job_create 200 prod-f job10 |
| 162 | |
| 163 | ### ecs status |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 164 | ecs_api_service_status 200 |
| 165 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 166 | cr_equal received_callbacks 0 |
| 167 | |
| 168 | ### Initial tests - no config made |
| 169 | ### GET: type ids, types, producer ids, producers, job ids, jobs |
| 170 | ### DELETE: jobs |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 171 | ecs_api_a1_get_type_ids 200 EMPTY |
| 172 | ecs_api_a1_get_type 404 test-type |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 173 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 174 | ecs_api_edp_get_type_ids 200 EMPTY |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 175 | if [ $ECS_VERSION == "V1-1" ]; then |
| 176 | ecs_api_edp_get_type 404 test-type |
| 177 | else |
| 178 | ecs_api_edp_get_type_2 404 test-type |
| 179 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 180 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 181 | if [ $ECS_VERSION == "V1-1" ]; then |
| 182 | ecs_api_edp_get_producer_ids 200 EMPTY |
| 183 | ecs_api_edp_get_producer 404 test-prod |
| 184 | else |
| 185 | ecs_api_edp_get_producer_ids_2 200 NOTYPE EMPTY |
| 186 | ecs_api_edp_get_producer_2 404 test-prod |
| 187 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 188 | ecs_api_edp_get_producer_status 404 test-prod |
| 189 | |
| 190 | ecs_api_edp_delete_producer 404 test-prod |
| 191 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 192 | if [ -z "$FLAT_A1_EI" ]; then |
| 193 | ecs_api_a1_get_job_ids 404 test-type NOWNER |
| 194 | ecs_api_a1_get_job_ids 404 test-type test-owner |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 195 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 196 | ecs_api_a1_get_job 404 test-type test-job |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 197 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 198 | ecs_api_a1_get_job_status 404 test-type test-job |
| 199 | else |
| 200 | ecs_api_a1_get_job_ids 200 test-type NOWNER EMPTY |
| 201 | ecs_api_a1_get_job_ids 200 test-type test-owner EMPTY |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 202 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 203 | ecs_api_a1_get_job 404 test-job |
| 204 | |
| 205 | ecs_api_a1_get_job_status 404 test-job |
| 206 | fi |
| 207 | |
| 208 | if [ -z "$FLAT_A1_EI" ]; then |
| 209 | ecs_api_a1_delete_job 404 test-type test-job |
| 210 | else |
| 211 | ecs_api_a1_delete_job 404 test-job |
| 212 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 213 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 214 | if [ $ECS_VERSION == "V1-1" ]; then |
| 215 | ecs_api_edp_get_producer_jobs 404 test-prod |
| 216 | else |
| 217 | ecs_api_edp_get_producer_jobs_2 404 test-prod |
| 218 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 219 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 220 | if [ $ECS_VERSION == "V1-2" ]; then |
| 221 | ecs_api_edp_get_type_2 404 test-type |
| 222 | ecs_api_edp_delete_type_2 404 test-type |
| 223 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 224 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 225 | ### Setup of producer/job and testing apis ### |
| 226 | |
| 227 | ## Setup prod-a |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 228 | if [ $ECS_VERSION == "V1-1" ]; then |
| 229 | ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 230 | ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 231 | else |
| 232 | #V1-2 |
| 233 | ecs_api_edp_get_type_ids 200 EMPTY |
| 234 | ecs_api_edp_get_type_2 404 type1 |
| 235 | ecs_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 236 | |
| 237 | # Create type, delete and create again |
| 238 | ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json |
| 239 | ecs_api_edp_get_type_2 200 type1 |
| 240 | ecs_api_edp_get_type_ids 200 type1 |
| 241 | ecs_api_edp_delete_type_2 204 type1 |
| 242 | ecs_api_edp_get_type_2 404 type1 |
| 243 | ecs_api_edp_get_type_ids 200 EMPTY |
| 244 | ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json |
| 245 | ecs_api_edp_get_type_ids 200 type1 |
| 246 | ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json |
| 247 | |
| 248 | ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 249 | ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 250 | |
| 251 | ecs_api_edp_delete_type_2 406 type1 |
| 252 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 253 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 254 | |
| 255 | ecs_api_a1_get_type_ids 200 type1 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 256 | if [ -z "$FLAT_A1_EI" ]; then |
| 257 | ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json |
| 258 | else |
| 259 | ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json |
| 260 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 261 | |
| 262 | ecs_api_edp_get_type_ids 200 type1 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 263 | if [ $ECS_VERSION == "V1-1" ]; then |
| 264 | ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a |
| 265 | else |
| 266 | ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json |
| 267 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 268 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 269 | if [ $ECS_VERSION == "V1-1" ]; then |
| 270 | ecs_api_edp_get_producer_ids 200 prod-a |
| 271 | else |
| 272 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a |
| 273 | ecs_api_edp_get_producer_ids_2 200 type1 prod-a |
| 274 | ecs_api_edp_get_producer_ids_2 200 type2 EMPTY |
| 275 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 276 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 277 | if [ $ECS_VERSION == "V1-1" ]; then |
| 278 | ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 279 | else |
| 280 | ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 281 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 282 | |
| 283 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 284 | |
| 285 | ecs_api_a1_get_job_ids 200 type1 NOWNER EMPTY |
| 286 | ecs_api_a1_get_job_ids 200 type1 test-owner EMPTY |
| 287 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 288 | if [ -z "$FLAT_A1_EI" ]; then |
| 289 | ecs_api_a1_get_job 404 type1 test-job |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 290 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 291 | ecs_api_a1_get_job_status 404 type1 test-job |
| 292 | else |
| 293 | ecs_api_a1_get_job 404 test-job |
| 294 | |
| 295 | ecs_api_a1_get_job_status 404 test-job |
| 296 | fi |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 297 | if [ $ECS_VERSION == "V1-1" ]; then |
| 298 | ecs_api_edp_get_producer_jobs 200 prod-a EMPTY |
| 299 | else |
| 300 | ecs_api_edp_get_producer_jobs_2 200 prod-a EMPTY |
| 301 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 302 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 303 | ## Create a job for prod-a |
| 304 | ## job1 - prod-a |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 305 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 306 | 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] | 307 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 308 | 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] | 309 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 310 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 311 | # Check the job data in the producer |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 312 | if [ $ECS_VERSION == "V1-1" ]; then |
| 313 | prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
| 314 | else |
| 315 | prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
| 316 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 317 | |
| 318 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 319 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 |
| 320 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 321 | if [ ! -z "$FLAT_A1_EI" ]; then |
| 322 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 |
| 323 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 324 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 325 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 326 | 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] | 327 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 328 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 329 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 330 | 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] | 331 | |
| 332 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 333 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 334 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 335 | prodstub_equal create/prod-a/job1 1 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 336 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 337 | if [ $ECS_VERSION == "V1-1" ]; then |
| 338 | ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
| 339 | else |
| 340 | ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json |
| 341 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 342 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 343 | ## Create a second job for prod-a |
| 344 | ## job2 - prod-a |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 345 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 346 | 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] | 347 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 348 | 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] | 349 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 350 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 351 | # Check the job data in the producer |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 352 | if [ $ECS_VERSION == "V1-1" ]; then |
| 353 | prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
| 354 | else |
| 355 | prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
| 356 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 357 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 358 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 |
| 359 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 360 | if [ ! -z "$FLAT_A1_EI" ]; then |
| 361 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
| 362 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 363 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 364 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 365 | 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] | 366 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 367 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 368 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 369 | 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] | 370 | |
| 371 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 372 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 373 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 374 | prodstub_equal create/prod-a/job2 1 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 375 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 376 | if [ $ECS_VERSION == "V1-1" ]; then |
| 377 | ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
| 378 | else |
| 379 | ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
| 380 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 381 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 382 | ## Setup prod-b |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 383 | if [ $ECS_VERSION == "V1-1" ]; then |
| 384 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 385 | else |
| 386 | ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json |
| 387 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 |
| 388 | fi |
| 389 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 390 | |
| 391 | ecs_api_a1_get_type_ids 200 type1 type2 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 392 | if [ -z "$FLAT_A1_EI" ]; then |
| 393 | ecs_api_a1_get_type 200 type1 testdata/ecs/ei-type-1.json |
| 394 | ecs_api_a1_get_type 200 type2 testdata/ecs/ei-type-2.json |
| 395 | else |
| 396 | ecs_api_a1_get_type 200 type1 testdata/ecs/empty-type.json |
| 397 | ecs_api_a1_get_type 200 type2 testdata/ecs/empty-type.json |
| 398 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 399 | |
| 400 | ecs_api_edp_get_type_ids 200 type1 type2 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 401 | if [ $ECS_VERSION == "V1-1" ]; then |
| 402 | ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a |
| 403 | ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b |
| 404 | else |
| 405 | ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json |
| 406 | ecs_api_edp_get_type_2 200 type2 testdata/ecs/ei-type-2.json |
| 407 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 408 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 409 | if [ $ECS_VERSION == "V1-1" ]; then |
| 410 | ecs_api_edp_get_producer_ids 200 prod-a prod-b |
| 411 | else |
| 412 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b |
| 413 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 414 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 415 | if [ $ECS_VERSION == "V1-1" ]; then |
| 416 | ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 417 | ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 418 | else |
| 419 | ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 420 | ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 |
| 421 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 422 | |
| 423 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 424 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 425 | ## Create job for prod-b |
| 426 | ## job3 - prod-b |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 427 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 428 | 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] | 429 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 430 | 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] | 431 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 432 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 433 | prodstub_equal create/prod-b/job3 1 |
| 434 | |
| 435 | # Check the job data in the producer |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 436 | if [ $ECS_VERSION == "V1-1" ]; then |
| 437 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
| 438 | else |
| 439 | prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
| 440 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 441 | |
| 442 | ecs_api_a1_get_job_ids 200 type1 NOWNER job1 job2 |
| 443 | ecs_api_a1_get_job_ids 200 type2 NOWNER job3 |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 444 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1 |
| 445 | ecs_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2 |
| 446 | ecs_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 447 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 448 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 449 | 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] | 450 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 451 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 452 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 453 | 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] | 454 | |
| 455 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 456 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 457 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 458 | if [ $ECS_VERSION == "V1-1" ]; then |
| 459 | ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
| 460 | ecs_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
| 461 | else |
| 462 | ecs_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json |
| 463 | ecs_api_edp_get_producer_jobs_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
| 464 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 465 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 466 | ## Setup prod-c (no types) |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 467 | if [ $ECS_VERSION == "V1-1" ]; then |
| 468 | ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE |
| 469 | else |
| 470 | ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE |
| 471 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 472 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 473 | if [ $ECS_VERSION == "V1-1" ]; then |
| 474 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
| 475 | else |
| 476 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c |
| 477 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 478 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 479 | if [ $ECS_VERSION == "V1-1" ]; then |
| 480 | ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json |
| 481 | ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 482 | ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY |
| 483 | else |
| 484 | ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 485 | ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 |
| 486 | ecs_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY |
| 487 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 488 | |
| 489 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 490 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 491 | |
| 492 | ## Delete job3 and prod-b and re-create if different order |
| 493 | |
| 494 | # Delete job then producer |
| 495 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 496 | if [ $ECS_VERSION == "V1-1" ]; then |
| 497 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
| 498 | else |
| 499 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c |
| 500 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 501 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 502 | if [ -z "$FLAT_A1_EI" ]; then |
| 503 | ecs_api_a1_delete_job 204 type2 job3 |
| 504 | else |
| 505 | ecs_api_a1_delete_job 204 job3 |
| 506 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 507 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 508 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 509 | if [ $ECS_VERSION == "V1-1" ]; then |
| 510 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
| 511 | else |
| 512 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c |
| 513 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 514 | |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 515 | ecs_api_edp_delete_producer 204 prod-b |
| 516 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 517 | ecs_api_edp_get_producer_status 404 prod-b |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 518 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 519 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 520 | if [ $ECS_VERSION == "V1-1" ]; then |
| 521 | ecs_api_edp_get_producer_ids 200 prod-a prod-c |
| 522 | else |
| 523 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c |
| 524 | fi |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 525 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 526 | prodstub_equal delete/prod-b/job3 1 |
| 527 | |
| 528 | if [ -z "$FLAT_A1_EI" ]; then |
| 529 | ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json |
| 530 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 531 | if [ $ECS_VERSION == "V1-1" ]; then |
| 532 | ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json |
| 533 | else |
| 534 | ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json |
| 535 | ecs_api_a1_get_job_status 200 job3 DISABLED |
| 536 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 537 | fi |
| 538 | |
| 539 | # Put producer then job |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 540 | if [ $ECS_VERSION == "V1-1" ]; then |
| 541 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 542 | else |
| 543 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 |
| 544 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 545 | |
| 546 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 547 | |
| 548 | if [ -z "$FLAT_A1_EI" ]; then |
| 549 | ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
| 550 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 551 | else |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 552 | if [ $ECS_VERSION == "V1-1" ]; then |
| 553 | ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json |
| 554 | else |
| 555 | ecs_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json |
| 556 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 557 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 558 | fi |
| 559 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 560 | if [ $ECS_VERSION == "V1-1" ]; then |
| 561 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
| 562 | else |
| 563 | prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
| 564 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 565 | |
| 566 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 567 | if [ $ECS_VERSION == "V1-1" ]; then |
| 568 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c |
| 569 | else |
| 570 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c |
| 571 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 572 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 573 | if [ $ECS_VERSION == "V1-1" ]; then |
| 574 | prodstub_equal create/prod-b/job3 2 |
| 575 | else |
| 576 | prodstub_equal create/prod-b/job3 3 |
| 577 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 578 | prodstub_equal delete/prod-b/job3 1 |
| 579 | |
| 580 | # Delete only the producer |
| 581 | ecs_api_edp_delete_producer 204 prod-b |
| 582 | |
| 583 | ecs_api_edp_get_producer_status 404 prod-b |
| 584 | |
| 585 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 586 | if [ $ECS_VERSION == "V1-1" ]; then |
| 587 | ecs_api_edp_get_producer_ids 200 prod-a prod-c |
| 588 | else |
| 589 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c |
| 590 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 591 | |
| 592 | if [ -z "$FLAT_A1_EI" ]; then |
| 593 | ecs_api_a1_get_job_status 200 type2 job3 DISABLED |
| 594 | else |
| 595 | ecs_api_a1_get_job_status 200 job3 DISABLED |
| 596 | fi |
| 597 | |
| 598 | cr_equal received_callbacks 1 30 |
| 599 | cr_equal received_callbacks?id=job3-status 1 |
| 600 | cr_api_check_all_ecs_events 200 job3-status DISABLED |
| 601 | |
| 602 | # Re-create the producer |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 603 | if [ $ECS_VERSION == "V1-1" ]; then |
| 604 | ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json |
| 605 | else |
| 606 | ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 |
| 607 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 608 | |
| 609 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 610 | |
| 611 | if [ -z "$FLAT_A1_EI" ]; then |
| 612 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 613 | else |
| 614 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 615 | fi |
| 616 | |
| 617 | cr_equal received_callbacks 2 30 |
| 618 | cr_equal received_callbacks?id=job3-status 2 |
| 619 | cr_api_check_all_ecs_events 200 job3-status ENABLED |
| 620 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 621 | if [ $ECS_VERSION == "V1-1" ]; then |
| 622 | prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
| 623 | else |
| 624 | prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json |
| 625 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 626 | |
| 627 | ## Setup prod-d |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 628 | if [ $ECS_VERSION == "V1-1" ]; then |
| 629 | ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json |
| 630 | else |
| 631 | ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-1.json |
| 632 | ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 |
| 633 | fi |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 634 | |
| 635 | ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY |
| 636 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 637 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 638 | 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] | 639 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 640 | 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] | 641 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 642 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 643 | if [ $ECS_VERSION == "V1-1" ]; then |
| 644 | prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json |
| 645 | else |
| 646 | prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ecs/job-template.json |
| 647 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 648 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 649 | prodstub_equal create/prod-d/job8 1 |
| 650 | prodstub_equal delete/prod-d/job8 0 |
| 651 | |
| 652 | ecs_api_a1_get_job_ids 200 type4 NOWNER job8 |
| 653 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 654 | if [ -z "$FLAT_A1_EI" ]; then |
| 655 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 656 | else |
| 657 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 658 | fi |
| 659 | |
| 660 | # Re-PUT the producer with zero types |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 661 | if [ $ECS_VERSION == "V1-1" ]; then |
| 662 | ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE |
| 663 | else |
| 664 | ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE |
| 665 | fi |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 666 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 667 | if [ -z "$FLAT_A1_EI" ]; then |
| 668 | ecs_api_a1_get_job_ids 404 type4 NOWNER |
| 669 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 670 | ecs_api_a1_get_job_ids 200 type4 NOWNER job8 |
| 671 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 672 | fi |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 673 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 674 | if [ -z "$FLAT_A1_EI" ]; then |
| 675 | ecs_api_a1_get_job_status 200 type4 job8 DISABLED |
| 676 | else |
| 677 | ecs_api_a1_get_job_status 200 job8 DISABLED |
| 678 | fi |
| 679 | |
| 680 | cr_equal received_callbacks 3 30 |
| 681 | cr_equal received_callbacks?id=job8-status 1 |
| 682 | cr_api_check_all_ecs_events 200 job8-status DISABLED |
| 683 | |
BjornMagnussonXA | 39ad50e | 2020-10-22 09:55:25 +0200 | [diff] [blame] | 684 | prodstub_equal create/prod-d/job8 1 |
| 685 | prodstub_equal delete/prod-d/job8 0 |
| 686 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 687 | ## Re-setup prod-d |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 688 | if [ $ECS_VERSION == "V1-1" ]; then |
| 689 | ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json |
| 690 | else |
| 691 | ecs_api_edp_put_type_2 200 type4 testdata/ecs/ei-type-4.json |
| 692 | ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 |
| 693 | fi |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 694 | |
| 695 | if [ -z "$FLAT_A1_EI" ]; then |
| 696 | ecs_api_a1_get_job_ids 404 type4 NOWNER |
| 697 | else |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 698 | ecs_api_a1_get_job_ids 200 type4 NOWNER job8 |
| 699 | ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 700 | fi |
| 701 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 702 | if [ -z "$FLAT_A1_EI" ]; then |
| 703 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 704 | else |
| 705 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 706 | fi |
| 707 | |
| 708 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 709 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 710 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 711 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 712 | |
| 713 | cr_equal received_callbacks 4 30 |
| 714 | cr_equal received_callbacks?id=job8-status 2 |
| 715 | cr_api_check_all_ecs_events 200 job8-status ENABLED |
| 716 | |
| 717 | prodstub_equal create/prod-d/job8 2 |
| 718 | prodstub_equal delete/prod-d/job8 0 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 719 | |
| 720 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 721 | ## Setup prod-e |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 722 | if [ $ECS_VERSION == "V1-1" ]; then |
| 723 | ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json |
| 724 | else |
| 725 | ecs_api_edp_put_type_2 201 type6 testdata/ecs/ei-type-6.json |
| 726 | ecs_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 |
| 727 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 728 | |
| 729 | ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY |
| 730 | |
| 731 | if [ -z "$FLAT_A1_EI" ]; then |
| 732 | ecs_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
| 733 | else |
| 734 | ecs_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template.json |
| 735 | fi |
| 736 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 737 | if [ $ECS_VERSION == "V1-1" ]; then |
| 738 | prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
| 739 | else |
| 740 | prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
| 741 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 742 | |
| 743 | prodstub_equal create/prod-e/job10 1 |
| 744 | prodstub_equal delete/prod-e/job10 0 |
| 745 | |
| 746 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 747 | |
| 748 | if [ -z "$FLAT_A1_EI" ]; then |
| 749 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 750 | else |
| 751 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 752 | fi |
| 753 | |
| 754 | ## Setup prod-f |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 755 | if [ $ECS_VERSION == "V1-1" ]; then |
| 756 | ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json |
| 757 | else |
| 758 | ecs_api_edp_put_type_2 200 type6 testdata/ecs/ei-type-6.json |
| 759 | ecs_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 |
| 760 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 761 | |
| 762 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 763 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 764 | if [ $ECS_VERSION == "V1-1" ]; then |
| 765 | prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
| 766 | else |
| 767 | prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template.json |
| 768 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 769 | |
| 770 | prodstub_equal create/prod-f/job10 1 |
| 771 | prodstub_equal delete/prod-f/job10 0 |
| 772 | |
| 773 | ecs_api_a1_get_job_ids 200 type6 NOWNER job10 |
| 774 | |
| 775 | if [ -z "$FLAT_A1_EI" ]; then |
| 776 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 777 | else |
| 778 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 779 | fi |
| 780 | |
| 781 | ## Status updates prod-a and jobs |
| 782 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 783 | if [ $ECS_VERSION == "V1-1" ]; then |
| 784 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 785 | else |
| 786 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f |
| 787 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 788 | |
| 789 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 790 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 791 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 792 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 793 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 794 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 795 | |
| 796 | # Arm producer prod-a for supervision failure |
| 797 | prodstub_arm_producer 200 prod-a 400 |
| 798 | |
| 799 | # Wait for producer prod-a to go disabled |
| 800 | ecs_api_edp_get_producer_status 200 prod-a DISABLED 360 |
| 801 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 802 | if [ $ECS_VERSION == "V1-1" ]; then |
| 803 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 804 | else |
| 805 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f |
| 806 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 807 | |
| 808 | ecs_api_edp_get_producer_status 200 prod-a DISABLED |
| 809 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 810 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 811 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 812 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 813 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 814 | |
| 815 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 816 | if [ -z "$FLAT_A1_EI" ]; then |
| 817 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 818 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 819 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 820 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 821 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 822 | else |
| 823 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 824 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 825 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 826 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 827 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 828 | fi |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 829 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 830 | # Arm producer prod-a for supervision |
| 831 | prodstub_arm_producer 200 prod-a 200 |
| 832 | |
| 833 | # Wait for producer prod-a to go enabled |
| 834 | ecs_api_edp_get_producer_status 200 prod-a ENABLED 360 |
| 835 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 836 | if [ $ECS_VERSION == "V1-1" ]; then |
| 837 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 838 | else |
| 839 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f |
| 840 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 841 | |
| 842 | ecs_api_edp_get_producer_status 200 prod-a ENABLED |
| 843 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 844 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 845 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 846 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 847 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 848 | |
| 849 | if [ -z "$FLAT_A1_EI" ]; then |
| 850 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 851 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 852 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 853 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 854 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 855 | else |
| 856 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 857 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 858 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 859 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 860 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 861 | fi |
| 862 | |
| 863 | # Arm producer prod-a for supervision failure |
| 864 | prodstub_arm_producer 200 prod-a 400 |
| 865 | |
| 866 | # Wait for producer prod-a to go disabled |
| 867 | ecs_api_edp_get_producer_status 200 prod-a DISABLED 360 |
| 868 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 869 | if [ $ECS_VERSION == "V1-1" ]; then |
| 870 | ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f |
| 871 | else |
| 872 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f |
| 873 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 874 | |
| 875 | ecs_api_edp_get_producer_status 200 prod-a DISABLED |
| 876 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 877 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 878 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 879 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 880 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 881 | |
| 882 | if [ -z "$FLAT_A1_EI" ]; then |
| 883 | ecs_api_a1_get_job_status 200 type1 job1 ENABLED |
| 884 | ecs_api_a1_get_job_status 200 type1 job2 ENABLED |
| 885 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 886 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 887 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 888 | else |
| 889 | ecs_api_a1_get_job_status 200 job1 ENABLED |
| 890 | ecs_api_a1_get_job_status 200 job2 ENABLED |
| 891 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 892 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 893 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 894 | fi |
| 895 | |
| 896 | # Wait for producer prod-a to be removed |
| 897 | ecs_equal json:ei-producer/v1/eiproducers 5 1000 |
| 898 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 899 | if [ $ECS_VERSION == "V1-1" ]; then |
| 900 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 901 | else |
| 902 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f |
| 903 | fi |
| 904 | |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 905 | |
| 906 | ecs_api_edp_get_producer_status 404 prod-a |
| 907 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 908 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 909 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 910 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 911 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 912 | |
| 913 | if [ -z "$FLAT_A1_EI" ]; then |
| 914 | ecs_api_a1_get_job_status 200 type1 job1 DISABLED |
| 915 | ecs_api_a1_get_job_status 200 type1 job2 DISABLED |
| 916 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 917 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 918 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 919 | else |
| 920 | ecs_api_a1_get_job_status 200 job1 DISABLED |
| 921 | ecs_api_a1_get_job_status 200 job2 DISABLED |
| 922 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 923 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 924 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 925 | fi |
| 926 | |
| 927 | cr_equal received_callbacks 6 30 |
| 928 | cr_equal received_callbacks?id=job1-status 1 |
| 929 | cr_equal received_callbacks?id=job2-status 1 |
| 930 | |
| 931 | cr_api_check_all_ecs_events 200 job1-status DISABLED |
| 932 | cr_api_check_all_ecs_events 200 job2-status DISABLED |
| 933 | |
| 934 | |
| 935 | # Arm producer prod-e for supervision failure |
| 936 | prodstub_arm_producer 200 prod-e 400 |
| 937 | |
| 938 | ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000 |
| 939 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 940 | if [ $ECS_VERSION == "V1-1" ]; then |
| 941 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 942 | else |
| 943 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f |
| 944 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 945 | |
| 946 | ecs_api_edp_get_producer_status 404 prod-a |
| 947 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 948 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 949 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 950 | ecs_api_edp_get_producer_status 200 prod-e DISABLED |
| 951 | ecs_api_edp_get_producer_status 200 prod-f ENABLED |
| 952 | |
| 953 | if [ -z "$FLAT_A1_EI" ]; then |
| 954 | ecs_api_a1_get_job_status 200 type1 job1 DISABLED |
| 955 | ecs_api_a1_get_job_status 200 type1 job2 DISABLED |
| 956 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 957 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 958 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 959 | else |
| 960 | ecs_api_a1_get_job_status 200 job1 DISABLED |
| 961 | ecs_api_a1_get_job_status 200 job2 DISABLED |
| 962 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 963 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 964 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 965 | fi |
| 966 | |
| 967 | #Disable create for job10 in prod-e |
| 968 | prodstub_arm_job_create 200 prod-e job10 400 |
| 969 | |
| 970 | #Update tjob 10 - only prod-f will be updated |
| 971 | if [ -z "$FLAT_A1_EI" ]; then |
| 972 | ecs_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json |
| 973 | else |
| 974 | ecs_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ecs/job-template2.json |
| 975 | fi |
| 976 | #Reset producer and job responses |
| 977 | prodstub_arm_producer 200 prod-e 200 |
| 978 | prodstub_arm_job_create 200 prod-e job10 200 |
| 979 | |
| 980 | ecs_api_edp_get_producer_status 200 prod-e ENABLED 360 |
| 981 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 982 | if [ $ECS_VERSION == "V1-1" ]; then |
| 983 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f |
| 984 | else |
| 985 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f |
| 986 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 987 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 988 | #Wait for job to be updated |
| 989 | sleep_wait 120 |
| 990 | |
BjornMagnussonXA | c963b73 | 2021-01-20 14:24:13 +0100 | [diff] [blame] | 991 | if [ $ECS_VERSION == "V1-1" ]; then |
| 992 | prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json |
| 993 | else |
| 994 | prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json |
| 995 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 996 | |
| 997 | prodstub_arm_producer 200 prod-f 400 |
| 998 | |
| 999 | ecs_api_edp_get_producer_status 200 prod-f DISABLED 360 |
| 1000 | |
| 1001 | ecs_equal json:ei-producer/v1/eiproducers 4 1000 |
| 1002 | |
BjornMagnussonXA | 27db02f | 2021-01-19 08:13:00 +0100 | [diff] [blame] | 1003 | if [ $ECS_VERSION == "V1-1" ]; then |
| 1004 | ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e |
| 1005 | else |
| 1006 | ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e |
| 1007 | fi |
BjornMagnussonXA | 7b36db6 | 2020-11-23 10:57:57 +0100 | [diff] [blame] | 1008 | |
| 1009 | ecs_api_edp_get_producer_status 404 prod-a |
| 1010 | ecs_api_edp_get_producer_status 200 prod-b ENABLED |
| 1011 | ecs_api_edp_get_producer_status 200 prod-c ENABLED |
| 1012 | ecs_api_edp_get_producer_status 200 prod-d ENABLED |
| 1013 | ecs_api_edp_get_producer_status 200 prod-e ENABLED |
| 1014 | ecs_api_edp_get_producer_status 404 prod-f |
| 1015 | |
| 1016 | if [ -z "$FLAT_A1_EI" ]; then |
| 1017 | ecs_api_a1_get_job_status 200 type1 job1 DISABLED |
| 1018 | ecs_api_a1_get_job_status 200 type1 job2 DISABLED |
| 1019 | ecs_api_a1_get_job_status 200 type2 job3 ENABLED |
| 1020 | ecs_api_a1_get_job_status 200 type4 job8 ENABLED |
| 1021 | ecs_api_a1_get_job_status 200 type6 job10 ENABLED |
| 1022 | else |
| 1023 | ecs_api_a1_get_job_status 200 job1 DISABLED |
| 1024 | ecs_api_a1_get_job_status 200 job2 DISABLED |
| 1025 | ecs_api_a1_get_job_status 200 job3 ENABLED |
| 1026 | ecs_api_a1_get_job_status 200 job8 ENABLED |
| 1027 | ecs_api_a1_get_job_status 200 job10 ENABLED |
| 1028 | fi |
| 1029 | |
| 1030 | cr_equal received_callbacks 6 |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 1031 | |
| 1032 | check_ecs_logs |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 1033 | |
| 1034 | store_logs END |
| 1035 | |
| 1036 | #### TEST COMPLETE #### |
| 1037 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 1038 | print_result |
| 1039 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 1040 | auto_clean_environment |