+ __collect_endpoint_stats "A1PMS" 02 "PUT" ${A1PMS_API_PREFIX}${query} ${status} ${max}
+ echo ""
+
+ __log_test_pass
+ return 0
+}
+
+# API Test function: V3 PUT a1policymanagement/v1/policies
+# args: <response-code> <policy-id> <template-file> [<count>]
+# args(V2): <response-code> <policy-id> <template-file> [<count>]
+# (Function for test scripts)
+a1pms_api_put_policy_v3() {
+ __log_test_start $@
+
+ if [ $# -lt 3 ] || [ $# -gt 4 ]; then
+ __print_err "<response-code> <policy-id> <template-file> [<count>]" $@
+ return 1
+ fi
+
+ count=0
+ max=1
+ pid=$2
+ temp=$3
+
+ if [ $# -eq 4 ]; then
+ max=$4
+ fi
+
+ while [ $count -lt $max ]; do
+ query="/v1/policies/$UUID$pid"
+ file="./tmp/.p_v3.json"
+ let update_value=$pid+300
+ data=$(sed 's/XXX/'${update_value}'/g' $temp)
+ inputJson="$data"
+ echo $inputJson >$file
+ res="$(__do_curl_to_api A1PMS PUT $query $file)"
+ status=${res:${#res}-3}
+ echo -ne " Executing "$count"("$max")${SAMELINE}"
+ if [ $status -ne $1 ]; then
+ echo " Executed "$count"?("$max")"
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+ let pid=$pid+1
+ let count=$count+1
+ echo -ne " Executed "$count"("$max")${SAMELINE}"
+ done
+ __collect_endpoint_stats "A1PMS" 02 "PUT" ${A1PMS_API_PREFIX}${query} ${status} ${max}
+ echo ""
+
+ __log_test_pass
+ return 0
+}
+
+# API Test function: V£ POST a1policymanagement/v1/policies
+# args: <response-code> <service-name> <ric-id> <policytype-id>|NOTYPE <policy-id> <transient>|NOTRANSIENT <template-file> [<count>]
+# args(V2): <response-code> <service-name> <ric-id> <policytype-id>|NOTYPE <policy-id> <transient>|NOTRANSIENT <notification-url>|NOURL <template-file> [<count>]
+# (Function for test scripts)
+a1pms_api_post_policy_v3() {
+ __log_test_start $@
+
+ if [ $# -lt 8 ] || [ $# -gt 9 ]; then
+ __print_err "<response-code> <service-name> <ric-id> <policytype-id>|NOTYPE <policy-id> <transient>|NOTRANSIENT <notification-url>|NOURL <template-file> [<count>]" $@
+ return 1
+ fi
+
+ count=0
+ max=1
+ serv=$2
+ ric=$3
+ pt=$4
+ pid=$5
+ trans=$6
+ noti=$7
+ temp=$8
+ if [ $# -eq 9 ]; then
+ max=$9
+ fi
+
+ while [ $count -lt $max ]; do
+ query="/v1/policies"
+
+ inputJson="\"nearRtRicId\":\"$ric\""
+ if [ $pt != "NOTYPE" ]; then
+ inputJson=$inputJson", \"policyTypeId\":\"$pt\""
+ else
+ inputJson=$inputJson", \"policyTypeId\":\"\""
+ fi
+ if [ $serv != "NOSERVICE" ]; then
+ inputJson=$inputJson", \"serviceId\":\"$serv\""
+ fi
+ if [ $noti != "NONOTIFYURL" ]; then
+ inputJson=$inputJson", \"statusNotificationUri\":\"$noti\""
+ fi
+ if [ $trans != "NOTRANSIENT" ]; then
+ inputJson=$inputJson", \"transient\":\"$trans\""
+ fi
+ file="./tmp/.p.json"
+ data=$(sed 's/XXX/'${pid}'/g' $temp)
+ inputJson=$inputJson", \"policyObject\":$data"
+ inputJson=$inputJson", \"policyId\":\"$UUID$pid\""
+ inputJson="{$inputJson}"
+ echo $inputJson >$file
+ res="$(__do_curl_to_api A1PMS POST $query $file)"
+ status=${res:${#res}-3}
+ echo -ne " Executing "$count"("$max")${SAMELINE}"
+ if [ $status -ne $1 ]; then
+ echo " Executed "$count"?("$max")"
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+ let pid=$pid+1
+ let count=$count+1
+ echo -ne " Executed "$count"("$max")${SAMELINE}"
+ done
+ __collect_endpoint_stats "A1PMS" 02 "PUT" ${A1PMS_API_PREFIX}${A1PMS_VERSION} ${status} ${max}