- if [ $res -ne 0 ]; then
- echo -e $RED" FAIL, returned body not correct"$ERED
- ((RES_FAIL++))
- __check_stop_at_error
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+ if [ $# -eq 4 ]; then
+ body=${res:0:${#res}-3}
+ targetJson="{\"operationalState\": \"$4\"}"
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ fi
+ else
+ echo -e $YELLOW"USING NOT CONFIRMED INTERFACE - FLAT URI STRUCTURE"$EYELLOW
+ if [ $# -ne 2 ] && [ $# -ne 3 ]; then
+ __print_err "<response-code> <job-id> [<status>]" $@
+ return 1
+ fi
+
+ query="/A1-EI/v1/eijobs/$2/status"
+
+ res="$(__do_curl_to_api ECS GET $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status