3 # ============LICENSE_START===============================================
4 # Copyright (C) 2020 Nordix Foundation. All rights reserved.
5 # ========================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=================================================
20 # This is a script that contains specific test functions for ECS NB/SB API
22 . ../common/api_curl.sh
24 # Tests if a variable value in the ECS is equal to a target value and and optional timeout.
25 # Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
26 # equal to the target or not.
27 # Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
28 # before setting pass or fail depending on if the variable value becomes equal to the target
30 # (Function for test scripts)
32 if [ $# -eq 2 ] || [ $# -eq 3 ]; then
33 __var_test ECS "$LOCALHOST$ECS_EXTERNAL_PORT/" $1 "=" $2 $3
35 __print_err "Wrong args to ecs_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
40 ##########################################
41 ######### A1-E Enrichment API ##########
42 ##########################################
43 #Function prefix: ecs_api_a1
45 # API Test function: GET /A1-EI/v1/eitypes/{eiTypeId}/eijobs
46 # args: <response-code> <type-id> <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]
47 # args (flat uri structure): <response-code> <type-id>|NOTYPE <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]
48 # (Function for test scripts)
49 ecs_api_a1_get_job_ids() {
52 if [ -z "$FLAT_A1_EI" ]; then
53 # Valid number of parameters 4,5,6 etc
55 __print_err "<response-code> <type-id> <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]" $@
59 echo -e $YELLOW"USING NOT CONFIRMED INTERFACE - FLAT URI STRUCTURE"$EYELLOW
60 # Valid number of parameters 4,5,6 etc
62 __print_err "<response-code> <type-id>|NOTYPE <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]" $@
67 if [ $3 != "NOWNER" ]; then
71 if [ -z "$FLAT_A1_EI" ]; then
72 query="/A1-EI/v1/eitypes/$2/eijobs$search"
74 if [ $2 != "NOTYPE" ]; then
75 if [ -z "$search" ]; then
78 search=$search"&eiTypeId="$2
81 query="/A1-EI/v1/eijobs$search"
83 res="$(__do_curl_to_api ECS GET $query)"
84 status=${res:${#res}-3}
86 if [ $status -ne $1 ]; then
87 __log_test_fail_status_code $1 $status
92 body=${res:0:${#res}-3}
95 for pid in ${@:4} ; do
96 if [ "$targetJson" != "[" ]; then
97 targetJson=$targetJson","
99 if [ $pid != "EMPTY" ]; then
100 targetJson=$targetJson"\"$pid\""
104 targetJson=$targetJson"]"
105 echo " TARGET JSON: $targetJson" >> $HTTPLOG
106 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
108 if [ $res -ne 0 ]; then
118 # API Test function: GET /A1-EI/v1/eitypes/{eiTypeId}
119 # args: <response-code> <type-id> [<schema-file>]
120 # (Function for test scripts)
121 ecs_api_a1_get_type() {
124 if [ $# -lt 2 ] || [ $# -gt 3 ]; then
125 __print_err "<response-code> <type-id> [<schema-file>]" $@
129 query="/A1-EI/v1/eitypes/$2"
130 res="$(__do_curl_to_api ECS GET $query)"
131 status=${res:${#res}-3}
133 if [ $status -ne $1 ]; then
134 __log_test_fail_status_code $1 $status
138 if [ $# -eq 3 ]; then
139 body=${res:0:${#res}-3}
143 __log_test_fail_general "Schema file "$3", does not exist"
146 if [ -z "$FLAT_A1_EI" ]; then
147 targetJson="{\"eiJobParametersSchema\":$schema}"
151 echo " TARGET JSON: $targetJson" >> $HTTPLOG
152 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
154 if [ $res -ne 0 ]; then
164 # API Test function: GET /A1-EI/v1/eitypes
165 # args: <response-code> [ (EMPTY | [<type-id>]+) ]
166 # (Function for test scripts)
167 ecs_api_a1_get_type_ids() {
170 if [ $# -lt 1 ]; then
171 __print_err "<response-code> [ (EMPTY | [<type-id>]+) ]" $@
175 query="/A1-EI/v1/eitypes"
176 res="$(__do_curl_to_api ECS GET $query)"
177 status=${res:${#res}-3}
179 if [ $status -ne $1 ]; then
180 __log_test_fail_status_code $1 $status
183 if [ $# -gt 1 ]; then
184 body=${res:0:${#res}-3}
186 if [ $2 != "EMPTY" ]; then
187 for pid in ${@:2} ; do
188 if [ "$targetJson" != "[" ]; then
189 targetJson=$targetJson","
191 targetJson=$targetJson"\"$pid\""
194 targetJson=$targetJson"]"
195 echo " TARGET JSON: $targetJson" >> $HTTPLOG
196 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
198 if [ $res -ne 0 ]; then
208 # API Test function: GET /A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}/status
209 # args: <response-code> <type-id> <job-id> [<status>]
210 # args (flat uri structure): <response-code> <job-id> [<status>]
211 # (Function for test scripts)
212 ecs_api_a1_get_job_status() {
215 if [ -z "$FLAT_A1_EI" ]; then
216 if [ $# -ne 3 ] && [ $# -ne 4 ]; then
217 __print_err "<response-code> <type-id> <job-id> [<status>]" $@
221 query="/A1-EI/v1/eitypes/$2/eijobs/$3/status"
223 res="$(__do_curl_to_api ECS GET $query)"
224 status=${res:${#res}-3}
226 if [ $status -ne $1 ]; then
227 __log_test_fail_status_code $1 $status
230 if [ $# -eq 4 ]; then
231 body=${res:0:${#res}-3}
232 targetJson="{\"operationalState\": \"$4\"}"
233 echo " TARGET JSON: $targetJson" >> $HTTPLOG
234 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
236 if [ $res -ne 0 ]; then
242 echo -e $YELLOW"USING NOT CONFIRMED INTERFACE - FLAT URI STRUCTURE"$EYELLOW
243 if [ $# -ne 2 ] && [ $# -ne 3 ]; then
244 __print_err "<response-code> <job-id> [<status>]" $@
248 query="/A1-EI/v1/eijobs/$2/status"
250 res="$(__do_curl_to_api ECS GET $query)"
251 status=${res:${#res}-3}
253 if [ $status -ne $1 ]; then
254 __log_test_fail_status_code $1 $status
257 if [ $# -eq 3 ]; then
258 body=${res:0:${#res}-3}
259 targetJson="{\"eiJobStatus\": \"$3\"}"
260 echo " TARGET JSON: $targetJson" >> $HTTPLOG
261 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
263 if [ $res -ne 0 ]; then
274 # API Test function: GET /A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}
275 # args: <response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]
276 # args (flat uri structure): <response-code> <job-id> [<type-id> <target-url> <owner-id> <template-job-file>]
277 # (Function for test scripts)
278 ecs_api_a1_get_job() {
281 if [ -z "$FLAT_A1_EI" ]; then
282 if [ $# -ne 3 ] && [ $# -ne 6 ]; then
283 __print_err "<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]" $@
286 query="/A1-EI/v1/eitypes/$2/eijobs/$3"
288 echo -e $YELLOW"USING NOT CONFIRMED INTERFACE - FLAT URI STRUCTURE"$EYELLOW
289 if [ $# -ne 2 ] && [ $# -ne 7 ]; then
290 __print_err "<response-code> <job-id> [<type-id> <target-url> <owner-id> <notification-url> <template-job-file>]" $@
293 query="/A1-EI/v1/eijobs/$2"
295 res="$(__do_curl_to_api ECS GET $query)"
296 status=${res:${#res}-3}
298 if [ $status -ne $1 ]; then
299 __log_test_fail_status_code $1 $status
303 if [ -z "$FLAT_A1_EI" ]; then
304 if [ $# -eq 6 ]; then
305 body=${res:0:${#res}-3}
309 jobfile=$(echo "$jobfile" | sed "s/XXXX/$3/g")
311 _log_test_fail_general "Job template file "$6", does not exist"
314 targetJson="{\"targetUri\": \"$4\",\"jobOwner\": \"$5\",\"jobParameters\": $jobfile}"
315 echo " TARGET JSON: $targetJson" >> $HTTPLOG
316 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
318 if [ $res -ne 0 ]; then
324 if [ $# -eq 7 ]; then
325 body=${res:0:${#res}-3}
329 jobfile=$(echo "$jobfile" | sed "s/XXXX/$2/g")
331 _log_test_fail_general "Job template file "$6", does not exist"
334 targetJson="{\"eiTypeId\": \"$3\", \"jobResultUri\": \"$4\",\"jobOwner\": \"$5\",\"jobStatusNotificationUri\": \"$6\",\"jobDefinition\": $jobfile}"
335 echo " TARGET JSON: $targetJson" >> $HTTPLOG
336 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
338 if [ $res -ne 0 ]; then
349 # API Test function: DELETE /A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}
350 # args: <response-code> <type-id> <job-id>
351 # args (flat uri structure): <response-code> <job-id>
352 # (Function for test scripts)
353 ecs_api_a1_delete_job() {
356 if [ -z "$FLAT_A1_EI" ]; then
357 if [ $# -ne 3 ]; then
358 __print_err "<response-code> <type-id> <job-id>" $@
362 query="/A1-EI/v1/eitypes/$2/eijobs/$3"
364 echo -e $YELLOW"USING NOT CONFIRMED INTERFACE - FLAT URI STRUCTURE"$EYELLOW
365 if [ $# -ne 2 ]; then
366 __print_err "<response-code> <job-id>" $@
369 query="/A1-EI/v1/eijobs/$2"
371 res="$(__do_curl_to_api ECS DELETE $query)"
372 status=${res:${#res}-3}
374 if [ $status -ne $1 ]; then
375 __log_test_fail_status_code $1 $status
383 # API Test function: PUT /A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}
384 # args: <response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>
385 # args (flat uri structure): <response-code> <job-id> <type-id> <target-url> <owner-id> <notification-url> <template-job-file>
386 # (Function for test scripts)
387 ecs_api_a1_put_job() {
390 if [ -z "$FLAT_A1_EI" ]; then
391 if [ $# -lt 6 ]; then
392 __print_err "<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>" $@
397 jobfile=$(echo "$jobfile" | sed "s/XXXX/$3/g")
399 _log_test_fail_general "Job template file "$6", does not exist"
403 inputJson="{\"targetUri\": \"$4\",\"jobOwner\": \"$5\",\"jobParameters\": $jobfile}"
405 echo "$inputJson" > $file
407 query="/A1-EI/v1/eitypes/$2/eijobs/$3"
409 echo -e $YELLOW"USING NOT CONFIRMED INTERFACE - FLAT URI STRUCTURE"$EYELLOW
410 if [ $# -lt 7 ]; then
411 __print_err "<response-code> <job-id> <type-id> <target-url> <owner-id> <notification-url> <template-job-file>" $@
416 jobfile=$(echo "$jobfile" | sed "s/XXXX/$2/g")
418 _log_test_fail_general "Job template file "$7", does not exist"
422 inputJson="{\"eiTypeId\": \"$3\", \"jobResultUri\": \"$4\",\"jobOwner\": \"$5\",\"jobStatusNotificationUri\": \"$6\",\"jobDefinition\": $jobfile}"
424 echo "$inputJson" > $file
426 query="/A1-EI/v1/eijobs/$2"
429 res="$(__do_curl_to_api ECS PUT $query $file)"
430 status=${res:${#res}-3}
432 if [ $status -ne $1 ]; then
433 __log_test_fail_status_code $1 $status
442 ##########################################
443 #### Enrichment Data Producer API ####
444 ##########################################
445 # Function prefix: ecs_api_edp
447 # API Test function: GET /ei-producer/v1/eitypes
448 # args: <response-code> [ EMPTY | <type-id>+]
449 # (Function for test scripts)
450 ecs_api_edp_get_type_ids() {
453 if [ $# -lt 1 ]; then
454 __print_err "<response-code> [ EMPTY | <type-id>+]" $@
458 query="/ei-producer/v1/eitypes"
459 res="$(__do_curl_to_api ECS GET $query)"
460 status=${res:${#res}-3}
462 if [ $status -ne $1 ]; then
463 __log_test_fail_status_code $1 $status
467 if [ $# -gt 1 ]; then
468 body=${res:0:${#res}-3}
470 if [ $2 != "EMPTY" ]; then
471 for pid in ${@:2} ; do
472 if [ "$targetJson" != "[" ]; then
473 targetJson=$targetJson","
475 targetJson=$targetJson"\"$pid\""
478 targetJson=$targetJson"]"
479 echo " TARGET JSON: $targetJson" >> $HTTPLOG
480 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
482 if [ $res -ne 0 ]; then
492 # API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/status
493 # args: <response-code> <producer-id> [<status> [<timeout>]]
494 # (Function for test scripts)
495 ecs_api_edp_get_producer_status() {
498 if [ $# -lt 2 ] || [ $# -gt 4 ]; then
499 __print_err "<response-code> <producer-id> [<status> [<timeout>]]" $@
503 query="/ei-producer/v1/eiproducers/$2/status"
506 res="$(__do_curl_to_api ECS GET $query)"
507 status=${res:${#res}-3}
509 if [ $# -eq 4 ]; then
510 duration=$((SECONDS-start))
511 echo -ne " Response=${status} after ${duration} seconds, waiting for ${3} ${SAMELINE}"
512 if [ $duration -gt $4 ]; then
514 duration=-1 #Last iteration
517 duration=-1 #single test, no wait
520 if [ $status -ne $1 ]; then
521 if [ $duration -eq -1 ]; then
522 __log_test_fail_status_code $1 $status
526 if [ $# -ge 3 ] && [ $status -eq $1 ]; then
527 body=${res:0:${#res}-3}
528 targetJson="{\"operational_state\": \"$3\"}"
529 echo " TARGET JSON: $targetJson" >> $HTTPLOG
530 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
532 if [ $res -ne 0 ]; then
533 if [ $duration -eq -1 ]; then
538 duration=-1 #Goto pass
541 if [ $duration -eq -1 ]; then
542 if [ $# -eq 4 ]; then
554 # API Test function: GET /ei-producer/v1/eiproducers
555 # args: <response-code> [ EMPTY | <producer-id>+]
556 # (Function for test scripts)
557 ecs_api_edp_get_producer_ids() {
560 if [ $# -lt 1 ]; then
561 __print_err "<response-code> [ EMPTY | <producer-id>+]" $@
565 query="/ei-producer/v1/eiproducers"
566 res="$(__do_curl_to_api ECS GET $query)"
567 status=${res:${#res}-3}
569 if [ $status -ne $1 ]; then
570 __log_test_fail_status_code $1 $status
574 if [ $# -gt 1 ]; then
575 body=${res:0:${#res}-3}
578 for pid in ${@:2} ; do
579 if [ "$targetJson" != "[" ]; then
580 targetJson=$targetJson","
582 if [ $pid != "EMPTY" ]; then
583 targetJson=$targetJson"\"$pid\""
587 targetJson=$targetJson"]"
588 echo " TARGET JSON: $targetJson" >> $HTTPLOG
589 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
591 if [ $res -ne 0 ]; then
601 # API Test function: GET /ei-producer/v1/eitypes/{eiTypeId}
602 # args: <response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]
603 # (Function for test scripts)
604 ecs_api_edp_get_type() {
608 if [ $# -eq 2 ]; then
611 if [ $# -gt 3 ]; then
614 if [ $paramError -ne 0 ]; then
615 __print_err "<response-code> <type-id> [<job-schema-file> 'EMPTY' | ([<producer-id>]+)]" $@
619 query="/ei-producer/v1/eitypes/$2"
620 res="$(__do_curl_to_api ECS GET $query)"
621 status=${res:${#res}-3}
623 if [ $status -ne $1 ]; then
624 __log_test_fail_status_code $1 $status
627 if [ $# -gt 3 ]; then
628 body=${res:0:${#res}-3}
633 __log_test_fail_general "Job template file "$3", does not exist"
638 if [ $4 != "EMPTY" ]; then
639 for pid in ${@:4} ; do
640 if [ "$targetJson" != "" ]; then
641 targetJson=$targetJson","
643 targetJson=$targetJson"\"$pid\""
646 targetJson="{\"ei_job_data_schema\":$schema, \"ei_producer_ids\": [$targetJson]}"
648 echo " TARGET JSON: $targetJson" >> $HTTPLOG
649 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
651 if [ $res -ne 0 ]; then
660 # API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}
661 # args: <response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]
662 # (Function for test scripts)
663 ecs_api_edp_get_producer() {
666 #Possible arg count: 2, 5 6, 8, 10 etc
668 if [ $# -eq 2 ]; then
671 if [ $# -eq 5 ] && [ "$5" == "EMPTY" ]; then
674 variablecount=$(($#-4))
675 if [ $# -gt 5 ] && [ $(($variablecount%2)) -eq 0 ]; then
679 if [ $paramError -ne 0 ]; then
680 __print_err "<response-code> <producer-id> [<job-callback> <supervision-callback> (NOID | [<type-id> <schema-file>]+) ]" $@
684 query="/ei-producer/v1/eiproducers/$2"
685 res="$(__do_curl_to_api ECS GET $query)"
686 status=${res:${#res}-3}
688 if [ $status -ne $1 ]; then
689 __log_test_fail_status_code $1 $status
693 if [ $# -gt 2 ]; then
694 body=${res:0:${#res}-3}
696 if [ $# -gt 5 ]; then
698 for ((i=0; i<$(($#-5)); i=i+2)); do
699 if [ "$targetJson" != "[" ]; then
700 targetJson=$targetJson","
702 if [ -f ${arr[$i+1]} ]; then
703 schema=$(cat ${arr[$i+1]})
705 _log_test_fail_general "Schema file "${arr[$i+1]}", does not exist"
709 targetJson=$targetJson"{\"ei_type_identity\":\"${arr[$i]}\",\"ei_job_data_schema\":$schema}"
712 targetJson=$targetJson"]"
713 if [ $# -gt 4 ]; then
714 targetJson="{\"supported_ei_types\":$targetJson,\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\"}"
716 echo " TARGET JSON: $targetJson" >> $HTTPLOG
717 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
719 if [ $res -ne 0 ]; then
729 # API Test function: DELETE /ei-producer/v1/eiproducers/{eiProducerId}
730 # args: <response-code> <producer-id>
731 # (Function for test scripts)
732 ecs_api_edp_delete_producer() {
735 if [ $# -lt 2 ]; then
736 __print_err "<response-code> <producer-id>" $@
740 query="/ei-producer/v1/eiproducers/$2"
741 res="$(__do_curl_to_api ECS DELETE $query)"
742 status=${res:${#res}-3}
744 if [ $status -ne $1 ]; then
745 __log_test_fail_status_code $1 $status
753 # API Test function: PUT /ei-producer/v1/eiproducers/{eiProducerId}
754 # args: <response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE|[<type-id> <schema-file>]+
755 # (Function for test scripts)
756 ecs_api_edp_put_producer() {
759 #Valid number of parametrer 5,6,8,10,
761 if [ $# -eq 5 ] && [ "$5" == "NOTYPE" ]; then
763 elif [ $# -gt 5 ] && [ $(($#%2)) -eq 0 ]; then
766 if [ $paramError -ne 0 ]; then
767 __print_err "<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE|[<type-id> <schema-file>]+" $@
772 if [ $# -gt 5 ]; then
774 for ((i=0; i<$(($#-5)); i=i+2)); do
775 if [ "$inputJson" != "[" ]; then
776 inputJson=$inputJson","
778 if [ -f ${arr[$i+1]} ]; then
779 schema=$(cat ${arr[$i+1]})
781 _log_test_fail_general "Schema file "${arr[$i+1]}", does not exist"
784 inputJson=$inputJson"{\"ei_type_identity\":\"${arr[$i]}\",\"ei_job_data_schema\":$schema}"
787 inputJson="\"supported_ei_types\":"$inputJson"]"
789 inputJson=$inputJson",\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\""
791 inputJson="{"$inputJson"}"
794 echo "$inputJson" > $file
795 query="/ei-producer/v1/eiproducers/$2"
796 res="$(__do_curl_to_api ECS PUT $query $file)"
797 status=${res:${#res}-3}
799 if [ $status -ne $1 ]; then
800 __log_test_fail_status_code $1 $status
808 # API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/eijobs
809 # args: <response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <template-job-file>]+)
810 # (Function for test scripts)
811 ecs_api_edp_get_producer_jobs() {
814 #Valid number of parameter 2,3,6,10
816 if [ $# -eq 2 ]; then
819 if [ $# -eq 3 ] && [ "$3" == "EMPTY" ]; then
822 variablecount=$(($#-2))
823 if [ $# -gt 3 ] && [ $(($variablecount%4)) -eq 0 ]; then
826 if [ $paramError -eq 1 ]; then
827 __print_err "<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <template-job-file>]+)" $@
831 query="/ei-producer/v1/eiproducers/$2/eijobs"
832 res="$(__do_curl_to_api ECS GET $query)"
833 status=${res:${#res}-3}
834 if [ $status -ne $1 ]; then
835 __log_test_fail_status_code $1 $status
838 if [ $# -gt 2 ]; then
839 body=${res:0:${#res}-3}
841 if [ $# -gt 3 ]; then
843 for ((i=0; i<$(($#-3)); i=i+4)); do
844 if [ "$targetJson" != "[" ]; then
845 targetJson=$targetJson","
847 if [ -f ${arr[$i+3]} ]; then
848 jobfile=$(cat ${arr[$i+3]})
849 jobfile=$(echo "$jobfile" | sed "s/XXXX/${arr[$i]}/g")
851 _log_test_fail_general "Job template file "${arr[$i+3]}", does not exist"
854 targetJson=$targetJson"{\"ei_job_identity\":\"${arr[$i]}\",\"ei_type_identity\":\"${arr[$i+1]}\",\"target_uri\":\"${arr[$i+2]}\",\"ei_job_data\":$jobfile}"
857 targetJson=$targetJson"]"
859 echo " TARGET JSON: $targetJson" >> $HTTPLOG
860 res=$(python3 ../common/compare_json.py "$targetJson" "$body")
862 if [ $res -ne 0 ]; then
873 ##########################################
874 #### Service status ####
875 ##########################################
876 # Function prefix: ecs_api_service
878 # API Test function: GET /status
879 # args: <response-code>
880 # (Function for test scripts)
881 ecs_api_service_status() {
884 if [ $# -lt 1 ]; then
885 __print_err "<response-code> [<producer-id>]*|NOID" $@
888 res="$(__do_curl_to_api ECS GET /status)"
889 status=${res:${#res}-3}
890 if [ $status -ne $1 ]; then
891 __log_test_fail_status_code $1 $status