Updating FTC to remove notification property from Policy Object info 99/13299/9
authorraviteja.karumuri <raviteja.karumuri@est.tech>
Wed, 4 Sep 2024 17:03:49 +0000 (18:03 +0100)
committerRAVITEJA KARUMURI <raviteja.karumuri@est.tech>
Fri, 15 Nov 2024 12:39:37 +0000 (12:39 +0000)
Issue-ID: NONRTRIC-1029
Signed-off-by: Raviteja Karumuri <raviteja.karumuri@est.tech>
Change-Id: I203961784abda8c5ae27f4a9e10bf29ccdf6cc62

docker-compose/policy-service/config/application-policyagent.yaml
test/auto-test/FTC1.sh
test/auto-test/FTC10.sh
test/auto-test/FTC100.sh
test/auto-test/FTC110.sh
test/auto-test/FTC2001.sh
test/auto-test/FTC850.sh
test/common/a1pms_api_functions.sh
test/common/create_policies_process.py

index 60419e3..646ad32 100755 (executable)
@@ -64,6 +64,10 @@ app:
   # Location of the component configuration file. The file will only be used if the Consul database is not used;
   # configuration from the Consul will override the file.
   filepath: /opt/app/policy-agent/data/application_configuration.json
+  # Postgres database usage is enabled using the below parameter.
+  # If this is enabled, the application will use postgres database for storage.
+  # This overrides the s3(s3.bucket) or file store(vardata-directory) configuration if enabled.
+  database-enabled: false
   webclient:
     # Configuration of the trust store used for the HTTP client (outgoing requests)
     # The file location and the password for the truststore is only relevant if trust-store-used == true
index cabd9b7..87284dd 100755 (executable)
@@ -246,11 +246,11 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
 
           notificationurl=$CR_SERVICE_APP_PATH_0"/test"
           if [ "$A1PMS_VERSION" == "V3" ]; then
-            a1pms_api_post_policy_v3 201 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
+            a1pms_api_post_policy_v3 201 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
             a1pms_api_put_policy_v3 200 5000 testdata/OSC/pi1_template.json
-            a1pms_api_post_policy_v3 201 "serv1" ricsim_g3_1 STD_QOS_0_2_0 5200 true $notificationurl testdata/STD2/pi_qos_template.json
+            a1pms_api_post_policy_v3 201 "serv1" ricsim_g3_1 STD_QOS_0_2_0 5200 true testdata/STD2/pi_qos_template.json
             a1pms_api_put_policy_v3 200 5200 testdata/STD2/pi_qos_template.json
-            a1pms_api_post_policy_v3 201 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
+            a1pms_api_post_policy_v3 201 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
             a1pms_api_put_policy_v3 200 5100 testdata/STD/pi1_template.json
           else
             a1pms_api_put_policy 201 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
index effa68e..a529c80 100755 (executable)
@@ -142,7 +142,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   a1pms_api_put_service 201 "service1" 3600 "$CR_SERVICE_APP_PATH_0/1"
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_api_post_policy_v3 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
+    a1pms_api_post_policy_v3 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json 1
   else
     a1pms_api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
   fi
@@ -156,7 +156,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   fi
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_api_post_policy_v3 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
+    a1pms_api_post_policy_v3 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT testdata/OSC/pi1_template.json 1
   else
     a1pms_api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
   fi
@@ -167,7 +167,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   use_a1pms_rest_http
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_api_post_policy_v3 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
+    a1pms_api_post_policy_v3 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT testdata/STD/pi1_template.json 1
   else
     a1pms_api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
   fi
@@ -182,7 +182,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   fi
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_api_post_policy_v3 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
+    a1pms_api_post_policy_v3 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT testdata/STD/pi1_template.json 1
   else
     a1pms_api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
   fi
@@ -192,7 +192,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   use_a1pms_rest_http
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_api_post_policy_v3 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
+    a1pms_api_post_policy_v3 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true testdata/STD2/pi_qos_template.json 1
   else
     a1pms_api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
   fi
@@ -206,7 +206,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   fi
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_api_post_policy_v3 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos_template.json 1
+    a1pms_api_post_policy_v3 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 NOTRANSIENT testdata/STD2/pi_qos_template.json 1
   else
     a1pms_api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos_template.json 1
   fi
index f910d58..fbe9fd2 100755 (executable)
@@ -491,13 +491,13 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
 
             a1pms_api_get_policy_types_v3 404 dummy-ric
 
-            a1pms_api_post_policy_v3 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT NONOTIFYURL testdata/OSC/pi1_template.json
+            a1pms_api_post_policy_v3 201 "unregistered-service" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json
 
-            a1pms_api_post_policy_v3 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT NONOTIFYURL testdata/OSC/pi1_template.json
+            a1pms_api_post_policy_v3 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
 
-            a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g2_1 NOTYPE 5100 NOTRANSIENT NONOTIFYURL testdata/STD/pi1_template.json
+            a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
 
-            a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT NONOTIFYURL testdata/STD2/pi_qos2_template.json
+            a1pms_api_post_policy_v3 201 NOSERVICE ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT testdata/STD2/pi_qos2_template.json
           fi
 
           a1pms_api_put_service 201 "service10" 3600 "$CR_SERVICE_APP_PATH_0/1"
index 8f28029..4933469 100755 (executable)
@@ -218,10 +218,10 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
     a1pms_equal json:policy-types 3 120
-    a1pms_api_post_policy_v3 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
-    a1pms_api_post_policy_v3 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
+    a1pms_api_post_policy_v3 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT testdata/OSC/pi1_template.json
+    a1pms_api_post_policy_v3 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT testdata/STD/pi1_template.json
 
-    a1pms_api_post_policy_v3 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
+    a1pms_api_post_policy_v3 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT testdata/STD2/pi_qos2_template.json
 
   else
     a1pms_equal json:policy-types 3 120
@@ -238,10 +238,9 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   sim_equal ricsim_g2_1 num_instances 1
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_api_post_policy_v3 201 "service10" ricsim_g1_1 1 5001 true $notificationurl testdata/OSC/pi1_template.json
-    a1pms_api_post_policy_v3 201 "service10" ricsim_g2_1 NOTYPE 5101 true $notificationurl testdata/STD/pi1_template.json
-
-    a1pms_api_post_policy_v3 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5201 true $notificationurl testdata/STD2/pi_qos2_template.json
+    a1pms_api_post_policy_v3 201 "service10" ricsim_g1_1 1 5001 true testdata/OSC/pi1_template.json
+    a1pms_api_post_policy_v3 201 "service10" ricsim_g2_1 NOTYPE 5101 true testdata/STD/pi1_template.json
+    a1pms_api_post_policy_v3 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5201 true testdata/STD2/pi_qos2_template.json
   else
     a1pms_api_put_policy 201 "service10" ricsim_g1_1 1 5001 true $notificationurl testdata/OSC/pi1_template.json
     a1pms_api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5101 true $notificationurl testdata/STD/pi1_template.json
@@ -295,12 +294,12 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
     if [ "$A1PMS_VERSION" == "V3" ]; then
       a1pms_api_put_service 201 "service-1" 0 "$CR_SERVICE_APP_PATH_0/service-1"
       a1pms_api_put_service 201 "service-2" 0 "$CR_SERVICE_APP_PATH_0/service-2"
-      a1pms_api_post_policy_v3 201 "service-1" ricsim_g1_1 1 5001 true $notificationurl testdata/OSC/pi1_template.json
-      a1pms_api_post_policy_v3 201 "service-1" ricsim_g1_1 1 5002 false $notificationurl testdata/OSC/pi1_template.json
-      a1pms_api_post_policy_v3 201 "service-2" ricsim_g1_1 1 6001 true $notificationurl testdata/OSC/pi1_template.json
-      a1pms_api_post_policy_v3 201 "service-2" ricsim_g1_1 1 6002 false $notificationurl testdata/OSC/pi1_template.json
-      a1pms_api_post_policy_v3 201 " " ricsim_g1_1 1 5003 true $notificationurl testdata/OSC/pi1_template.json
-      a1pms_api_post_policy_v3 201 " " ricsim_g1_1 1 6003 false $notificationurl testdata/OSC/pi1_template.json
+      a1pms_api_post_policy_v3 201 "service-1" ricsim_g1_1 1 5001 true testdata/OSC/pi1_template.json
+      a1pms_api_post_policy_v3 201 "service-1" ricsim_g1_1 1 5002 false testdata/OSC/pi1_template.json
+      a1pms_api_post_policy_v3 201 "service-2" ricsim_g1_1 1 6001 true testdata/OSC/pi1_template.json
+      a1pms_api_post_policy_v3 201 "service-2" ricsim_g1_1 1 6002 false testdata/OSC/pi1_template.json
+      a1pms_api_post_policy_v3 201 " " ricsim_g1_1 1 5003 true testdata/OSC/pi1_template.json
+      a1pms_api_post_policy_v3 201 " " ricsim_g1_1 1 6003 false testdata/OSC/pi1_template.json
       a1pms_equal json:policies 6 120
       a1pms_api_get_services 200 "service-1" "service-1" 0 "$CR_SERVICE_APP_PATH_0/service-1"
       a1pms_api_get_services 200 "service-2" "service-2" 0 "$CR_SERVICE_APP_PATH_0/service-2"
index 0feecbb..fb18e8d 100755 (executable)
@@ -178,9 +178,9 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   do
       sim_generate_policy_uuid
       if [ "$A1PMS_VERSION" == "V3" ]; then
-        a1pms_api_post_policy_v3 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g3_"$i STD_QOS_0_2_0 $((2300+$i)) NOTRANSIENT $notificationurl demo-testdata/STD2/pi1_template.json 1
+        a1pms_api_post_policy_v3 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g3_"$i STD_QOS_0_2_0 $((2300+$i)) NOTRANSIENT demo-testdata/STD2/pi1_template.json 1
         sim_generate_policy_uuid
-        a1pms_api_post_policy_v3 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g3_"$i 'STD_QOS2_0.1.0' $((2400+$i)) NOTRANSIENT $notificationurl demo-testdata/STD2/pi1_template.json 1
+        a1pms_api_post_policy_v3 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g3_"$i 'STD_QOS2_0.1.0' $((2400+$i)) NOTRANSIENT demo-testdata/STD2/pi1_template.json 1
       else
         a1pms_api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g3_"$i STD_QOS_0_2_0 $((2300+$i)) NOTRANSIENT $notificationurl demo-testdata/STD2/pi1_template.json 1
         sim_generate_policy_uuid
index 141650d..8762080 100755 (executable)
@@ -196,7 +196,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
             start_timer "Create $((NUM_POLICIES_PER_RIC*$NUM_RICS)) polices over $interface using $__httpx and V$version policymanagementservice"
 
             if [ "$A1PMS_VERSION" == "V3" ]; then
-              a1pms_api_post_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES_PER_RIC 7
+              a1pms_api_post_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $START_ID NOTRANSIENT testdata/OSC/pi1_template.json $NUM_POLICIES_PER_RIC 7
             else
               a1pms_api_put_policy_parallel 201 "serv1" ricsim_g1_ $NUM_RICS 1 $START_ID NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json $NUM_POLICIES_PER_RIC 7
             fi
index feb30d4..4c61af1 100644 (file)
@@ -1114,8 +1114,8 @@ a1pms_api_put_policy_v3() {
 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>]" $@
+  if [ $# -lt 7 ] || [ $# -gt 8 ]; then
+    __print_err "<response-code> <service-name> <ric-id> <policytype-id>|NOTYPE <policy-id> <transient>|NOTRANSIENT  <template-file> [<count>]" $@
     return 1
   fi
 
@@ -1126,10 +1126,9 @@ a1pms_api_post_policy_v3() {
   pt=$4
   pid=$5
   trans=$6
-  noti=$7
-  temp=$8
-  if [ $# -eq 9 ]; then
-    max=$9
+  temp=$7
+  if [ $# -eq 8 ]; then
+    max=$8
   fi
 
   while [ $count -lt $max ]; do
@@ -1144,9 +1143,6 @@ a1pms_api_post_policy_v3() {
     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
@@ -1415,7 +1411,7 @@ a1pms_api_put_policy_parallel() {
 a1pms_api_post_policy_parallel() {
   __log_test_start $@
 
-  if [ $# -ne 11 ]; then
+  if [ $# -ne 10 ]; then
     __print_err "These all arguments needed <response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <notification-url>|NOURL <template-file> <count-per-ric> <number-of-threads>" $@
     return 1
   fi
@@ -1434,8 +1430,6 @@ a1pms_api_post_policy_parallel() {
   shift
   transient=$1
   shift
-  noti=$1
-  shift
   template=$1
   shift
   count=$1
@@ -1467,7 +1461,7 @@ a1pms_api_post_policy_parallel() {
       uuid="NOUUID"
     fi
     echo "" >"./tmp/.pid${i}.res.txt"
-    echo $resp_code $urlbase $ric_base $num_rics $uuid $start_id $serv $type $transient $noti $template $count $pids $i $httpproxy >"./tmp/.pid${i}.txt"
+    echo $resp_code $urlbase $ric_base $num_rics $uuid $start_id $serv $type $transient "noValue" $template $count $pids $i $httpproxy >"./tmp/.pid${i}.txt"
     echo $i
   done | xargs -n 1 -I{} -P $pids bash -c '{
                arg=$(echo {})
index bc9329e..494cd32 100644 (file)
@@ -138,8 +138,6 @@ try:
                                 data["policyTypeId"]=pt
                             else:
                                 data["policyTypeId"]=""
-                            if (noti != "NOURL"):
-                                data["statusNotificationUri"]=noti
                             data["policyObject"]=json.loads(payload)
 
                             url_out=url