BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 1 | #!/usr/bin/env 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 | TC_ONELINE_DESCR="App test DMAAP Meditor and DMAAP Adapter" |
| 21 | |
| 22 | #App names to include in the test when running docker, space separated list |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 23 | DOCKER_INCLUDED_IMAGES="ECS DMAAPMED DMAAPADP KUBEPROXY MR DMAAPMR CR" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 24 | |
| 25 | #App names to include in the test when running kubernetes, space separated list |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 26 | KUBE_INCLUDED_IMAGES=" ECS DMAAPMED DMAAPADP KUBEPROXY MR DMAAPMR CR" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 27 | |
| 28 | #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list |
| 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="" |
| 35 | |
| 36 | #Supported test environment profiles |
| 37 | SUPPORTED_PROFILES="ORAN-E-RELEASE" |
| 38 | #Supported run modes |
| 39 | SUPPORTED_RUNMODES="DOCKER KUBE" |
| 40 | |
| 41 | . ../common/testcase_common.sh $@ |
| 42 | . ../common/agent_api_functions.sh |
| 43 | . ../common/ricsimulator_api_functions.sh |
| 44 | . ../common/ecs_api_functions.sh |
| 45 | . ../common/prodstub_api_functions.sh |
| 46 | . ../common/cr_api_functions.sh |
| 47 | . ../common/rapp_catalogue_api_functions.sh |
| 48 | . ../common/mr_api_functions.sh |
| 49 | . ../common/control_panel_api_functions.sh |
| 50 | . ../common/controller_api_functions.sh |
| 51 | . ../common/consul_cbs_functions.sh |
| 52 | . ../common/http_proxy_api_functions.sh |
| 53 | . ../common/kube_proxy_api_functions.sh |
| 54 | . ../common/gateway_api_functions.sh |
| 55 | . ../common/dmaapmed_api_functions.sh |
| 56 | . ../common/dmaapadp_api_functions.sh |
| 57 | |
| 58 | setup_testenvironment |
| 59 | |
| 60 | #### TEST BEGIN #### |
| 61 | |
| 62 | #Local vars in test script |
| 63 | ########################## |
| 64 | FLAT_A1_EI="1" |
| 65 | NUM_JOBS=100 # Mediator and adapter gets same number of jobs |
| 66 | |
| 67 | clean_environment |
| 68 | |
| 69 | #use_cr_https |
| 70 | use_cr_http |
| 71 | use_ecs_rest_https |
| 72 | use_mr_https |
| 73 | use_dmaapadp_https |
| 74 | use_dmaapmed_https |
| 75 | |
| 76 | start_kube_proxy |
| 77 | |
| 78 | start_cr |
| 79 | |
| 80 | start_ecs NOPROXY $SIM_GROUP/$ECS_COMPOSE_DIR/$ECS_CONFIG_FILE |
| 81 | |
| 82 | set_ecs_trace |
| 83 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 84 | start_mr "unauthenticated.dmaapmed.json" "/events" "dmaapmediatorproducer/STD_Fault_Messages" \ |
| 85 | "unauthenticated.dmaapadp.json" "/events" "dmaapadapterproducer/msgs" \ |
| 86 | "unauthenticated.dmaapadp_kafka.text" "/events" "dmaapadapterproducer/msgs" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 87 | |
| 88 | start_dmaapadp NOPROXY $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_CONFIG_FILE $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_DATA_FILE |
| 89 | |
| 90 | set_dmaapadp_trace |
| 91 | |
| 92 | start_dmaapmed NOPROXY $SIM_GROUP/$DMAAP_MED_COMPOSE_DIR/$DMAAP_MED_DATA_FILE |
| 93 | |
| 94 | ecs_equal json:data-producer/v1/info-producers 2 60 |
| 95 | |
| 96 | # Check producers |
| 97 | ecs_api_idc_get_job_ids 200 NOTYPE NOWNER EMPTY |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 98 | ecs_api_idc_get_type_ids 200 ExampleInformationType STD_Fault_Messages ExampleInformationTypeKafka |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 99 | ecs_api_edp_get_producer_ids_2 200 NOTYPE DmaapGenericInfoProducer DMaaP_Mediator_Producer |
| 100 | |
| 101 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 102 | # Create jobs for adapter - CR stores data as MD5 hash |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 103 | start_timer "Create adapter jobs: $NUM_JOBS" |
| 104 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 105 | do |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 106 | ecs_api_idc_put_job 201 job-adp-$i ExampleInformationType $CR_SERVICE_MR_PATH/job-adp-data$i"?storeas=md5" info-owner-adp-$i $CR_SERVICE_APP_PATH/job_status_info-owner-adp-$i testdata/dmaap-adapter/job-template.json |
| 107 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 108 | done |
| 109 | print_timer "Create adapter jobs: $NUM_JOBS" |
| 110 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 111 | # Create jobs for adapter kafka - CR stores data as MD5 hash |
| 112 | start_timer "Create adapter (kafka) jobs: $NUM_JOBS" |
| 113 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 114 | do |
| 115 | ecs_api_idc_put_job 201 job-adp-kafka-$i ExampleInformationTypeKafka $CR_SERVICE_TEXT_PATH/job-adp-kafka-data$i"?storeas=md5" info-owner-adp-kafka-$i $CR_SERVICE_APP_PATH/job_status_info-owner-adp-kafka-$i testdata/dmaap-adapter/job-template-1-kafka.json |
| 116 | |
| 117 | done |
| 118 | print_timer "Create adapter (kafka) jobs: $NUM_JOBS" |
| 119 | |
| 120 | # Create jobs for mediator - CR stores data as MD5 hash |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 121 | start_timer "Create mediator jobs: $NUM_JOBS" |
| 122 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 123 | do |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 124 | ecs_api_idc_put_job 201 job-med-$i STD_Fault_Messages $CR_SERVICE_MR_PATH/job-med-data$i"?storeas=md5" info-owner-med-$i $CR_SERVICE_APP_PATH/job_status_info-owner-med-$i testdata/dmaap-adapter/job-template.json |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 125 | done |
| 126 | print_timer "Create mediator jobs: $NUM_JOBS" |
| 127 | |
| 128 | # Check job status |
| 129 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 130 | do |
| 131 | ecs_api_a1_get_job_status 200 job-med-$i ENABLED 30 |
| 132 | ecs_api_a1_get_job_status 200 job-adp-$i ENABLED 30 |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 133 | ecs_api_a1_get_job_status 200 job-adp-kafka-$i ENABLED 30 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 134 | done |
| 135 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 136 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 137 | EXPECTED_DATA_DELIV=0 |
| 138 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 139 | mr_api_generate_json_payload_file 1 ./tmp/data_for_dmaap_test.json |
| 140 | mr_api_generate_text_payload_file 1 ./tmp/data_for_dmaap_test.txt |
| 141 | |
| 142 | ## Send json file via message-router to adapter |
| 143 | |
| 144 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 145 | |
| 146 | mr_api_send_json_file "/events/unauthenticated.dmaapadp.json" ./tmp/data_for_dmaap_test.json |
| 147 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 148 | |
| 149 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 150 | mr_api_send_json_file "/events/unauthenticated.dmaapadp.json" ./tmp/data_for_dmaap_test.json |
| 151 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 152 | |
| 153 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 154 | mr_api_send_json_file "/events/unauthenticated.dmaapadp.json" ./tmp/data_for_dmaap_test.json |
| 155 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 156 | |
| 157 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 158 | mr_api_send_json_file "/events/unauthenticated.dmaapadp.json" ./tmp/data_for_dmaap_test.json |
| 159 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 160 | |
| 161 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 162 | mr_api_send_json_file "/events/unauthenticated.dmaapadp.json" ./tmp/data_for_dmaap_test.json |
| 163 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 164 | |
| 165 | # Check received data callbacks from adapter |
| 166 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 167 | do |
| 168 | cr_api_check_single_genric_event_md5_file 200 job-adp-data$i ./tmp/data_for_dmaap_test.json |
| 169 | cr_api_check_single_genric_event_md5_file 200 job-adp-data$i ./tmp/data_for_dmaap_test.json |
| 170 | cr_api_check_single_genric_event_md5_file 200 job-adp-data$i ./tmp/data_for_dmaap_test.json |
| 171 | cr_api_check_single_genric_event_md5_file 200 job-adp-data$i ./tmp/data_for_dmaap_test.json |
| 172 | cr_api_check_single_genric_event_md5_file 200 job-adp-data$i ./tmp/data_for_dmaap_test.json |
| 173 | done |
| 174 | |
| 175 | |
| 176 | ## Send text file via message-router to adapter kafka |
| 177 | |
| 178 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 179 | |
| 180 | mr_api_send_text_file "/events/unauthenticated.dmaapadp_kafka.text" ./tmp/data_for_dmaap_test.txt |
| 181 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 182 | |
| 183 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 184 | mr_api_send_text_file "/events/unauthenticated.dmaapadp_kafka.text" ./tmp/data_for_dmaap_test.txt |
| 185 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 186 | |
| 187 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 188 | mr_api_send_text_file "/events/unauthenticated.dmaapadp_kafka.text" ./tmp/data_for_dmaap_test.txt |
| 189 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 190 | |
| 191 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 192 | mr_api_send_text_file "/events/unauthenticated.dmaapadp_kafka.text" ./tmp/data_for_dmaap_test.txt |
| 193 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 194 | |
| 195 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 196 | mr_api_send_text_file "/events/unauthenticated.dmaapadp_kafka.text" ./tmp/data_for_dmaap_test.txt |
| 197 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 198 | |
| 199 | # Check received data callbacks from adapter kafka |
| 200 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 201 | do |
| 202 | cr_api_check_single_genric_event_md5_file 200 job-adp-kafka-data$i ./tmp/data_for_dmaap_test.txt |
| 203 | cr_api_check_single_genric_event_md5_file 200 job-adp-kafka-data$i ./tmp/data_for_dmaap_test.txt |
| 204 | cr_api_check_single_genric_event_md5_file 200 job-adp-kafka-data$i ./tmp/data_for_dmaap_test.txt |
| 205 | cr_api_check_single_genric_event_md5_file 200 job-adp-kafka-data$i ./tmp/data_for_dmaap_test.txt |
| 206 | cr_api_check_single_genric_event_md5_file 200 job-adp-kafka-data$i ./tmp/data_for_dmaap_test.txt |
| 207 | done |
| 208 | |
| 209 | ## Send json file via message-router to mediator |
| 210 | |
| 211 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 212 | |
| 213 | mr_api_send_json_file "/events/unauthenticated.dmaapmed.json" ./tmp/data_for_dmaap_test.json |
| 214 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 215 | |
| 216 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 217 | mr_api_send_json_file "/events/unauthenticated.dmaapmed.json" ./tmp/data_for_dmaap_test.json |
| 218 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 219 | |
| 220 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 221 | mr_api_send_json_file "/events/unauthenticated.dmaapmed.json" ./tmp/data_for_dmaap_test.json |
| 222 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 223 | |
| 224 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 225 | mr_api_send_json_file "/events/unauthenticated.dmaapmed.json" ./tmp/data_for_dmaap_test.json |
| 226 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 227 | |
| 228 | EXPECTED_DATA_DELIV=$(($NUM_JOBS+$EXPECTED_DATA_DELIV)) |
| 229 | mr_api_send_json_file "/events/unauthenticated.dmaapmed.json" ./tmp/data_for_dmaap_test.json |
| 230 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 200 |
| 231 | |
| 232 | # Check received data callbacks from mediator |
| 233 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 234 | do |
| 235 | cr_api_check_single_genric_event_md5_file 200 job-med-data$i ./tmp/data_for_dmaap_test.json |
| 236 | cr_api_check_single_genric_event_md5_file 200 job-med-data$i ./tmp/data_for_dmaap_test.json |
| 237 | cr_api_check_single_genric_event_md5_file 200 job-med-data$i ./tmp/data_for_dmaap_test.json |
| 238 | cr_api_check_single_genric_event_md5_file 200 job-med-data$i ./tmp/data_for_dmaap_test.json |
| 239 | cr_api_check_single_genric_event_md5_file 200 job-med-data$i ./tmp/data_for_dmaap_test.json |
| 240 | done |
| 241 | |
| 242 | |
| 243 | # Send small json via message-router to adapter |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 244 | mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-1"}' |
| 245 | mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-3"}' |
| 246 | |
| 247 | # Wait for data recetption, adapter |
| 248 | EXPECTED_DATA_DELIV=$(($NUM_JOBS*2+$EXPECTED_DATA_DELIV)) |
| 249 | start_timer "Data delivery adapter, 2 json per job" |
| 250 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 100 |
| 251 | print_timer "Data delivery adapter, 2 json per job" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 252 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 253 | # Send small text via message-routere to adapter |
| 254 | mr_api_send_text "/events/unauthenticated.dmaapadp_kafka.text" 'Message-------1' |
| 255 | mr_api_send_text "/events/unauthenticated.dmaapadp_kafka.text" 'Message-------3' |
| 256 | |
| 257 | # Wait for data recetption, adapter kafka |
| 258 | EXPECTED_DATA_DELIV=$(($NUM_JOBS*2+$EXPECTED_DATA_DELIV)) |
| 259 | start_timer "Data delivery adapte kafkar, 2 strings per job" |
| 260 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 100 |
| 261 | print_timer "Data delivery adapte kafkar, 2 strings per job" |
| 262 | |
| 263 | # Send small json via message-router to mediator |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 264 | mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-0"}' |
| 265 | mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-2"}' |
| 266 | |
| 267 | # Wait for data reception, mediator |
| 268 | EXPECTED_DATA_DELIV=$(($NUM_JOBS*2+$EXPECTED_DATA_DELIV)) |
| 269 | start_timer "Data delivery mediator, 2 json per job" |
| 270 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 100 |
| 271 | print_timer "Data delivery mediator, 2 json per job" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 272 | |
| 273 | # Check received number of messages for mediator and adapter callbacks |
| 274 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 275 | do |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 276 | cr_equal received_callbacks?id=job-med-data$i 7 |
| 277 | cr_equal received_callbacks?id=job-adp-data$i 7 |
| 278 | cr_equal received_callbacks?id=job-adp-kafka-data$i 7 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 279 | done |
| 280 | |
| 281 | # Check received data and order for mediator and adapter callbacks |
| 282 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 283 | do |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 284 | cr_api_check_single_genric_event_md5 200 job-med-data$i '{"msg":"msg-0"}' |
| 285 | cr_api_check_single_genric_event_md5 200 job-med-data$i '{"msg":"msg-2"}' |
| 286 | cr_api_check_single_genric_event_md5 200 job-adp-data$i '{"msg":"msg-1"}' |
| 287 | cr_api_check_single_genric_event_md5 200 job-adp-data$i '{"msg":"msg-3"}' |
| 288 | cr_api_check_single_genric_event_md5 200 job-adp-kafka-data$i 'Message-------1' |
| 289 | cr_api_check_single_genric_event_md5 200 job-adp-kafka-data$i 'Message-------3' |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 290 | done |
| 291 | |
| 292 | # Set delay in the callback receiver to slow down callbacks |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 293 | SEC_DELAY=2 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 294 | cr_delay_callback 200 $SEC_DELAY |
| 295 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 296 | # Send small json via message-router to adapter |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 297 | mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-5"}' |
| 298 | mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-7"}' |
| 299 | |
| 300 | # Wait for data recetption, adapter |
| 301 | EXPECTED_DATA_DELIV=$(($NUM_JOBS*2+$EXPECTED_DATA_DELIV)) |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 302 | start_timer "Data delivery adapter with $SEC_DELAY seconds delay in consumer, 2 json per job" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 303 | cr_equal received_callbacks $EXPECTED_DATA_DELIV $(($NUM_JOBS+300)) |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 304 | print_timer "Data delivery adapter with $SEC_DELAY seconds delay in consumer, 2 json per job" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 305 | |
| 306 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 307 | # Send small text via message-router to adapter kafka |
| 308 | mr_api_send_text "/events/unauthenticated.dmaapadp_kafka.text" 'Message-------5' |
| 309 | mr_api_send_text "/events/unauthenticated.dmaapadp_kafka.text" 'Message-------7' |
| 310 | |
| 311 | # Wait for data recetption, adapter kafka |
| 312 | EXPECTED_DATA_DELIV=$(($NUM_JOBS*2+$EXPECTED_DATA_DELIV)) |
| 313 | start_timer "Data delivery adapter kafka with $SEC_DELAY seconds delay in consumer, 2 strings per job" |
| 314 | cr_equal received_callbacks $EXPECTED_DATA_DELIV $(($NUM_JOBS+300)) |
| 315 | print_timer "Data delivery adapter with kafka $SEC_DELAY seconds delay in consumer, 2 strings per job" |
| 316 | |
| 317 | |
| 318 | # Send small json via message-router to mediator |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 319 | mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-4"}' |
| 320 | mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-6"}' |
| 321 | |
| 322 | # Wait for data reception, mediator |
| 323 | EXPECTED_DATA_DELIV=$(($NUM_JOBS*2+$EXPECTED_DATA_DELIV)) |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 324 | start_timer "Data delivery mediator with $SEC_DELAY seconds delay in consumer, 2 json per job" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 325 | cr_equal received_callbacks $EXPECTED_DATA_DELIV 1000 |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 326 | print_timer "Data delivery mediator with $SEC_DELAY seconds delay in consumer, 2 json per job" |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 327 | |
| 328 | # Check received number of messages for mediator and adapter callbacks |
| 329 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 330 | do |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 331 | cr_equal received_callbacks?id=job-med-data$i 9 |
| 332 | cr_equal received_callbacks?id=job-adp-data$i 9 |
| 333 | cr_equal received_callbacks?id=job-adp-kafka-data$i 9 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 334 | done |
| 335 | |
| 336 | # Check received data and order for mediator and adapter callbacks |
| 337 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 338 | do |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 339 | cr_api_check_single_genric_event_md5 200 job-med-data$i '{"msg":"msg-4"}' |
| 340 | cr_api_check_single_genric_event_md5 200 job-med-data$i '{"msg":"msg-6"}' |
| 341 | cr_api_check_single_genric_event_md5 200 job-adp-data$i '{"msg":"msg-5"}' |
| 342 | cr_api_check_single_genric_event_md5 200 job-adp-data$i '{"msg":"msg-7"}' |
| 343 | cr_api_check_single_genric_event_md5 200 job-adp-kafka-data$i 'Message-------5' |
| 344 | cr_api_check_single_genric_event_md5 200 job-adp-kafka-data$i 'Message-------7' |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 345 | done |
| 346 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 347 | #### TEST COMPLETE #### |
| 348 | |
| 349 | store_logs END |
| 350 | |
| 351 | print_result |
| 352 | |
BjornMagnussonXA | 6fc58fd | 2021-11-18 08:19:45 +0100 | [diff] [blame^] | 353 | auto_clean_environment |