X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fapi_curl.sh;h=e99f5791f94f0028e2c24a07ba4185ef21f32592;hb=d2aeca8843fe3ffca2e73dec5b64daeef0dda938;hp=f2777ebfcafef1e93936f31020b23c30e448bc59;hpb=09e21f39a3ffcfc2063110bcad028014b0056398;p=nonrtric.git diff --git a/test/common/api_curl.sh b/test/common/api_curl.sh index f2777ebf..e99f5791 100644 --- a/test/common/api_curl.sh +++ b/test/common/api_curl.sh @@ -17,13 +17,13 @@ # ============LICENSE_END================================================= # -# Generic function to query the agent/ECS via the REST or DMAAP interface. -# Used by all other agent/ECS api test functions +# Generic function to query the A1PMS/ICS via the REST or DMAAP interface. +# Used by all other A1PMS/ICS api test functions # If operation sufffix is '_BATCH' the the send and get response is split in two sequences, # one for sending the requests and one for receiving the response # but only when using the DMAAP interface # REST or DMAAP is controlled of the base url of $XX_ADAPTER -# arg: (PA|ECS|CR|RC GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH | [ [mime-type]]) | (PA|ECS RESPONSE ) +# arg: (A1PMS|ICS|CR|RC GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH | [ [mime-type]]) | (A1PMS|ICS RESPONSE ) # Default mime type for file is application/json unless specified in parameter mime-type # (Not for test scripts) __do_curl_to_api() { @@ -42,17 +42,17 @@ __do_curl_to_api() { input_url=$3 fname=$4 if [ $# -gt 0 ]; then - if [ $1 == "PA" ]; then - __ADAPTER=$PA_ADAPTER - __ADAPTER_TYPE=$PA_ADAPTER_TYPE - __RETRY_CODES=$AGENT_RETRY_CODES - if [ $PMS_VERSION != "V1" ]; then - input_url=$PMS_API_PREFIX$3 + if [ $1 == "A1PMS" ]; then + __ADAPTER=$A1PMS_ADAPTER + __ADAPTER_TYPE=$A1PMS_ADAPTER_TYPE + __RETRY_CODES=$A1PMS_RETRY_CODES + if [ $A1PMS_VERSION != "V1" ]; then + input_url=$A1PMS_API_PREFIX$3 fi - elif [ $1 == "ECS" ]; then - __ADAPTER=$ECS_ADAPTER - __ADAPTER_TYPE=$ECS_ADAPTER_TYPE - __RETRY_CODES=$ECS_RETRY_CODES + elif [ $1 == "ICS" ]; then + __ADAPTER=$ICS_ADAPTER + __ADAPTER_TYPE=$ICS_ADAPTER_TYPE + __RETRY_CODES=$ICS_RETRY_CODES elif [ $1 == "CR" ]; then __ADAPTER=$CR_ADAPTER __ADAPTER_TYPE=$CR_ADAPTER_TYPE @@ -81,6 +81,10 @@ __do_curl_to_api() { __ADAPTER=$MR_DMAAP_ADAPTER_HTTP __ADAPTER_TYPE=$MR_DMAAP_ADAPTER_TYPE __RETRY_CODES="" + elif [ $1 == "KAFKAPC" ]; then + __ADAPTER=$KAFKAPC_ADAPTER + __ADAPTER_TYPE=$KAFKAPC_ADAPTER_TYPE + __RETRY_CODES="" else paramError=1 fi @@ -139,7 +143,6 @@ __do_curl_to_api() { if [ $# -ne 3 ]; then paramError=1 fi - #if [ $__ADAPTER == $__RESTBASE ] || [ $__ADAPTER == $__RESTBASE_SECURE ]; then if [ $__ADAPTER_TYPE == "REST" ]; then paramError=1 fi @@ -151,13 +154,12 @@ __do_curl_to_api() { if [ $paramError -eq 1 ]; then ((RES_CONF_FAIL++)) echo "-Incorrect number of parameters to __do_curl_to_api " $@ >> $HTTPLOG - echo "-Expected: (PA|ECS GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH []) | (PA|ECS RESPONSE )" >> $HTTPLOG + echo "-Expected: (A1PMS|ICS GET|PUT|POST|DELETE|GET_BATCH|PUT_BATCH|POST_BATCH|DELETE_BATCH [ [mime-type]]) | (A1PMS|ICS RESPONSE )" >> $HTTPLOG echo "-Returning response 000" >> $HTTPLOG echo "-000" return 1 fi - #if [ $__ADAPTER == $__RESTBASE ] || [ $__ADAPTER == $__RESTBASE_SECURE ]; then if [ $__ADAPTER_TYPE == "REST" ]; then url=" "${__ADAPTER}${input_url} oper=" -X "$oper @@ -248,7 +250,7 @@ __do_curl_to_api() { echo " RESP: "$res >> $HTTPLOG status=${res:${#res}-3} TS=$SECONDS - # wait of the reply from the agent/ECS... + # wait of the reply from the A1PMS/ICS... while [ $status -eq 204 ]; do if [ $(($SECONDS - $TS)) -gt 90 ]; then echo " RETCODE: (timeout after 90s)" >> $HTTPLOG