X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fecs_api_functions.sh;h=6c4317342b471231ec588e91871cfc78223115d9;hb=f2bfafab18e7fb197a7e351a4f6a89c2936cbb5c;hp=56c2a2e1b7da2aac81a8557de0214de7f8393a64;hpb=5343c3097bd7ae1c1c8d5f0409803c0c60034805;p=nonrtric.git diff --git a/test/common/ecs_api_functions.sh b/test/common/ecs_api_functions.sh index 56c2a2e1..6c431734 100644 --- a/test/common/ecs_api_functions.sh +++ b/test/common/ecs_api_functions.sh @@ -806,12 +806,12 @@ ecs_api_edp_put_producer() { } # API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/eijobs -# args: (EMPTY | [ ]+) +# args: (EMPTY | [ ]+) # (Function for test scripts) ecs_api_edp_get_producer_jobs() { __log_test_start $@ - #Valid number of parameter 2,3,6,10 + #Valid number of parameter 2,3,7,11 paramError=1 if [ $# -eq 2 ]; then paramError=0 @@ -820,11 +820,11 @@ ecs_api_edp_get_producer_jobs() { paramError=0 fi variablecount=$(($#-2)) - if [ $# -gt 3 ] && [ $(($variablecount%4)) -eq 0 ]; then + if [ $# -gt 3 ] && [ $(($variablecount%5)) -eq 0 ]; then paramError=0 fi if [ $paramError -eq 1 ]; then - __print_err " (EMPTY | [ ]+)" $@ + __print_err " (EMPTY | [ ]+)" $@ return 1 fi @@ -840,18 +840,18 @@ ecs_api_edp_get_producer_jobs() { targetJson="[" if [ $# -gt 3 ]; then arr=(${@:3}) - for ((i=0; i<$(($#-3)); i=i+4)); do + for ((i=0; i<$(($#-3)); i=i+5)); do if [ "$targetJson" != "[" ]; then targetJson=$targetJson"," fi - if [ -f ${arr[$i+3]} ]; then - jobfile=$(cat ${arr[$i+3]}) + if [ -f ${arr[$i+4]} ]; then + jobfile=$(cat ${arr[$i+4]}) jobfile=$(echo "$jobfile" | sed "s/XXXX/${arr[$i]}/g") else - _log_test_fail_general "Job template file "${arr[$i+3]}", does not exist" + _log_test_fail_general "Job template file "${arr[$i+4]}", does not exist" return 1 fi - targetJson=$targetJson"{\"ei_job_identity\":\"${arr[$i]}\",\"ei_type_identity\":\"${arr[$i+1]}\",\"target_uri\":\"${arr[$i+2]}\",\"ei_job_data\":$jobfile}" + targetJson=$targetJson"{\"ei_job_identity\":\"${arr[$i]}\",\"ei_type_identity\":\"${arr[$i+1]}\",\"target_uri\":\"${arr[$i+2]}\",\"owner\":\"${arr[$i+3]}\",\"ei_job_data\":$jobfile}" done fi targetJson=$targetJson"]"