Updating FTC to support Nov Edition URI endpoint changes 19/13219/7
authorraviteja.karumuri <raviteja.karumuri@est.tech>
Thu, 25 Jul 2024 15:58:24 +0000 (16:58 +0100)
committerRAVITEJA KARUMURI <raviteja.karumuri@est.tech>
Fri, 15 Nov 2024 12:39:18 +0000 (12:39 +0000)
Issue-ID: NONRTRIC-1023
Change-Id: I1837fc64d1c5a8e40416548d0dce55ba98ee396a
Signed-off-by: Raviteja Karumuri <raviteja.karumuri@est.tech>
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 b85d7a2..cabd9b7 100755 (executable)
@@ -204,7 +204,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
           a1pms_equal json:rics 3 300
 
           if [ "$A1PMS_VERSION" == "V3" ]; then
-            a1pms_equal json:policytypes 3 120
+            a1pms_equal json:policy-types 3 120
           else
             a1pms_equal json:policy-types 3 120
             a1pms_equal json:policy-instances 0
index b56cfcf..effa68e 100755 (executable)
@@ -128,7 +128,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
 
   sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_equal json:policytypes 7 300
+    a1pms_equal json:policy-types 7 300
   else
     a1pms_equal json:policy-types 3 300
   fi
index 727276d..f910d58 100755 (executable)
@@ -300,7 +300,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
           if [ "$A1PMS_VERSION" == "V2" ]; then
             a1pms_equal json:policy-types 5 120  #Wait for the a1pms to refresh types from the simulator
           elif [ "$A1PMS_VERSION" == "V3" ]; then
-            a1pms_equal json:policytypes 5 120  #Wait for the a1pms to refresh types from the simulator
+            a1pms_equal json:policy-types 5 120  #Wait for the a1pms to refresh types from the simulator
           fi
 
           a1pms_equal json:policies 0
index 099e0a2..8f28029 100755 (executable)
@@ -217,7 +217,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   notificationurl=$CR_SERVICE_APP_PATH_0"/test"
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    a1pms_equal json:policytypes 3 120
+    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
 
index 47fbe1e..0feecbb 100755 (executable)
@@ -142,7 +142,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   #Check the number of schemas and the individual schemas in STD
   if [ "$A1PMS_VERSION" == "V3" ]; then
     total_policy_type_entries=$((STD_NUM_RICS * total_policy_types))
-    a1pms_equal json:policytypes ${total_policy_type_entries} 120
+    a1pms_equal json:policy-types ${total_policy_type_entries} 120
   else
     a1pms_equal json:policy-types ${total_policy_types} 120
   fi
@@ -150,7 +150,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   for ((i=1; i<=$STD_NUM_RICS; i++))
   do
     if [ "$A1PMS_VERSION" == "V3" ]; then
-      a1pms_equal json:policytypes?nearRtRicId=$RIC_SIM_PREFIX"_g3_"$i ${total_policy_types} 120
+      a1pms_equal json:policy-types?nearRtRicId=$RIC_SIM_PREFIX"_g3_"$i ${total_policy_types} 120
     else
       a1pms_equal json:policy-types?ric_id=$RIC_SIM_PREFIX"_g3_"$i ${total_policy_types} 120
     fi
@@ -166,7 +166,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
   #Check the number of types
   if [ "$A1PMS_VERSION" == "V3" ]; then
     total_policy_type_entries=$((STD_NUM_RICS * total_policy_types))
-    a1pms_equal json:policytypes ${total_policy_type_entries} 300
+    a1pms_equal json:policy-types ${total_policy_type_entries} 300
   else
     a1pms_equal json:policy-types ${total_policy_types} 300
   fi
index f8025e6..141650d 100755 (executable)
@@ -176,7 +176,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
             if [ "$A1PMS_VERSION" == "V2" ]; then
               a1pms_equal json:policy-types 1 300  #Wait for the a1pms to refresh types from the simulator
             elif [ "$A1PMS_VERSION" == "V3" ]; then
-              a1pms_equal json:policytypes 20 300
+              a1pms_equal json:policy-types 20 300
             fi
 
             a1pms_api_put_service 201 "serv1" 600 "$CR_SERVICE_APP_PATH_0/1"
@@ -187,7 +187,7 @@ for version in $(seq 2 $VERSIONS_TO_RUN); do
               if [ "$A1PMS_VERSION" == "V2" ]; then
                 a1pms_equal json:policy-types?ric_id=ricsim_g1_$i 1 120
               elif [ "$A1PMS_VERSION" == "V3" ]; then
-                a1pms_equal json:policytypes?nearRtRicId=ricsim_g1_$i 1 120
+                a1pms_equal json:policy-types?nearRtRicId=ricsim_g1_$i 1 120
               fi
             done
 
index d635e81..feb30d4 100644 (file)
@@ -867,7 +867,7 @@ a1pms_api_get_policies() {
 
 }
 
-# API Test function: GET /policy, V2 GET /v2/policies/{policy_id} and V3 GET a1policymanagement/v1/policies/{policy_id}
+# API Test function: GET /policy, V2 GET /v2/policies/{policy_id} and V3 GET a1-policy-management/v1/policies/{policy_id}
 # args: <response-code>  <policy-id> [<template-file>]
 # args(V2): <response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>|NOTYPE <transient> <notification-url>|NOURL ]
 # (Function for test scripts)
@@ -1060,7 +1060,7 @@ a1pms_api_put_policy() {
   return 0
 }
 
-# API Test function: V3 PUT a1policymanagement/v1/policies
+# API Test function: V3 PUT a1-policy-management/v1/policies
 # args: <response-code>  <policy-id>  <template-file> [<count>]
 # args(V2): <response-code> <policy-id> <template-file> [<count>]
 # (Function for test scripts)
@@ -1107,7 +1107,7 @@ a1pms_api_put_policy_v3() {
   return 0
 }
 
-# API Test function: V£ POST a1policymanagement/v1/policies
+# API Test function: V3 POST a1-policy-management/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)
@@ -1596,7 +1596,7 @@ a1pms_api_update_policy_parallel() {
   return 1
 }
 
-# API Test function: DELETE /policy, V2 DELETE /v2/policies/{policy_id} and V3 DELETE a1policymanagement/v1/policies/{policy_id}
+# API Test function: DELETE /policy, V2 DELETE /v2/policies/{policy_id} and V3 DELETE a1-policy-management/v1/policies/{policy_id}
 # args: <response-code> <policy-id> [count]
 # (Function for test scripts)
 a1pms_api_delete_policy() {
@@ -1794,7 +1794,7 @@ a1pms_api_delete_policy_parallel() {
   return 1
 }
 
-# API Test function: V3 DELETE a1policymanagement/v1/policies/{policy_id}, to run in i parallel for a number of rics
+# API Test function: V3 DELETE a1-policy-management/v1/policies/{policy_id}, to run in i parallel for a number of rics
 # args: <responseCode> <numberOfRics> <PolicyIdsFilePath> <countPerRic> <numberOfThreads>
 # (Function for test scripts)
 a1pms_api_delete_policy_parallel_v3() {
@@ -1951,7 +1951,7 @@ a1pms_api_get_policy_parallel() {
   return 1
 }
 
-# API Test function: V3 GET a1policymanagement/v1/policies/{policy_id}, to run in i parallel for a number of rics
+# API Test function: V3 GET a1-policy-management/v1/policies/{policy_id}, to run in i parallel for a number of rics
 # args: <response-code> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>
 # (Function for test scripts)
 a1pms_api_get_policy_parallel_v3() {
@@ -2121,7 +2121,7 @@ a1pms_api_get_policy_ids() {
   return 0
 }
 
-# API Test function: V3 GET a1policymanagement/v1/policies
+# API Test function: V3 GET a1-policy-management/v1/policies
 # args: <response-code> <ric-id>|NORIC <service-id>|NOSERVICE <type-id>|NOTYPE ([<policy-instance-id]*|NOID)
 # (Function for test scripts)
 a1pms_api_get_all_policies_v3() {
@@ -2192,7 +2192,7 @@ a1pms_api_get_all_policies_v3() {
   return 0
 }
 
-# API Test function: V2 GET a1-policy/v2/policy-types/{policyTypeId} and V3 GET a1policymanagement/v1/policytypes/{policyTypeId}
+# API Test function: V2 GET a1-policy/v2/policy-types/{policyTypeId} and V3 GET a1-policy-management/v1/policy-types/{policyTypeId}
 # args(V2): <response-code> <policy-type-id> [<schema-file>]
 # (Function for test scripts)
 a1pms_api_get_policy_type() {
@@ -2211,7 +2211,7 @@ a1pms_api_get_policy_type() {
     query="/v2/policy-types/$2"
   fi
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    query="/v1/policytypes/$2"
+    query="/v1/policy-types/$2"
   fi
 
   res="$(__do_curl_to_api A1PMS GET $query)"
@@ -2508,7 +2508,7 @@ a1pms_api_get_policy_types() {
   return 0
 }
 
-# API Test function:  V3 GET a1policymanagement/v1/policytypes
+# API Test function:  V3 GET a1-policy-management/v1/policy-types
 # args: <response-code> [<ric-id>|NORIC [<policy-type-id>|EMPTY [<policy-type-id>]*]]
 # (Function for test scripts)
 a1pms_api_get_policy_types_v3() {
@@ -2520,11 +2520,11 @@ a1pms_api_get_policy_types_v3() {
   fi
 
   if [ $# -eq 1 ]; then
-    query="/v1/policytypes"
+    query="/v1/policy-types"
   elif [ $2 == "NORIC" ]; then
-    query="/v1/policytypes"
+    query="/v1/policy-types"
   else
-    query="/v1/policytypes?nearRtRicId=$2"
+    query="/v1/policy-types?nearRtRicId=$2"
   fi
   res="$(__do_curl_to_api A1PMS GET $query)"
   status=${res:${#res}-3}
@@ -2632,7 +2632,7 @@ a1pms_api_get_status_root() {
 #### Test case functions RIC Repository
 #########################################################
 
-# API Test function: GET /ric, V2 GET /v2/rics/ric, and V3 GET a1policymanagement/v1/rics/ric
+# API Test function: GET /ric, V2 GET /v2/rics/ric, and V3 GET a1-policy-management/v1/rics/ric
 # args: <reponse-code> <management-element-id> [<ric-id>]
 # (V2) args: <reponse-code> <management-element-id>|NOME <ric-id>|<NORIC> [<string-of-ricinfo>]
 # (V2) example of <string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4"
@@ -2758,7 +2758,7 @@ a1pms_api_get_ric() {
   return 0
 }
 
-# API test function: GET /rics, V2 GET /v2/rics, and V3 GET /a1policymanagement/v1/rics
+# API test function: GET /rics, V2 GET /v2/rics, and V3 GET /a1-policy-management/v1/rics
 # args: <reponse-code> <policy-type-id>|NOTYPE [<space-separate-string-of-ricinfo>]
 # example of <space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."
 # format of ric-info:  <ric-id>:<list-of-mes>:<list-of-policy-type-ids>
@@ -2825,7 +2825,7 @@ a1pms_api_get_rics() {
 #### API Test case functions Service registry and supervision ####
 ##################################################################
 
-# API test function: PUT /service, V2 PUT /service and V3 PUT a1policymanagement/v1/services
+# API test function: PUT /service, V2 PUT /service and V3 PUT a1-policy-management/v1/services
 # args: <response-code>  <service-name> <keepalive-timeout> <callbackurl>
 # (Function for test scripts)
 a1pms_api_put_service() {
@@ -2861,7 +2861,7 @@ a1pms_api_put_service() {
   return 0
 }
 
-# API test function: GET /services, V2 GET /v2/services and V3 /a1policymanagement/v1/services
+# API test function: GET /services, V2 GET /v2/services and V3 /a1-policy-management/v1/services
 #args: <response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) | (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]
 # (Function for test scripts)
 a1pms_api_get_services() {
@@ -2959,7 +2959,7 @@ a1pms_api_get_services() {
   return 0
 }
 
-# API test function: GET /services, V2 GET /v2/services and V3 /a1policymanagement/v1/services -  (only checking service names)
+# API test function: GET /services, V2 GET /v2/services and V3 /a1-policy-management/v1/services -  (only checking service names)
 # args: <response-code> [<service-name>]*"
 # (Function for test scripts)
 a1pms_api_get_service_ids() {
@@ -3021,7 +3021,7 @@ a1pms_api_get_service_ids() {
   return 0
 }
 
-# API test function: DELETE /services, V2 DELETE /v2/services/{serviceId} and V3 DELETE a1policymanagement/v1/services/{serviceId}
+# API test function: DELETE /services, V2 DELETE /v2/services/{serviceId} and V3 DELETE a1-policy-management/v1/services/{serviceId}
 # args: <response-code> <service-name>
 # (Function for test scripts)
 a1pms_api_delete_services() {
@@ -3053,7 +3053,7 @@ a1pms_api_delete_services() {
   return 0
 }
 
-# API test function: PUT /services/keepalive, V2 PUT /v2/services/{service_id}/keepalive and V3 DELETE a1policymanagement/v1/services/{serviceId}
+# API test function: PUT /services/keepalive, V2 PUT /v2/services/{service_id}/keepalive and V3 DELETE a1-policy-management/v1/services/{serviceId}
 # args: <response-code> <service-name>
 # (Function for test scripts)
 a1pms_api_put_services_keepalive() {
@@ -3093,7 +3093,7 @@ a1pms_api_put_services_keepalive() {
 #### API Test case functions Configuration                    ####
 ##################################################################
 
-# API Test function: PUT "/v2/configuration" or V3 PUT "a1policymanagement/v1/configuration"
+# API Test function: PUT "/v2/configuration" or V3 PUT "a1-policy-management/v1/configuration"
 # args: <response-code> <config-file>
 # (Function for test scripts)
 a1pms_api_put_configuration() {
@@ -3121,7 +3121,7 @@ a1pms_api_put_configuration() {
   if [ "$A1PMS_VERSION" == "V2" ]; then
     query="/v2/configuration"
   elif [ "$A1PMS_VERSION" == "V3" ]; then
-    #V3 has baseurl changes 'a1-policy/v2' to 'a1policymanagement/v1'
+    #V3 has baseurl changes 'a1-policy/v2' to 'a1-policy-management/v1'
     query="/v1/configuration"
   fi
   res="$(__do_curl_to_api A1PMS PUT $query $file)"
@@ -3137,7 +3137,7 @@ a1pms_api_put_configuration() {
   return 0
 }
 
-# API Test function: GET /v2/configuration and V3 GET a1policymanagement/v1/configuration
+# API Test function: GET /v2/configuration and V3 GET a1-policy-management/v1/configuration
 # args: <response-code> [<config-file>]
 # (Function for test scripts)
 a1pms_api_get_configuration() {
@@ -3158,7 +3158,7 @@ a1pms_api_get_configuration() {
   fi
 
   if [ "$A1PMS_VERSION" == "V3" ]; then
-    #The V3 of a1-pms URL is a1policymanagement/v1 and the v2 is a1-policy/v2
+    #The V3 of a1-pms URL is a1-policy-management/v1 and the v2 is a1-policy/v2
     query="/v1/configuration"
   else
     query="/v2/configuration"
index d81ec74..bc9329e 100644 (file)
@@ -47,7 +47,8 @@ try:
     uuid=str(sys.argv[5])
     start=int(sys.argv[6])
     httpproxy="NOPROXY"
-    if ("/v2/" in baseurl) or ("a1policymanagement/v1/" in baseurl):
+    api_prefix_v3=os.getenv('A1PMS_API_PREFIX_V3', '')
+    if ("/v2/" in baseurl) or (api_prefix_v3 + "/v1/" in baseurl):
         if len(sys.argv) != 16:
             print("1Expected 15 args, got "+str(len(sys.argv)-1)+ ". Args: responsecode baseurl ric_base num_rics uuid startid service type transient notification-url templatepath count pids pid_id proxy")
             print (sys.argv[1:])
@@ -125,7 +126,7 @@ try:
                             else:
                                 resp=requests.put(url, data_out, headers=headers, verify=False, timeout=90, proxies=proxydict)
 
-                        elif ("a1policymanagement/v1/" in baseurl):
+                        elif (api_prefix_v3 + '/v1' in baseurl):
                             url=baseurl
 
                             data={}