From: raviteja.karumuri Date: Thu, 25 Jul 2024 15:58:24 +0000 (+0100) Subject: Updating FTC to support Nov Edition URI endpoint changes X-Git-Tag: l-release~14 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=a02383e99403137a110d087eee74c683cc1a1cca;p=nonrtric.git Updating FTC to support Nov Edition URI endpoint changes Issue-ID: NONRTRIC-1023 Change-Id: I1837fc64d1c5a8e40416548d0dce55ba98ee396a Signed-off-by: Raviteja Karumuri --- diff --git a/test/auto-test/FTC1.sh b/test/auto-test/FTC1.sh index b85d7a2d..cabd9b78 100755 --- a/test/auto-test/FTC1.sh +++ b/test/auto-test/FTC1.sh @@ -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 diff --git a/test/auto-test/FTC10.sh b/test/auto-test/FTC10.sh index b56cfcf3..effa68e0 100755 --- a/test/auto-test/FTC10.sh +++ b/test/auto-test/FTC10.sh @@ -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 diff --git a/test/auto-test/FTC100.sh b/test/auto-test/FTC100.sh index 727276d5..f910d589 100755 --- a/test/auto-test/FTC100.sh +++ b/test/auto-test/FTC100.sh @@ -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 diff --git a/test/auto-test/FTC110.sh b/test/auto-test/FTC110.sh index 099e0a2f..8f28029a 100755 --- a/test/auto-test/FTC110.sh +++ b/test/auto-test/FTC110.sh @@ -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 diff --git a/test/auto-test/FTC2001.sh b/test/auto-test/FTC2001.sh index 47fbe1e6..0feecbba 100755 --- a/test/auto-test/FTC2001.sh +++ b/test/auto-test/FTC2001.sh @@ -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 diff --git a/test/auto-test/FTC850.sh b/test/auto-test/FTC850.sh index f8025e67..141650d9 100755 --- a/test/auto-test/FTC850.sh +++ b/test/auto-test/FTC850.sh @@ -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 diff --git a/test/common/a1pms_api_functions.sh b/test/common/a1pms_api_functions.sh index d635e81b..feb30d40 100644 --- a/test/common/a1pms_api_functions.sh +++ b/test/common/a1pms_api_functions.sh @@ -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: [] # args(V2): [ |NOTYPE |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: [] # args(V2): [] # (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: |NOTYPE |NOTRANSIENT [] # args(V2): |NOTYPE |NOTRANSIENT |NOURL [] # (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: [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: # (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: # (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: |NORIC |NOSERVICE |NOTYPE ([ [] # (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: [|NORIC [|EMPTY []*]] # (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: [] # (V2) args: |NOME | [] # (V2) example of = "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: |NOTYPE [] # example of = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........." # format of ric-info: :: @@ -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: # (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: [ ( ) | (NOSERVICE [ ]* )] # (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: []*" # (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: # (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: # (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: # (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: [] # (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" diff --git a/test/common/create_policies_process.py b/test/common/create_policies_process.py index d81ec746..bc9329eb 100644 --- a/test/common/create_policies_process.py +++ b/test/common/create_policies_process.py @@ -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={}