X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fcommon%2Fa1pms_api_functions.sh;h=5fb6e256e83f6125ae7e884eb0c1f9aa34f7ef23;hb=85d61ba735e5c00a377361b6d57081a4279f2dde;hp=ceef204eee17cb295a9fa4a19e1e781bb323d3e7;hpb=64755e08adfe535b5a52f6164f5ef8f0d5432323;p=nonrtric.git diff --git a/test/common/a1pms_api_functions.sh b/test/common/a1pms_api_functions.sh index ceef204e..5fb6e256 100644 --- a/test/common/a1pms_api_functions.sh +++ b/test/common/a1pms_api_functions.sh @@ -1594,7 +1594,7 @@ a1pms_api_update_policy_parallel() { return 1 } -# API Test function: DELETE /policy and V2 DELETE /v2/policies/{policy_id} +# API Test function: DELETE /policy, V2 DELETE /v2/policies/{policy_id} and V3 DELETE a1policymanagement/v1/policies/{policy_id} # args: [count] # (Function for test scripts) a1pms_api_delete_policy() { @@ -2823,7 +2823,7 @@ a1pms_api_get_rics() { #### API Test case functions Service registry and supervision #### ################################################################## -# API test function: PUT /service and V2 PUT /service +# API test function: PUT /service, V2 PUT /service and V3 PUT a1policymanagement/v1/services # args: # (Function for test scripts) a1pms_api_put_service() { @@ -3019,7 +3019,7 @@ a1pms_api_get_service_ids() { return 0 } -# API test function: DELETE /services and V2 DELETE /v2/services/{serviceId} +# API test function: DELETE /services, V2 DELETE /v2/services/{serviceId} and V3 DELETE a1policymanagement/v1/services/{serviceId} # args: # (Function for test scripts) a1pms_api_delete_services() { @@ -3051,7 +3051,7 @@ a1pms_api_delete_services() { return 0 } -# API test function: PUT /services/keepalive and V2 PUT /v2/services/{service_id}/keepalive +# API test function: PUT /services/keepalive, V2 PUT /v2/services/{service_id}/keepalive and V3 DELETE a1policymanagement/v1/services/{serviceId} # args: # (Function for test scripts) a1pms_api_put_services_keepalive() { @@ -3063,19 +3063,26 @@ a1pms_api_put_services_keepalive() { fi if [ "$A1PMS_VERSION" == "V2" ]; then query="/v2/services/$2/keepalive" + elif [ "$A1PMS_VERSION" == "V3" ]; then + query="/v1/services/$2/keepalive" else query="/services/keepalive?name="$2 fi - res="$(__do_curl_to_api A1PMS PUT $query)" + if [ "$A1PMS_VERSION" == "V3" ]; then + empty_json_body={} + res="$(__do_curl_to_api A1PMS PUT ${query} ${empty_json_body})" + else + res="$(__do_curl_to_api A1PMS PUT ${query})" + fi status=${res:${#res}-3} if [ $status -ne $1 ]; then - __log_test_fail_status_code $1 $status + __log_test_fail_status_code ${1} ${status} return 1 fi - __collect_endpoint_stats "A1PMS" 16 "PUT" $A1PMS_API_PREFIX"/v2/services/{service_id}/keepalive" $status + __collect_endpoint_stats "A1PMS" 16 "PUT" ${A1PMS_API_PREFIX}${query} ${status} __log_test_pass return 0 } @@ -3084,7 +3091,7 @@ a1pms_api_put_services_keepalive() { #### API Test case functions Configuration #### ################################################################## -# API Test function: PUT "/v2/configuration" or "/v1/configuration" +# API Test function: PUT "/v2/configuration" or V3 PUT "a1policymanagement/v1/configuration" # args: # (Function for test scripts) a1pms_api_put_configuration() { @@ -3128,7 +3135,7 @@ a1pms_api_put_configuration() { return 0 } -# API Test function: GET /v2/configuration +# API Test function: GET /v2/configuration and V3 GET a1policymanagement/v1/configuration # args: [] # (Function for test scripts) a1pms_api_get_configuration() {