diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index a6411336e478f62ca92cf9918459f5daee0f382a..103ecbd6fecc7320d14b6fbba7cfb272213d9616 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -139,7 +139,7 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${schema} - Should Contain ${response[0]['headers']['Content-Type']} ${CONTENT_TYPE} + Should Contain ${response[0]['headers']['Content-Type']} application/json Validate Json ${schema} ${response[0]['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFIndicator-API/IndividualSubscription.robot b/SOL002/VNFIndicator-API/IndividualSubscription.robot index 58a3c927ab29374aff1c04c5cc0e0ab7ee970589..1d7fd9b3d07da8cbc892ade60fd339c6f7a94117 100644 --- a/SOL002/VNFIndicator-API/IndividualSubscription.robot +++ b/SOL002/VNFIndicator-API/IndividualSubscription.robot @@ -6,76 +6,189 @@ Library OperatingSystem Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} *** Test Cases *** -GET Individual Subscription +GET Individual VNF Indicator Subscription + [Documentation] Test ID: 6.3.2.5.1 + ... Test title: Get individual subscription to VNF performance indicators + ... Test objective: The objective is to test the retrieval of individual VNF performance indicator subscription and perform a JSON schema validation of the returned subscription data structure + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.6.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get Individual VNF Indicator Subscription + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is VnfIndicatorSubscription + +GET Individual VNF Indicator Subscription with invalid resource identifier + [Documentation] Test ID: 6.3.2.5.2 + ... Test title: Get individual subscription to VNF performance indicators + ... Test objective: The objective is to test that the retrieval of individual VNF performance indicator subscription fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.6.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + GET Individual VNF Indicator Subscription with invalid resource identifier + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +DELETE Individual VNF Indicator Subscription + [Documentation] Test ID: 6.3.2.5.3 + ... Test title: Delete individual subscription to VNF performance indicators + ... Test objective: The objective is to test the deletion of an individual VNF performance indicator subscription. + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.6.3.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: The subscription to VNF performance indicators is deleted + Send Delete Request for Individual VNF Indicator Subscription + Check HTTP Response Status Code Is 204 + Check Postcondition Individual VNF Indicator Subscription is Deleted + +DELETE Individual VNF Indicator Subscription with invalid resource identifier + [Documentation] Test ID: 6.3.2.5.4 + ... Test title: Delete individual subscription to VNF performance indicators + ... Test objective: The objective is to test that the deletion of an individual VNF performance indicator subscription fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.6.3.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +PUT Individual VNF Indicator Subscription - Method not implemented + [Documentation] Test ID 6.3.2.5.5 + ... Test title: PUT individual VNF indicator subscription - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to modify an individual VNF performance indicator subscription + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.5.3.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: The individual VNF indicator subscription is not modified by the operation + Send Put Request for Individual VNF Indicator Subscription + Check HTTP Response Status Code Is 405 + Check Postcondition VNF individual subscription Unmodified (Implicit) + +PATCH Individual VNF Indicator Subscription - Method not implemented + [Documentation] Test ID 6.3.2.5.6 + ... Test title: PUT individual VNF indicator subscription - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to update an individual VNF performance indicator subscription + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.5.3.4 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: The individual VNF indicator subscription is not modified by the operation + Send Patch Request for Individual VNF Indicator Subscription + Check HTTP Response Status Code Is 405 + Check Postcondition VNF individual subscription Unmodified (Implicit) + +POST Individual VNF Indicator Subscription - Method not implemented + [Documentation] Test ID 6.3.2.5.7 + ... Test title: PUT individual VNF indicator subscription - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to modify an individual VNF performance indicator subscription + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.5.3.1 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: The individual VNF indicator subscription is not created by the operation + Send Post Request for Individual VNF Indicator Subscription + Check HTTP Response Status Code Is 405 + Check Postcondition VNF individual subscription is not created + + *** Keywords *** +Get Individual VNF Indicator Subscription Log Trying to get a given subscription identified by subscriptionId Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - Log Trying to validate result with VnfIndicatorSubscription schema - Validate Json VnfIndicatorSubscription.schema.json ${result} - Log Validated VnfIndicatorSubscription schema - -GET Subscription - Negative (Not Found) + ${output}= Output response + Set Suite Variable @{response} ${output} + +GET Individual VNF Indicator Subscription with invalid resource identifier Log Trying to perform a request on a subscriptionID which doesn't exist Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${problemDetails}= Output response body - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -DELETE Subscription + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Delete Request for Individual VNF Indicator Subscription Log Trying to perform a DELETE on a subscriptionId Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 204 - Log Received 204 No Content as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -DELETE Subscription - Negative (Not Found) +Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier Log Trying to perform a DELETE on a subscriptionId which doesn't exist Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Integer response status 404 - Log The subscriptionId is not present in database - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${problemDetails}= Output response body - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -PUT Subscription - (Method not implemented) + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Post Request for Individual VNF Indicator Subscription + Log Trying to create a new subscription + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Put Request for Individual VNF Indicator Subscription Log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${origOutput}= Output response + Set Suite Variable @{origResponse} ${origOutput} PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -PATCH Subscription - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} +Send Patch Request for Individual VNF Indicator Subscription + Log Trying to create a new subscription Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${origOutput}= Output response + Set Suite Variable @{origResponse} ${origOutput} PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -POST Subscription - (Method not implemented) - Log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Integer response status 405 - Log Received 405 Method not implemented as expected +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response[0]['status']} ${status} + Log Status code validated + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Log ${response[0]['headers']} + Should Contain ${response[0]['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${schema} + Should Contain ${response[0]['headers']['Content-Type']} application/json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK + +Check Postcondition Individual VNF Indicator Subscription is Deleted + Log Check Postcondition subscription is deleted + GET Individual VNF Indicator Subscription + Check HTTP Response Status Code Is 404 + +Check Postcondition VNF individual subscription Unmodified (Implicit) + Log Check Postcondition subscription is not modified + GET Individual VNF Indicator Subscription + Log Check Response matches original subscription + ${subscription}= evaluate json.loads('''${response[0]['body']}''') json + Should Be Equal ${origResponse[0]['body']['callbackUri']} ${subscription.callbackUri} + +Check Postcondition VNF individual subscription is not created + Log Check Postcondition subscription is not created + GET Individual VNF Indicator Subscription with invalid resource identifier + Check HTTP Response Status Code Is 404 diff --git a/SOL002/VNFIndicator-API/IndividualVNFindicator.robot b/SOL002/VNFIndicator-API/IndividualVNFindicator.robot index 80dbb91dd6648bc63affa92c7b0afecab1670237..3b372dbb1c352dedf3f28bc9de691bcf73ed504b 100644 --- a/SOL002/VNFIndicator-API/IndividualVNFindicator.robot +++ b/SOL002/VNFIndicator-API/IndividualVNFindicator.robot @@ -82,7 +82,7 @@ DELETE Individual VNF Indicator - Method not implemented Check HTTP Response Status Code Is 405 Check Postcondition Indicator for VNF instance Exist - *** Keywords *** +*** Keywords *** Get Individual Indicator for a VNF instance Log This resource represents a VNF indicator related to a VNF instance. Set Headers {"Accept": "${ACCEPT_JSON}"} diff --git a/SOL002/VNFIndicator-API/Subscriptions.robot b/SOL002/VNFIndicator-API/Subscriptions.robot index e33fa7ebffcf0356b77faa06425716d8954df55e..1255b9071ff9f05c35214d308ffc34b17598b562 100644 --- a/SOL002/VNFIndicator-API/Subscriptions.robot +++ b/SOL002/VNFIndicator-API/Subscriptions.robot @@ -7,96 +7,211 @@ Library JSONLibrary Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} *** Test Cases *** -GET Subscription +GET VNF Indicators Subscriptions + [Documentation] Test ID: 6.3.2.4.1 + ... Test title: Get all subscriptions to VNF performance indicators + ... Test objective: The objective is to test the retrieval of all VNF performance indicators subscriptions and perform a JSON schema validation of the returned subscriptions data structure + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.5.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get VNF Indicators Subscriptions + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is VnfIndicatorSubscriptions + +GET VNF Indicators Subscriptions with attribute-based filter + [Documentation] Test ID: 6.3.2.4.2 + ... Test title: Get all subscriptions to VNF performance indicators with attribute-based filter + ... Test objective: The objective is to test the retrieval of all VNF performance indicators subscriptions using attribute-based filter and perform a JSON schema and content validation of the returned subscriptions data structure + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.5.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get VNF Indicators Subscriptions with filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is VnfIndicatorSubscriptions + Check HTTP Response Body Matches Attribute-Based Filter + +GET VNF Indicators Subscriptions with invalid attribute-based filter + [Documentation] Test ID: 6.3.2.4.3 + ... Test title: Get all subscriptions to VNF performance indicators with invalid attribute-based filter + ... Test objective: The objective is to test that the retrieval of all VNF performance indicators subscriptions fails when using invalid attribute-based filter. The test also checks the JSON schema of the unsuccessful operation HTTP response. + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.5.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get VNF Indicators Subscriptions with invalid filter + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET VNF Indicators Subscriptions with invalid resource endpoint + [Documentation] Test ID 6.3.2.4.4 + ... Test title: Get all subscriptions to VNF performance indicators with invalid resource endpoint + ... Test objective: The objective is to test that the retrieval of all VNF performance indicators subscriptions fails when using invalid resource endpoint. The test also checks the JSON schema of the unsuccessful operation HTTP response. + ... Pre-conditions: A VNF instance is up and running. At least one VNF indicator subscription is available in the VNF. + ... Reference: section 8.4.5.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: none + Get VNF Indicators Subscriptions with invalid resource endpoint + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +POST VNF Indicator Subscription + [Documentation] Test ID 6.3.2.4.5 + ... Test title: Create a new VNF performance indicator subscription + ... Test objective: The objective is to test the creation of a new VNF performance indicator subscription perform a JSON schema and content validation of the returned subscriptions data structure + ... Pre-conditions: A VNF instance is up and running + ... Reference: section 8.4.5.3.1 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: The VNF indicator subscription is successfully set and it matches the issued subscription + Send Post Request for VNF Indicator Subscription + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is VnfIndicatorSubscription + Check HTTP Response Body Matches the Subscription + Check Postcondition VNF Performance Indicator Subscription Is Set + +PUT VNF Indicator Subscriptions - Method not implemented + [Documentation] Test ID 6.3.2.4.6 + ... Test title: PUT VNF indicator subscriptions - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to modify VNF performance indicator subscriptions + ... Pre-conditions: A VNF instance is instantiated. + ... Reference: section 8.4.5.3.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: none + Send Put Request for VNF Indicator Subscriptions + Check HTTP Response Status Code Is 405 + +PATCH VNF Indicator Subscriptions - Method not implemented + [Documentation] Test ID 6.3.2.4.7 + ... Test title: PATCH VNF indicator subscriptions - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to update VNF performance indicator subscriptions + ... Pre-conditions: A VNF instance is instantiated. + ... Reference: section 8.4.5.3.4 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: none + Send Patch Request for VNF Indicator Subscriptions + Check HTTP Response Status Code Is 405 + +DELETE VNF Indicator Subscriptions - Method not implemented + [Documentation] Test ID 6.3.2.4.8 + ... Test title: DELETE VNF indicator subscriptions - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to delete VNF performance indicator subscriptions + ... Pre-conditions: A VNF instance is instantiated. + ... Reference: section 8.4.5.3.5 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: none + Send Delete Request for VNF Indicator Subscriptions + Check HTTP Response Status Code Is 405 + + *** Keywords *** +Get VNF Indicators Subscriptions Log Trying to get the list of subscriptions Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 200 - Log Received a 200 OK as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - Validate Json VnfIndicatorSubscriptions.schema.json ${result} - Log Validated VnfIndicatorSubscription schema - -GET Subscription - Filter + ${output}= Output response + Set Suite Variable @{response} ${output} + +Get VNF Indicators Subscriptions with filter Log Trying to get the list of subscriptions using filters Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Received a 200 OK as expected - ${result}= Output response body - Validate Json VnfIndicatorSubscriptions.schema.json ${result} - Log Validated VnfIndicatorSubscriptions schema - -GET Subscription - Negative Filter + ${output}= Output response + Set Suite Variable @{response} ${output} + +Get VNF Indicators Subscriptions with invalid filter Log Trying to get the list of subscriptions using filters with wrong attribute name Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER} - Integer response status 400 - Log Received a 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -GET Subscription - Negative (Not Found) - Log Trying to perform a request on a Uri which doesn't exist + ${output}= Output response + Set Suite Variable @{response} ${output} + +Get VNF Indicators Subscriptions with invalid resource endpoint + Log Trying to perform a request on a Uri which doesn't exist Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscription - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -POST Subscription + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Post Request for VNF Indicator Subscription Log Trying to create a new subscription Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${body}= Get File jsons/subscriptions.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} - Integer response status 201 - Log Received 201 Created as expected - ${headers}= Output response headers - Should Contain ${headers} Location - Log Response has header Location - ${result}= Output response body - Validate Json VnfIndicatorSubscription.schema.json ${result} - Log Validation of VnfIndicatorSubscription OK - -PUT Subscription - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Put Request for VNF Indicator Subscriptions + Log Trying to create a new subscription + ${body}= Get File jsons/subscriptions.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -PATCH Subscription - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} +Send Patch Request for VNF Indicator Subscriptions + Log Trying to create a new subscription + ${body}= Get File jsons/subscriptions.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -DELETE Subscription - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_JSON}"} +Send Delete Request for VNF Indicator Subscriptions + Log Trying to create a new subscription + ${body}= Get File jsons/subscriptions.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable @{response} ${output} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response[0]['status']} ${status} + Log Status code validated + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Log ${response[0]['headers']} + Should Contain ${response[0]['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${schema} + Should Contain ${response[0]['headers']['Content-Type']} application/json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK + +Check HTTP Response Body Matches the Subscription + Log Check Response matches subscription + ${body}= Get File jsons/subscriptions.json + ${subscription}= evaluate json.loads('''${body}''') json + Should Be Equal ${response[0]['body']['callbackUri']} ${subscription.callbackUri} + +Check Postcondition VNF Performance Indicator Subscription Is Set + Log Check Postcondition subscription exist + Log Trying to get the subscription + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response[0]['body']['id']} + ${output}= Output response + Set Suite Variable @{response} ${output} + Check HTTP Response Status Code Is 200 + +Check HTTP Response Body Matches Attribute-Based Filter + Log Check Response includes VNF Indicators according to filter + #todo diff --git a/SOL002/VNFIndicator-API/environment/individualSubscription.txt b/SOL002/VNFIndicator-API/environment/individualSubscription.txt index 23ed0f47d08c9d255fe751a1ea46b909d80e0e49..3250487a9e94e626c340ef087665f545ad7c251a 100644 --- a/SOL002/VNFIndicator-API/environment/individualSubscription.txt +++ b/SOL002/VNFIndicator-API/environment/individualSubscription.txt @@ -1,3 +1,5 @@ *** Variables *** ${subscriptionId} f3ae6df7-07e1-47c9-8924-9ebe10343586 ${erroneousSubscriptionId} 442e3ee5-0499-4849-9b31-eb91ce1638f1 # Not existing ID on the subscriptions +@{response}= httpresponse +@{origResponse}= httpresponse \ No newline at end of file diff --git a/SOL002/VNFIndicator-API/environment/subscriptions.txt b/SOL002/VNFIndicator-API/environment/subscriptions.txt index 2e41b09364c498e5ddacf953d29f6d00029a8956..00b6bee592ee749bf186ce5754aa1117e45de7f5 100644 --- a/SOL002/VNFIndicator-API/environment/subscriptions.txt +++ b/SOL002/VNFIndicator-API/environment/subscriptions.txt @@ -4,3 +4,4 @@ ${indicatorId} 34e70855-a9d3-4fef-aece-76a3cd266ec8 ${erroneousIndicatorId} erroneousIndicatorId ${POS_FILTER} callbackUri=http://127.0.0.1/subscribe ${NEG_FILTER} callback=http://127.0.0.1/subscribe +@{response}= httpresponse