fi
if [ $paramError -ne 0 ]; then
- __print_err "<response-code> <ric-id>|NORIC <service-id>|NOSERVICE <policy-ype-id>|NOTYPE [ NOID | [<policy-id> <ric-id> <service-id> EMPTY|<policy-type-id> <template-file>]*]" $@
+ __print_err "<response-code> <ric-id>|NORIC <service-id>|NOSERVICE <policy-type-id>|NOTYPE [ NOID | [<policy-id> <ric-id> <service-id> EMPTY|<policy-type-id> <template-file>]*]" $@
return 1
fi
queryparams=""
if [ "$targetJson" != "[" ]; then
targetJson=$targetJson","
fi
- targetJson=$targetJson"{\"id\":\"${arr[$i]}\",\"lastModified\":\"????\",\"ric\":\"${arr[$i+1]}\",\"service\":\"${arr[$i+2]}\",\"type\":"
+ targetJson=$targetJson"{\"id\":\"$UUID${arr[$i]}\",\"lastModified\":\"????\",\"ric\":\"${arr[$i+1]}\",\"service\":\"${arr[$i+2]}\",\"type\":"
if [ "${arr[$i+3]}" == "EMPTY" ]; then
targetJson=$targetJson"\"\","
else
return 1
fi
- query="/policy?id=$2"
+ query="/policy?id=$UUID$2"
res="$(__do_curl_to_agent GET $query)"
status=${res:${#res}-3}
((RES_TEST++))
if [ $# -lt 7 ] || [ $# -gt 8 ]; then
- __print_err "<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]" $@
+ __print_err "<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient>|NOTRANSIENT <template-file> [<count>]" $@
return 1
fi
file=$7
while [ $count -lt $max ]; do
- query="/policy?id=$pid&ric=$ric&service=$2"
+ query="/policy?id=$UUID$pid&ric=$ric&service=$2"
if [ $4 != "NOTYPE" ]; then
query=$query"&type=$4"
status=${res:${#res}-3}
echo -ne " Creating "$count"("$max")${SAMELINE}"
if [ $status -ne $1 ]; then
- let pid=$pid+1
echo " Created "$count"?("$max")"
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
file=$7
ARR=""
while [ $count -lt $max ]; do
- query="/policy?id=$pid&ric=$ric&service=$2"
+ query="/policy?id=$UUID$pid&ric=$ric&service=$2"
if [ $4 != "NOTYPE" ]; then
query=$query"&type=$4"
echo -ne " Requested(batch) "$count"("$max")${SAMELINE}"
if [ $status -ne 200 ]; then
- let pid=$pid+1
echo " Requested(batch) "$count"?("$max")"
echo -e $RED" FAIL. Exepected status 200 (in request), got "$status $ERED
((RES_FAIL++))
echo -ne " Created(batch) "$count"("$max")${SAMELINE}"
if [ $status -ne $1 ]; then
- let pid=$pid+1
echo " Created(batch) "$count"?("$max")"
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
for ((i=1; i<=$pids; i++))
do
+ uuid=$UUID
+ if [ -z "$uuid" ]; then
+ uuid="NOUUID"
+ fi
echo "" > ".pid${i}.res.txt"
- echo $resp_code $urlbase $ric_base $num_rics $start_id $template $count $pids $i > ".pid${i}.txt"
+ echo $resp_code $urlbase $ric_base $num_rics $uuid $start_id $template $count $pids $i > ".pid${i}.txt"
echo $i
done | xargs -n 1 -I{} -P $pids bash -c '{
arg=$(echo {})
pid=$2
while [ $count -lt $max ]; do
- query="/policy?id="$pid
+ query="/policy?id="$UUID$pid
res="$(__do_curl_to_agent DELETE $query)"
status=${res:${#res}-3}
echo -ne " Deleting "$count"("$max")${SAMELINE}"
pid=$2
ARR=""
while [ $count -lt $max ]; do
- query="/policy?id="$pid
+ query="/policy?id="$UUID$pid
res="$(__do_curl_to_agent DELETE_BATCH $query)"
status=${res:${#res}-3}
echo -ne " Requested(batch) "$count"("$max")${SAMELINE}"
if [ $status -ne 200 ]; then
- let pid=$pid+1
echo " Requested(batch) "$count"?("$max")"
echo -e $RED" FAIL. Exepected status 200 (in request), got "$status $ERED
((RES_FAIL++))
echo -ne " Deleted(batch) "$count"("$max")${SAMELINE}"
if [ $status -ne $1 ]; then
- let pid=$pid+1
echo " Deleted(batch) "$count"?("$max")"
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
for ((i=1; i<=$pids; i++))
do
+ uuid=$UUID
+ if [ -z "$uuid" ]; then
+ uuid="NOUUID"
+ fi
echo "" > ".pid${i}.del.res.txt"
- echo $resp_code $urlbase $num_rics $start_id $count $pids $i > ".pid${i}.del.txt"
+ echo $resp_code $urlbase $num_rics $uuid $start_id $count $pids $i > ".pid${i}.del.txt"
echo $i
done | xargs -n 1 -I{} -P $pids bash -c '{
arg=$(echo {})
targetJson=$targetJson","
fi
if [ $pid != "NOID" ]; then
- targetJson=$targetJson"\"$pid\""
+ targetJson=$targetJson"\"$UUID$pid\""
fi
done
return 1
fi
- query="/policy_status?id="$2
+ query="/policy_status?id="$UUID$2
res="$(__do_curl_to_agent GET $query)"
status=${res:${#res}-3}