X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fprodstub_api_functions.sh;h=54e59e300e9953a1a300ff7670355e4692b8337f;hb=c675b454a3434d690695a7336700f78a51579400;hp=6b7a3d8876cdb99b5eb44d8a94671cfd43043677;hpb=0af4e99bd52a02d439f0ff16dc5363bafdea2a93;p=nonrtric.git diff --git a/test/common/prodstub_api_functions.sh b/test/common/prodstub_api_functions.sh index 6b7a3d88..54e59e30 100644 --- a/test/common/prodstub_api_functions.sh +++ b/test/common/prodstub_api_functions.sh @@ -457,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)