diff --git a/SOL002/VNFConfiguration-API/ApiVersion.robot b/SOL002/VNFConfiguration-API/ApiVersion.robot index 81c0badd8664475735d5735413280230897eb79d..751a1c7f8684a938123bb34d0d562b64203fa682 100644 --- a/SOL002/VNFConfiguration-API/ApiVersion.robot +++ b/SOL002/VNFConfiguration-API/ApiVersion.robot @@ -1,7 +1,5 @@ *** Settings *** -Resource environment/configuration.txt Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +197,15 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL002/VNFFaultManagement-API/ApiVersion.robot b/SOL002/VNFFaultManagement-API/ApiVersion.robot index b7213fc3fa3c630e9f9bdceba55c90765630aff7..5bb7c0824d1ec025d9b47ef2ce732562cc183c78 100644 --- a/SOL002/VNFFaultManagement-API/ApiVersion.robot +++ b/SOL002/VNFFaultManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +199,15 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL002/VNFIndicator-API/ApiVersion.robot b/SOL002/VNFIndicator-API/ApiVersion.robot index 5a2fc9a604aa176adca6ff35816e2b0ca198f07a..ad11275151c3b92eafb4e67dfd0ae4896ac074b4 100644 --- a/SOL002/VNFIndicator-API/ApiVersion.robot +++ b/SOL002/VNFIndicator-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +132,82 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL002/VNFIndicator-API/environment/variables.txt b/SOL002/VNFIndicator-API/environment/variables.txt index 8c323fcab26fba81c930037c0ddcdb32ff039333..58dff1e612c0bc623913e0dee9f69dea4b414152 100644 --- a/SOL002/VNFIndicator-API/environment/variables.txt +++ b/SOL002/VNFIndicator-API/environment/variables.txt @@ -22,4 +22,6 @@ ${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies. ${callback_uri} http://localhost ${callback_port} 9091 ${callback_endpoint} /endpoint -${callback_endpoint_error} /endpoint_404 \ No newline at end of file +${callback_endpoint_error} /endpoint_404 + +${response} some_response_object \ No newline at end of file diff --git a/SOL002/VNFLifecycleManagement-API/ApiVersion.robot b/SOL002/VNFLifecycleManagement-API/ApiVersion.robot index d9c2a3f6d5f678268edcbfb7307a72031136aab4..7dba9a4348715644ec25c301ae5a0402ce87f50f 100644 --- a/SOL002/VNFLifecycleManagement-API/ApiVersion.robot +++ b/SOL002/VNFLifecycleManagement-API/ApiVersion.robot @@ -1,7 +1,5 @@ *** Settings *** -Resource environment/configuration.txt Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +197,15 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL002/VNFLifecycleManagement-API/environment/variables.txt b/SOL002/VNFLifecycleManagement-API/environment/variables.txt index 9e28c8cfcfbd7d1a091347dfeba169726ad5b702..af716e9c41b6901ab91a74617d4335608c927e7d 100644 --- a/SOL002/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL002/VNFLifecycleManagement-API/environment/variables.txt @@ -57,3 +57,6 @@ ${response}= httpresponse ${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +${fields} + +${original_etag} some_etag \ No newline at end of file diff --git a/SOL002/VNFPerformanceManagement-API/ApiVersion.robot b/SOL002/VNFPerformanceManagement-API/ApiVersion.robot index 5a2fc9a604aa176adca6ff35816e2b0ca198f07a..b327c9832ab42e63a42cb6612094cbd62d735ef7 100644 --- a/SOL002/VNFPerformanceManagement-API/ApiVersion.robot +++ b/SOL002/VNFPerformanceManagement-API/ApiVersion.robot @@ -1,7 +1,5 @@ *** Settings *** -Resource environment/configuration.txt Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +130,82 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL002/VNFPerformanceManagement-API/environment/variables.txt b/SOL002/VNFPerformanceManagement-API/environment/variables.txt index 1dc3cec25cdb03376f86d2ed8d7f11deff8e55dd..1b6fb6dbc341eed0b9e5665f7e3a669ecdb26735 100644 --- a/SOL002/VNFPerformanceManagement-API/environment/variables.txt +++ b/SOL002/VNFPerformanceManagement-API/environment/variables.txt @@ -21,4 +21,6 @@ ${callback_port} 9091 ${callback_endpoint} /endpoint ${callback_endpoint_error} /endpoint_404 ${sleep_interval} 20s -${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar \ No newline at end of file +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +${response} http-response \ No newline at end of file diff --git a/SOL003/VNFFaultManagement-API/ApiVersion.robot b/SOL003/VNFFaultManagement-API/ApiVersion.robot index 8a663cbfc95028fd88b7d3ea4d1e87d017d13659..dca778a7b78dede2e01c4c40547404f4101b8685 100644 --- a/SOL003/VNFFaultManagement-API/ApiVersion.robot +++ b/SOL003/VNFFaultManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +199,15 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL003/VNFIndicator-API/ApiVersion.robot b/SOL003/VNFIndicator-API/ApiVersion.robot index d016b422b9938c3a2c7f642028efef275f429bd5..5b9235d1165170f823b66c4f6fb9078e7f7b4c2a 100644 --- a/SOL003/VNFIndicator-API/ApiVersion.robot +++ b/SOL003/VNFIndicator-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +132,82 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ApiVersion.robot b/SOL003/VNFLifecycleManagement-API/ApiVersion.robot index d690c76b5205295f847586d83aaf78fd5b7fc537..899970b0cdf6fe70501a58b5c9045b87b737ea95 100644 --- a/SOL003/VNFLifecycleManagement-API/ApiVersion.robot +++ b/SOL003/VNFLifecycleManagement-API/ApiVersion.robot @@ -1,7 +1,6 @@ *** Settings *** Resource environment/configuration.txt Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +198,16 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/ApiVersion.robot b/SOL003/VNFLifecycleOperationGranting-API/ApiVersion.robot index 787e50d611bea2f87b7b1ed06f054191bbd0d345..8de99a77038bf3143e60b8099846b1ea57dccd4d 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/ApiVersion.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +199,15 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt index cc67ab3bd1dcceef72023cfb4b3db8684b67fe03..cfb4467269e5d363d2cbd00279419d2c84d27c0b 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt +++ b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt @@ -17,7 +17,7 @@ ${SYNC_MODE} 1 - +${response} diff --git a/SOL003/VNFPackageManagement-API/ApiVersion.robot b/SOL003/VNFPackageManagement-API/ApiVersion.robot index ef90e870a105c115933aecd66586cb3e37cac6f8..b77c806271f1af825bc1d1b4006fc4e8cbfcdd3e 100644 --- a/SOL003/VNFPackageManagement-API/ApiVersion.robot +++ b/SOL003/VNFPackageManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +132,83 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index 032e40a23b80e33c8fc1b712a189164365a1b2e8..88b30f3670b17e4fe58268564ed53445686350ce 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -1063,38 +1063,6 @@ GET Content for OnBoarded VNF Package in onboarding state different from ONBOARD ${output}= Output response Set Suite Variable ${response} ${output} -Send POST Request for individual OnBoarded VNF Package - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId} - ${output}= Output response - Set Suite Variable ${response} ${output} - -Send PUT Request for individual OnBoarded VNF Package - Log Trying to perform a PUT (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId} - ${output}= Output response - Set Suite Variable ${response} ${output} - -Send PATCH Request for individual OnBoarded VNF Package - Log Trying to perform a PATCH (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId} - ${output}= Output response - Set Suite Variable ${response} ${output} - -Send DELETE Request for individual OnBoarded VNF Package - Log Trying to perform a DELETE (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId} - ${output}= Output response - Set Suite Variable ${response} ${output} - GET Individual OnBoarded VNF Package Artifact Log Trying to get a VNF Package Artifact Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} diff --git a/SOL003/VNFPerformanceManagement-API/ApiVersion.robot b/SOL003/VNFPerformanceManagement-API/ApiVersion.robot index 96a8f0b6a6c69b0f6ebee5b4089dd2274b1e2ba8..336e713b9455892378e4229f243f1b2ad51d4b8d 100644 --- a/SOL003/VNFPerformanceManagement-API/ApiVersion.robot +++ b/SOL003/VNFPerformanceManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +132,83 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagement-API/environment/variables.txt b/SOL003/VNFPerformanceManagement-API/environment/variables.txt index 553e63e5c7b9f80049c65f7ac1c972071ba39983..a2794c30957c4b31d89f61c79ddedf21e5b2542e 100644 --- a/SOL003/VNFPerformanceManagement-API/environment/variables.txt +++ b/SOL003/VNFPerformanceManagement-API/environment/variables.txt @@ -28,4 +28,6 @@ ${sleep_interval} 20s ${total_polling_time} 2 min ${polling_interval} 10 sec -${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar \ No newline at end of file +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +${response} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/ApiVersion.robot b/SOL005/NSDManagement-API/ApiVersion.robot index 26f4333b51ec4a41a5d109828af5f46e5405b95d..1245456ba81b57410a5a323cd40276e324e316f8 100644 --- a/SOL005/NSDManagement-API/ApiVersion.robot +++ b/SOL005/NSDManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +132,82 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL005/NSFaultManagement-API/ApiVersion.robot b/SOL005/NSFaultManagement-API/ApiVersion.robot index bd9b1c73c2132efee7c6caf41896fe1a8cc70a84..ca4e9dca1a6293a2b32a464259e5c9841f7490b1 100644 --- a/SOL005/NSFaultManagement-API/ApiVersion.robot +++ b/SOL005/NSFaultManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +199,15 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/ApiVersion.robot b/SOL005/NSLifecycleManagement-API/ApiVersion.robot index 3d591aa707f99b80a2baaeef50ba1634baf1c65b..4774f330c78dfea9f991d0c2c6dd336c1d04ac0c 100644 --- a/SOL005/NSLifecycleManagement-API/ApiVersion.robot +++ b/SOL005/NSLifecycleManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -199,4 +199,15 @@ DELETE API Version with apiMajorVersion Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL005/NSPerformanceManagement-API/ApiVersion.robot b/SOL005/NSPerformanceManagement-API/ApiVersion.robot index 5668679c53093732522bb2b59111e63d2e7e0fa2..c50df596761e1385105e76b67cdb896e73bf6d8a 100644 --- a/SOL005/NSPerformanceManagement-API/ApiVersion.robot +++ b/SOL005/NSPerformanceManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +132,82 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/ApiVersion.robot b/SOL005/VNFPackageManagement-API/ApiVersion.robot index d058e8a5b5aa81ab8075b4693935b7d345572a08..2ab4751e7928ec2b03ca9d66809e7f1bcc082510 100644 --- a/SOL005/VNFPackageManagement-API/ApiVersion.robot +++ b/SOL005/VNFPackageManagement-API/ApiVersion.robot @@ -1,7 +1,7 @@ *** Settings *** -Resource environment/configuration.txt + Resource environment/variables.txt -Resource VnfLcmOperationKeywords.robot + Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} Library DependencyLibrary Library JSONLibrary @@ -132,71 +132,82 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Put ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Delete ${apiRoot}/${apiName}/v1/api_version ${outputResponse}= Output response - Set Global Variable @{response} ${outputResponse} \ No newline at end of file + Set Global Variable @{response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK \ No newline at end of file