X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fprodstub_api_functions.sh;h=54e59e300e9953a1a300ff7670355e4692b8337f;hb=e29568dbbfe4bb333c936dfe7b54ba639fdef492;hp=ae3f193ba692d6141e8ccd3f6ffad5667d6a5cf8;hpb=483ee33ac3de88385c0eeb3f1ecf3a1bb760db54;p=nonrtric.git diff --git a/test/common/prodstub_api_functions.sh b/test/common/prodstub_api_functions.sh index ae3f193b..54e59e30 100644 --- a/test/common/prodstub_api_functions.sh +++ b/test/common/prodstub_api_functions.sh @@ -35,7 +35,7 @@ __PRODSTUB_imagesetup() { # Shall be used for images that does not allow overriding # Both var may contain: 'remote', 'remote-remove' or 'local' __PRODSTUB_imagepull() { - echo -e $RED"Image for app PRODSTUB shall never be pulled from remove repo"$ERED + echo -e $RED"Image for app PRODSTUB shall never be pulled from remote repo"$ERED } # Build image (only for simulator or interfaces stubs owned by the test environment) @@ -270,7 +270,11 @@ __execute_curl_to_prodstub() { proxyflag="" if [ $RUNMODE == "KUBE" ]; then if [ ! -z "$KUBE_PROXY_PATH" ]; then - proxyflag=" --proxy $KUBE_PROXY_PATH" + if [ $KUBE_PROXY_HTTPX == "http" ]; then + proxyflag=" --proxy $KUBE_PROXY_PATH" + else + proxyflag=" --proxy-insecure --proxy $KUBE_PROXY_PATH" + fi fi fi echo " CMD: $3 $proxyflag" >> $HTTPLOG @@ -414,7 +418,7 @@ prodstub_check_jobdata() { jobfile=$(cat $7) jobfile=$(echo "$jobfile" | sed "s/XXXX/$3/g") else - _log_test_fail_general "Template file "$7" for jobdata, does not exist" + __log_test_fail_general "Template file "$7" for jobdata, does not exist" return 1 fi targetJson="{\"ei_job_identity\":\"$3\",\"ei_type_identity\":\"$4\",\"target_uri\":\"$5\",\"owner\":\"$6\", \"ei_job_data\":$jobfile}" @@ -440,7 +444,7 @@ prodstub_check_jobdata_2() { jobfile=$(cat $7) jobfile=$(echo "$jobfile" | sed "s/XXXX/$3/g") else - _log_test_fail_general "Template file "$7" for jobdata, does not exist" + __log_test_fail_general "Template file "$7" for jobdata, does not exist" return 1 fi targetJson="{\"ei_job_identity\":\"$3\",\"ei_type_identity\":\"$4\",\"target_uri\":\"$5\",\"owner\":\"$6\", \"ei_job_data\":$jobfile,\"last_updated\":\"????\"}" @@ -453,6 +457,32 @@ prodstub_check_jobdata_2() { return $? } +# Prodstub API: Get job data for a job and compare with a target job json (info-jobs) +# +# (Function for test scripts) +prodstub_check_jobdata_3() { + __log_test_start $@ + if [ $# -ne 7 ]; then + __print_err " " $@ + return 1 + fi + if [ -f $7 ]; then + jobfile=$(cat $7) + jobfile=$(echo "$jobfile" | sed "s/XXXX/$3/g") + else + __log_test_fail_general "Template file "$7" for jobdata, does not exist" + return 1 + fi + targetJson="{\"info_job_identity\":\"$3\",\"info_type_identity\":\"$4\",\"target_uri\":\"$5\",\"owner\":\"$6\", \"info_job_data\":$jobfile,\"last_updated\":\"????\"}" + file="./tmp/.p.json" + echo "$targetJson" > $file + + curlString="curl -X GET -skw %{http_code} $PROD_STUB_PATH/jobdata/$2/$3" + + __execute_curl_to_prodstub TEST $1 "$curlString" $file + return $? +} + # Prodstub API: Delete the job data # # (Function for test scripts)