diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 3120ea30d65c71e2e09da4afc2940914b60cdfb5..4fb16d3b5942f8a5c7966fcd3ff435c56982042f 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -18,8 +18,8 @@ Set new VNF Configuration ... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration Send VNF configuration Check HTTP Response Status Code Is 200 - Check HTTP Response Header Contains Etag - Check HTTP Response Body Json Schema Is vnfConfigModifications.schema.json + Check HTTP Response Header Contains ETag + Check HTTP Response Body Json Schema Is vnfConfigModifications Check Postcondition VNF Is Configured Get information about a VNF configuration @@ -34,7 +34,7 @@ Get information about a VNF configuration ... Post-Conditions: none Get VNF configuration Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is vnfConfiguration.schema.json + Check HTTP Response Body Json Schema Is vnfConfiguration Get information about a VNF configuration with HTTP Etag [Tags] etag @@ -48,8 +48,8 @@ Get information about a VNF configuration with HTTP Etag ... Post-Conditions: none Get VNF configuration Check HTTP Response Status Code Is 200 - Check HTTP Response Header Contains Etag - Check HTTP Response Body Json Schema Is vnfConfiguration.schema.json + Check HTTP Response Header Contains ETag + Check HTTP Response Body Json Schema Is vnfConfiguration Set new VNF Configuration - HTTP Etag precondition unsuccessful [Tags] etag @@ -121,6 +121,7 @@ Send VNF configuration Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/vnfConfigModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} + Set Suite Variable &{etag} ${response[0]['headers']['ETag']} ${output}= Output response Set Suite Variable @{response} ${output} @@ -137,8 +138,9 @@ Check HTTP Response Header Contains Log Header is present Check HTTP Response Body Json Schema Is - [Arguments] ${schema} - Should Contain ${response[0]['headers']['Content-Type']} ${CONTENT_TYPE} + [Arguments] ${input} + Should Contain ${response[0]['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json Validate Json ${schema} ${response[0]['body']} Log Json Schema Validation OK @@ -158,11 +160,11 @@ Check Postcondition VNF Is Configured Should Be Equal ${response[0]['body']} ${input} Send Duplicated VNF configuration - Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified + Depends On Test Send VNF configuration # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/vnfConfigModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} diff --git a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot index 43c1d6759475adb3fd5162bb1f83189666c2bb11..ec2aa8ed967f0897c4e7ae52f2f1cabcdd637046 100644 --- a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot @@ -8,6 +8,10 @@ Library JSONSchemaLibrary schemas/ Library DependencyLibrary +*** Variables ** +${original_etag} 1234 + + *** Test Cases *** POST Alarm - Method not implemented log Trying to perform a POST. This method should not be implemented @@ -17,6 +21,7 @@ POST Alarm - Method not implemented Log Validate Status code Integer response status 405 + Get information about a configuration [Documentation] Test ID: 7.4.3.1 ... Test title: Get information about an alarm @@ -32,15 +37,17 @@ Get information about a configuration Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - ${Etag}= Output response headers Etag Log Validate Status code Integer response status 200 + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} ${result}= Output response body Validate Json alarm.schema.json ${result} Log Validation OK + PUT Alarm - Method not implemented log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept":"${ACCEPT}"} @@ -49,6 +56,7 @@ PUT Alarm - Method not implemented Log Validate Status code Integer response status 405 + PATCH Alarm [Documentation] Test ID: 7.4.3.2 ... Test title: Modify an individual alarm resource @@ -60,60 +68,63 @@ PATCH Alarm ... Post-Conditions: log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag Integer response status 200 ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} ${result}= Output response body Validate Json alarmModifications.schema.json ${result} Log Validation OK + -PATCH Alarm - Conflict + + +PATCH Alarm - Precondition failed [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Conflict + ... Test title: Modify an individual alarm resource - Precondition failed ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL002 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified - Depends On Test PATCH Alarm # If the previous test scceeded, it means that the alarm is in ackownledged state + Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 409 + Integer response status 412 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -PATCH Alarm - Precondition failed +PATCH Alarm - Conflict [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Precondition failed + ... Test title: Modify an individual alarm resource - Conflict ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL002 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified - Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified + Depends On Test PATCH Alarm # If the previous test scceeded, it means that the alarm is in ackownledged state log Trying to perform a PATCH. This method modifies an individual alarm resource - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 412 + Integer response status 409 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK diff --git a/SOL002/VNFFaultManagement-API/environment/variables.txt b/SOL002/VNFFaultManagement-API/environment/variables.txt index e3d485e806adaff758727f480b63811144c909cd..fc5212d5d38bb191765dc00e18074df88ad925f8 100644 --- a/SOL002/VNFFaultManagement-API/environment/variables.txt +++ b/SOL002/VNFFaultManagement-API/environment/variables.txt @@ -16,8 +16,8 @@ ${CONTENT_TYPE} application/json ${VNFM_DUPLICATION} 0 ${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${Etag}= an etag -${Etag_modified}= a modified etag +${etags} a modified etag +${wrong_etag} wrong-tag ${CONTENT_TYPE_PATCH} application/merge-patch+json ${PerceivedSeverity} CRITICAL diff --git a/SOL002/VNFIndicator-API/IndividualSubscription.robot b/SOL002/VNFIndicator-API/IndividualSubscription.robot index 58a3c927ab29374aff1c04c5cc0e0ab7ee970589..70e9373b0b3562eae00a01b9d6eb6a063d19fe3c 100644 --- a/SOL002/VNFIndicator-API/IndividualSubscription.robot +++ b/SOL002/VNFIndicator-API/IndividualSubscription.robot @@ -6,76 +6,190 @@ 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] ${input} + Should Contain ${response[0]['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.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..114909043bf8d13c3e24f615e29ce55dd709fc16 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}"} @@ -144,8 +144,9 @@ Check HTTP Response Header Contains Log Header is present Check HTTP Response Body Json Schema Is - [Arguments] ${schema} + [Arguments] ${input} Should Contain ${response[0]['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json Validate Json ${schema} ${response[0]['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFIndicator-API/Subscriptions.robot b/SOL002/VNFIndicator-API/Subscriptions.robot index e33fa7ebffcf0356b77faa06425716d8954df55e..8fe95b05a0d9754b98f77df21bdf855d175889d3 100644 --- a/SOL002/VNFIndicator-API/Subscriptions.robot +++ b/SOL002/VNFIndicator-API/Subscriptions.robot @@ -7,96 +7,212 @@ 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] ${input} + Should Contain ${response[0]['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.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/VNFIndicators.robot b/SOL002/VNFIndicator-API/VNFIndicators.robot index 6085bdbd158baa1e8d532e59ee05107a7d5ff2d4..86746cd106c742c106bbd6b4d2f21e487bbf6872 100644 --- a/SOL002/VNFIndicator-API/VNFIndicators.robot +++ b/SOL002/VNFIndicator-API/VNFIndicators.robot @@ -8,141 +8,132 @@ Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} *** Test Cases *** Get all VNF Indicators - [Documentation] Test ID 6.4.1 + [Documentation] Test ID: 6.3.2.1.1 ... Test title: Get all VNF Indicators - ... Test objective: The objective is to test the retrieval of all the available VNF indicators - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Test objective: The objective is to test the retrieval of all the available VNF indicators and perform a JSON schema validation of the collected indicators data structure + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: section 8.4.2.3.2 - SOL002 v2.4.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. - ... Post-Conditions: The VNF indicators are not modified by the operation + ... Post-Conditions: none Get all VNF indicators Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is vnfIndicators - Check Postcondition VNF Indicators Untouched (Implicit) Get VNF Indicators with attribute-based filter - [Documentation] Test ID 6.4.2 + [Documentation] Test ID: 6.3.2.1.2 ... Test title: Get VNF Indicators with attribute-based filter - ... Test objective: The objective is to test the retrieval of VNF indicators using attribute-based filter - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Test objective: The objective is to test the retrieval of VNF indicators using attribute-based filter, perform a JSON schema validation of the collected indicators data structure, and verify that the retrieved information matches the issued attribute-based filters + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: section 8.4.2.3.2 - SOL002 v2.4.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. - ... Post-Conditions: The VNF indicators are not modified by the operation + ... Post-Conditions: none Get VNF indicators with filter Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is vnfIndicators Check HTTP Response Body Matches Attribute-Based Filter - Check Postcondition VNF Indicators Untouched (Implicit) Get all VNF Indicators with invalid attribute-based filter - [Documentation] Test ID 6.4.3 + [Documentation] Test ID: 6.3.2.1.3 ... Test title: Get VNF Indicators with invalid attribute-based filter - ... Test objective: The objective is to test that the retrieval of VNF indicators fails using invalid attribute-based filters - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Test objective: The objective is to test that the retrieval of VNF indicators fails using invalid attribute-based filters, and perform the JSON schema validation of the failed operation HTTP response. + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: section 8.4.2.3.2 - SOL002 v2.4.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. - ... Post-Conditions: The VNF indicators are not modified by the operation + ... Post-Conditions: none Get VNF indicators with invalid filter Check HTTP Response Status Code Is 400 Check HTTP Response Body Json Schema Is ProblemDetails - Check Postcondition VNF Indicators Untouched (Implicit) Get all VNF Indicators with invalid authorization token - [Documentation] Test ID 6.4.4 + [Documentation] Test ID: 6.3.2.1.4 ... Test title: GET all VNF Indicators One or more measures of VNF performance indicators are available in the VNF. - ... Test objective: The objective is to test that the retrieval of VNF indicators fails using invalid authorization token - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Test objective: The objective is to test that the retrieval of VNF indicators fails using invalid authorization token, and perform the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: section 4.5.3.3, 8.4.2.3.2 - SOL002 v2.4.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. - ... Post-Conditions: The VNF indicators are not modified by the operation + ... Post-Conditions: none Get all VNF indicators with invalid authorization token - Check HTTP Response Status Code Is 401 + Check HTTP Response Status Code Is 40x Check HTTP Response Body Json Schema Is ProblemDetails - Check Postcondition VNF Indicators Untouched (Implicit) Get all VNF Indicators without authorization token - [Documentation] Test ID 6.4.5 + [Documentation] Test ID: 6.3.2.1.5 ... Test title: GET all VNF Indicators without authorization bearers - ... Test objective: The objective is to test that the retrieval of VNF indicators fails by omitting the authorization token - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Test objective: The objective is to test that the retrieval of VNF indicators fails by omitting the authorization token, and perform the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: section 4.5.3.3, 8.4.2.3.2 - SOL002 v2.4.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. - ... Post-Conditions: The VNF indicators are not modified by the operation + ... Post-Conditions: none Get all VNF indicators without authorization token - Check HTTP Response Status Code Is 401 + Check HTTP Response Status Code Is 40x Check HTTP Response Body Json Schema Is ProblemDetails - Check Postcondition VNF Indicators Untouched (Implicit) Get all VNF Indicators with invalid resource endpoint - [Documentation] Test ID 6.4.6 + [Documentation] Test ID: 6.3.2.1.6 ... Test title: GET all VNF Indicators with invalid resource endpoint - ... Test objective: The objective is to test that the retrieval of VNF indicators fails when using invalid resource endpoint - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Test objective: The objective is to test that the retrieval of VNF indicators fails when using invalid resource endpoint, and perform the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: section 8.4.2.3.2 - SOL002 v2.4.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. - ... Post-Conditions: The VNF indicators are not modified by the operation + ... Post-Conditions: none Get all VNF indicators with invalid resource endpoint Check HTTP Response Status Code Is 404 Check HTTP Response Body Json Schema Is ProblemDetails - Check Postcondition VNF Indicators Untouched (Implicit) POST all VNF Indicators - Method not implemented - [Documentation] Test ID 6.4.7 + [Documentation] Test ID: 6.3.2.1.7 ... Test title: POST all VNF Indicators - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create new VNF indicators - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF + ... Reference: section 8.4.2.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 indicators are not modified by the operation + ... Post-Conditions: none Send POST Request for all VNF indicators Check HTTP Response Status Code Is 405 - Check Postcondition VNF Indicators Untouched (Implicit) PUT all VNF Indicators - Method not implemented - [Documentation] Test ID 6.4.7 + [Documentation] Test ID: 6.3.2.1.8 ... Test title: PUT all VNF Indicators - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify VNF indicators - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF + ... Reference: section 8.4.2.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 VNF indicators are not modified by the operation + ... Post-Conditions: none Send PUT Request for all VNF indicators Check HTTP Response Status Code Is 405 - Check Postcondition VNF Indicators Untouched (Implicit) PATCH all VNF Indicators - Method not implemented - [Documentation] Test ID 6.4.8 + [Documentation] Test ID: 6.3.2.1.9 ... Test title: POST all VNF Indicators - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update VNF indicators - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF + ... Reference: section 8.4.2.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 VNF indicators are not modified by the operation + ... Post-Conditions: none Send PATCH Request for all VNF indicators Check HTTP Response Status Code Is 405 - Check Postcondition VNF Indicators Untouched (Implicit) -DELETE all VNF Indicators (Method not implemented) - [Documentation] Test ID 6.4.9 +DELETE all VNF Indicators - Method not implemented + [Documentation] Test ID: 6.3.2.1.10 ... Test title: POST all VNF Indicators - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to delete VNF indicators - ... Pre-conditions: A VNF instance is up and running. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: section 8.4.2 - SOL002 v2.4.1 + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF + ... Reference: section 8.4.2.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 VNF indicators are not modified by the operation + ... Post-Conditions: none Send DELETE Request for all VNF indicators Check HTTP Response Status Code Is 405 - Check Postcondition VNF Indicators Untouched (Implicit) + Check Postcondition VNF Indicators Exist *** Keywords *** Get all VNF indicators @@ -150,22 +141,29 @@ Get all VNF indicators Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} Log Execute Query and validate response - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators - ${vnfIndicators}= evaluate json.loads('''${response.body}''') json + Get ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} + ${body}= evaluate json.loads('''${response.body}''') json + Set Suite Variable @{vnfIndicators} ${body} Get VNF indicators with filter Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} Log Execute Query and validate response - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS} + Get ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS} + ${output}= Output response + Set Suite Variable @{response} ${output} Get VNF indicators with invalid filter Log The GET method queries multiple VNF indicators using invalid Attribute-based filtering parameters Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} Log Execute Query and validate response - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS} + Get ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS} + ${output}= Output response + Set Suite Variable @{response} ${output} Get all VNF indicators with invalid authorization token Pass Execution If ${AUTH_USAGE} == 0 Skipping test as EM/VNF is not supporting authentication @@ -173,71 +171,86 @@ Get all VNF indicators with invalid authorization token Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} Log Execute Query and validate response - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators + Get ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} Get all VNF indicators without authorization token Pass Execution If ${AUTH_USAGE} == 0 Skipping test as EM/VNF is not supporting authentication Log The GET method queries multiple VNF indicators omitting token Set Headers {"Accept": "${ACCEPT_JSON}"} Log Execute Query and validate response - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicators + Get ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} Get all VNF indicators with invalid resource endpoint Log The GET method queries multiple VNF indicators omitting token Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} Log Execute Query and validate response - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/indicator + Get ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} Send POST Request for all VNF indicators 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}"} - ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration + Post ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} Send PUT Request for all VNF indicators 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}"} - ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration + Post ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} Send PATCH Request for all VNF indicators log Trying to perform a PATCH. This method should not be implemented Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration + Post ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} Send DELETE Request for all VNF indicators log Trying to perform a DELETE. This method should not be implemented Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/configuration + Post ${apiRoot}/${apiName}/${apiVersion}/indicators + ${output}= Output response + Set Suite Variable @{response} ${output} Check HTTP Response Status Code Is - [Arguments] ${expected_status} - Should Be Equal ${response.status_code} ${expected_status} + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response[0]['status']} ${status} + Log Status code validated + +Check HTTP Response Status Code Is 40x + Should Contain Any ${response[0]['status']} 401 403 Log Status code validated Check HTTP Response Header Contains [Arguments] ${CONTENT_TYPE} - Should Contain ${response.headers} ${CONTENT_TYPE} + Should Contain ${response[0]['headers']} ${CONTENT_TYPE} Log Header is present Check HTTP Response Body Json Schema Is [Arguments] ${schema} - ${contentType}= Get Value From Json ${response.headers} $..Content-Type - Should Be Equal ${contentType} ${CONTENT_TYPE_JSON} - ${json}= evaluate json.loads('''${response.body}''') json - Validate Json ${schema} ${json} + Should Contain ${response[0]['headers']['Content-Type']} application/json + Validate Json ${schema} ${response[0]['body']} Log Json Schema Validation OK -Check Postcondition VNF Indicators Untouched (Implicit) - Log Check Implicit Postcondition - ${input}= evaluate json.loads('''${vnfIndicators}''') json +Check Postcondition VNF Indicators Exist + Log Check Postcondition indicators exist Get all VNF indicators - ${output}= evaluate json.loads('''${response.body}''') json - Should Be Equal ${output} ${input} - + 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 \ No newline at end of file diff --git a/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot b/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot index b6923d444f889713fe4aed8d2cffff48fac06aa8..5c83579937fca3eea36fa6ab25c426fca306b681 100644 --- a/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot +++ b/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot @@ -188,8 +188,9 @@ Check HTTP Response Header Contains Log Header is present Check HTTP Response Body Json Schema Is - [Arguments] ${schema} + [Arguments] ${input} Should Contain ${response[0]['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json Validate Json ${schema} ${response[0]['body']} Log Json Schema Validation OK 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 diff --git a/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot b/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot index 0856f08e15aa1acd7c8dbfb2baf78847a3e8c02b..8d7bd021174882229380f49194b07b9884e3e543 100644 --- a/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot @@ -38,23 +38,6 @@ Post Cancel operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Cancel operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Post Cancel operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot b/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot index 0ddb04269f65a78a422bf743ddae67459d5d052a..60be754d3736651c6eefc666403ac5c8ebd825b7 100644 --- a/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot @@ -21,27 +21,7 @@ Change external VNF connectivity Should Contain ${headers} Location Log Validation OK -Change external VNF connectivity Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that another LCM operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/changeExtVnfConnectivityRequest .json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - - + GET Change external VNF connectivity - Method not implemented log Trying to perform a GET. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} diff --git a/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot b/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot index b1c238bf80c40de1a37dd36eea97096299ac67fa..1fd21f35cc6d3ac936f714f1010d0c40d8f3b770 100644 --- a/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot @@ -41,26 +41,6 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Change deployment flavour of a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/changeVnfFlavourRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Change deployment flavour of a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot b/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot index 2e160b6cb394c0acf6fb245de274343fbcfe7934..684ec9519772a140c3a7edc5f5b36f232c727d58 100644 --- a/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot @@ -41,23 +41,6 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Fail operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Post Fail operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot b/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot index d761cb348909d49573d960293b7755af109cf9d4..52c7618910a109f00225a9659d85af2a1e0ea43c 100644 --- a/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot @@ -41,26 +41,6 @@ Heal a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Heal a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to heal a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Heal a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot b/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot index 026a3a7dccab38c84c7c217135589a3d28790883..7b5b22ac6c6106baeeb321e6a97c58bb7ab6d294 100644 --- a/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot +++ b/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot @@ -50,7 +50,7 @@ DELETE an individual subscription log Try to delete an individual subscription Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Log Validate Status code Integer response status 204 diff --git a/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot index cf1a04dc043dc64821bc92c93e578c8f5fdd306f..73ab26ca20332a94202eae807c205a1120d32c7b 100644 --- a/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -10,9 +10,9 @@ Documentation This resource represents an individual VNF instance. The client ... underlying VNF instance, and to read information about the VNF instance. Suite Setup Check resource existance + *** Variables *** -${Etag}= an etag -${Etag_modified}= a modified etag +${original_etag} 1234 *** Test Cases *** Post Individual VNFInstance - Method not implemented @@ -31,13 +31,14 @@ Get Information about an individual VNF Instance Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} Log Validate Status code - ${Etag}= Output response headers Etag Integer response status 200 ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} ${result}= Output response body Validate Json vnfInstance.schema.json ${result} Log Validation OK + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} PUT Individual VNFInstance - Method not implemented Log Trying to perform a PUT. This method should not be implemented @@ -56,12 +57,11 @@ PATCH Individual VNFInstance log Trying to modify an individual VNF instance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag - Integer response status 202 ${headers}= Output response headers Should Contain ${headers} Location Log Validation OK @@ -75,7 +75,7 @@ PATCH Individual VNFInstance Precondition failed log Trying to modify an individual VNF instance Precondition failed Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} @@ -126,7 +126,7 @@ DELETE Individual VNFInstance Conflict [Setup] Check resource instantiated log Trying to delete an individual VNF instance Conflict Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId} Log Validate Status code Integer response status 409 ${contentType}= Output response headers Content-Type diff --git a/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot b/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot index 307b42a7374efec2b6a52cf4fb6605fa5e59f396..3d0c9f8f44565fb78fd81d07285f3a73de85126c 100644 --- a/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot @@ -35,7 +35,7 @@ Instantiate a vnfInstance Conflict Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/instantiateVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId}/instantiate ${body} Integer response status 409 Log Status code validated ${contentType}= Output response headers Content-Type diff --git a/SOL002/VNFLifecycleManagement-API/LCMParallelOperation.robot b/SOL002/VNFLifecycleManagement-API/LCMParallelOperation.robot new file mode 100644 index 0000000000000000000000000000000000000000..4effbe1b51a018e0a58f27014c866e7d3ee81f11 --- /dev/null +++ b/SOL002/VNFLifecycleManagement-API/LCMParallelOperation.robot @@ -0,0 +1,40 @@ +*** Settings *** +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Scale a vnfInstance + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Scale a vnfInstance Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + log Trying to Scale a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + Validate Json ProblemDetails.schema.json ${problemDetails} + Log Validation OK + diff --git a/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot b/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot index 77ae2f9726ee2564b09299818a3033d212923029..035572726c5f0c738135479002a48e30b85d3b77 100644 --- a/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot @@ -13,7 +13,7 @@ Operate a vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 202 Log Status code validated @@ -33,7 +33,7 @@ Operate a vnfInstance Conflict (Not-Instantiated) Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 409 Log Status code validated @@ -41,26 +41,6 @@ Operate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Operate a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the operational state of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Operate a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent @@ -73,7 +53,7 @@ Operate a vnfInstance Not Found Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 404 Log Status code validated diff --git a/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot b/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot index ce6afdd19007a73c9a6322fa7af57726f0aaae4f..d98c4f160b988b44bf8ae6814ada18d41bf72072 100644 --- a/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot @@ -40,24 +40,6 @@ Post Retry operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Retry operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as rollback or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Retry an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Post Retry operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot b/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot index 0e98a8fb7ae59bcaa5f1dae5ffcf0c728882beaa..afd5d3600dff4919b351c289beb262727675dab4 100644 --- a/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot @@ -39,24 +39,6 @@ Post Rollback operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Rollback operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Rollback an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Post Rollback operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot b/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot index 879d55fd237c06887e07d137b656fe972bfe0660..4fbb92b216ba195faa67d5f66aa0b295367a0be3 100644 --- a/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot @@ -40,25 +40,6 @@ Scale a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot b/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot index b1f5b4646642a19ffa13e9727b92f7631e5283c7..775376c64aa4d02245545bcec6a7c614205859f0 100644 --- a/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot @@ -40,24 +40,6 @@ Scale a vnfInstance to level Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance to level Conflict (parallel LCM operation) - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/Subscriptions.robot b/SOL002/VNFLifecycleManagement-API/Subscriptions.robot index c0a37afaf3193fd8159e570bf690a02317a2d14b..3c4e55907bbaf19b6f1d48e0c6d809b0d32e15ad 100644 --- a/SOL002/VNFLifecycleManagement-API/Subscriptions.robot +++ b/SOL002/VNFLifecycleManagement-API/Subscriptions.robot @@ -11,7 +11,7 @@ Create a new subscription Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -29,7 +29,7 @@ Create a new Subscription - DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -45,7 +45,7 @@ Create a new Subscription - NO-DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 303 Log Status code validated diff --git a/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot b/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot index d7556a347139e4ff8c0f099e2aa4a0434ca7d5d9..3f652ede7828fb42489780cc7c78fe6973a64762 100644 --- a/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot @@ -41,26 +41,6 @@ Terminate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Terminate a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/terminateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished GET Terminate VNFInstance - Method not implemented log Trying to perform a GET. This method should not be implemented diff --git a/SOL002/VNFLifecycleManagement-API/environment/variables.txt b/SOL002/VNFLifecycleManagement-API/environment/variables.txt index 4c78837e9a7dbbb1bac6110cb1d883a5f27f5aa4..b43c2b7545696bc70414631205768d85d8d10bc7 100644 --- a/SOL002/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL002/VNFLifecycleManagement-API/environment/variables.txt @@ -15,6 +15,8 @@ ${apiVersion} v1 ${AUTH_USAGE} 1 ${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX ${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${instantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f #Change with an instantiated vnfInstanceID +${conflicVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${vnfInstanceName} Test-VnfInstance ${vnfInstanceDescription} description vnf ${vnfInstanceDescription_Update} Updated description vnf diff --git a/SOL002/VNFPerformanceManagement-API/PMJobs.robot b/SOL002/VNFPerformanceManagement-API/PMJobs.robot index 50a8c75573d2a6cb6822ffd6b1cd6af842ee0474..12a2eaf78a1974917cc990341c8a7704d45480c7 100644 --- a/SOL002/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL002/VNFPerformanceManagement-API/PMJobs.robot @@ -7,183 +7,350 @@ Resource environment/pmJobs.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** -GET all Pm Jobs +GET all VNF Performance Monitoring Jobs + [Documentation] Test ID: 6.3.3.1.1 + ... Test title: GET all VNF Performance Monitoring Jobs + ... Test objective: The objective is to test the retrieval of all the available VNF performance monitoring jobs and perform a JSON schema and content validation of the collected jobs data structure + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Does Not Contain reports + +GET VNF Performance Monitoring Jobs with attribute-based filter + [Documentation] Test ID: 6.3.3.1.2 + ... Test title: GET all VNF Performance Monitoring Jobs with attribute-based filter + ... Test objective: The objective is to test the retrieval of VNF performance monitoring jobs using attribute-based filter, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued attribute-based filter + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with attribute-based filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Matches filter + +GET all VNF Performance Monitoring Jobs with all_fields attribute selector + [Documentation] Test ID: 6.3.3.1.3 + ... Test title: GET all VNF Performance Monitoring Jobs with all_fields attribute selector + ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs all_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued all_fileds selector + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with all_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Matches all_fields selector + +GET all VNF Performance Monitoring Jobs with exclude_default attribute selector + [Documentation] Test ID: 6.3.3.1.4 + ... Test title: GET all VNF Performance Monitoring Jobs with exclude_default attribute selector + ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_default attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_default selector + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with exclude_default attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Matches exclude_default selector + +GET all VNF Performance Monitoring Jobs with fields attribute selector + [Documentation] Test ID: 6.3.3.1.5 + ... Test title: GET all VNF Performance Monitoring Jobs with fields attribute selector + ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued fields selector + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The VNFM supports the use of exclude_fields attribute selector + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Matches fields selector + +GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector + [Documentation] Test ID: 6.3.3.1.6 + ... Test title: GET all VNF Performance Monitoring Jobs with exclude_fields attribute selector + ... Test objective: The objective is to test the retrieval of all VNF performance monitoring jobs exclude_fields attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued exclude_fields selector + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: The VNFM supports the use of exclude_fields attribute selector + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with exclude_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJobs + Check HTTP Response Body Matches exclude_fields selector + +GET VNF Performance Monitoring Jobs with invalid attribute-based filter + [Documentation] Test ID: 6.3.3.1.7 + ... Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter + ... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with invalid attribute-based filter + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET VNF Performance Monitoring Jobs with invalid resource endpoint + [Documentation] Test ID: 6.3.3.1.8 + ... Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter + ... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid resource endpoint, and perform the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.2 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET VNF Performance Monitoring Jobs with invalid resource endpoint + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +Create new VNF Performance Monitoring Job + [Documentation] Test ID: 6.3.3.1.9 + ... Test title: GET VNF Performance Monitoring Jobs with invalid attribute-based filter + ... Test objective: The objective is to test that the retrieval of VNF performance monitoring jobs fails when using invalid resource endpoint, and perform the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.1 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: The VNF Performance Job is successfully created on the VNFM + Send Post Request Create new VNF Performance Monitoring Job + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is PmJob + Check Postcondition PmJob Exists + +PUT all VNF Performance Monitoring Jobs - Method not implemented + [Documentation] Test ID: 6.3.3.1.10 + ... Test title: PUT all VNF Performance Monitoring Jobs - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to modify VNF Performance Monitoring Jobs + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Send PUT Request for all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 405 + +PATCH all VNF Performance Monitoring Jobs - (Method not implemented) + [Documentation] Test ID: 6.3.3.1.11 + ... Test title: PATCH all VNF Performance Monitoring Jobs - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to update VNF Performance Monitoring Jobs + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 405 + +DELETE all VNF Performance Monitoring Jobs - Method not implemented + [Documentation] Test ID: 6.3.3.1.12 + ... Test title: DELETE all VNF Performance Monitoring Jobs - Method not implemented + ... Test objective: The objective is to test that DELETE method is not allowed to update VNF Performance Monitoring Jobs + ... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF. + ... Reference: section 6.4.2.3.3 - SOL002 v2.4.1 + ... Config ID: Config_prod_VE + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for all VNF Performance Monitoring Jobs + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Performance Monitoring Jobs Exist + +*** Keywords *** +GET all VNF Performance Monitoring Jobs Log Trying to get all PM Jobs present in the VNFM Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${result} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -GET all Pm Jobs - Filter +GET VNF Performance Monitoring Jobs with attribute-based filter Log Trying to get all PM Jobs present in the VNFM, using filter params Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${POS_FILTER} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - -GET all Pm Jobs - all_fields + ${output}= Output response + Set Suite Variable @{response} ${output} + +GET VNF Performance Monitoring Jobs with all_fields attribute selector Log Trying to get all PM Jobs present in the VNFM, using 'all_fields' filter Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?all_fields - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Trying to validate criteria schema - ${criteria}= Get Value From Json ${result} $..criteria - Validate Json criteria.schema.json ${criteria[0]} - Log Validation for criteria schema OK - Log Trying to validate criteria schema - ${reports}= Get Value From Json ${result} $..reports - Validate Json reports.schema.json ${reports[0]} - Log Validation for reports schema OK - Log Validating _links schema - ${links}= Get Value From Json ${result} $.._links - Validate Json links.schema.json ${links[0]} - Log Validation for _links schema OK + ${output}= Output response + Set Suite Variable @{response} ${output} -GET all Pm Jobs - exclude_default +GET VNF Performance Monitoring Jobs with exclude_default attribute selector Log Trying to get all VNF Packages present in the VNFM, using filter params Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?exclude_default - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${result} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -GET all Pm Jobs - fields +GET VNF Performance Monitoring Jobs with fields attribute selector Log Trying to get all VNF Packages present in the VNFM, using filter params Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Trying to validate criteria schema - ${criteria}= Get Value From Json ${result} $..criteria - Validate Json criteria.schema.json ${criteria[0]} - Log Validation for criteria schema OK - Log Trying to validate criteria schema - ${reports}= Get Value From Json ${result} $..reports - Validate Json reports.schema.json ${reports[0]} - Log Validation for reports schema OK + ${output}= Output response + Set Suite Variable @{response} ${output} -GET all Pm Jobs - exclude_fields +GET VNF Performance Monitoring Jobs with exclude_fields attribute selector Log Trying to get all VNF Packages present in the VNFM, using filter params Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJobs.schema.json ${result} - Log Validation OK - Log Checking that reports element is missing - ${reports}= Get Value From Json ${result} $..reports - Should Be Empty ${reports} - Log Reports element is empty as expected - + ${output}= Output response + Set Suite Variable @{response} ${output} -GET all Pm Jobs - Negative (wronge filter name) +GET VNF Performance Monitoring Jobs with invalid attribute-based filter Log Trying to get all PM Jobs present in the VNFM, using an erroneous filter param Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${NEG_FILTER} - Integer response status 400 - Log Received 400 Bad Request as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response headers Content-Type - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -GET all Pm Jobs (Negative: Not found) + ${output}= Output response + Set Suite Variable @{response} ${output} + +GET VNF Performance Monitoring Jobs with invalid resource endpoint Log Trying to perform a GET on a erroneous URI Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_job # wrong URI /pm_job instead of /pm_jobs - Integer response status 404 - Log Received 404 Not Found as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response headers Content-Type - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -POST all PM Jobs - Create new PM Job + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send Post Request Create new VNF Performance Monitoring Job Log Creating a new PM Job Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} ${body}= Get File jsons/CreatePmJobRequest.json POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs ${body} - Integer response status 201 - Log Received 201 Created as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${result}= Output response body - Validate Json PmJob.schema.json ${result} - Log Validation OK - -PUT all PM Jobs - (Method not implemented) + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send PUT Request for all VNF Performance Monitoring Jobs 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}"} PUT ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable @{response} ${output} -PATCH all Pm Jobs - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented +Send PATCH Request for all VNF Performance Monitoring Jobs + 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}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected + ${output}= Output response + Set Suite Variable @{response} ${output} + +Send DELETE Request for all VNF Performance Monitoring Jobs + 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}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs + ${output}= Output response + Set Suite Variable @{response} ${output} -DELETE all Pm Jobs - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented +Check Postcondition VNF Performance Monitoring Jobs Exist + Log Checking that Pm Job still exists + GET all VNF Performance Monitoring Jobs + +Check Postcondition PmJob Exists + Log Checking that Pm Job exists Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Integer response status 405 - Log Received 405 Method not implemented as expected + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${response[0]['body']['id']} + ${output}= Output response + Set Suite Variable @{response} ${output} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PmJob + +Check HTTP Response Body Matches exclude_fields selector + Log Checking that reports element is missing + ${reports}= Get Value From Json ${response[0]['body']} $..reports + Should Be Empty ${reports} + Log Checking that reports element is missing + ${criteria}= Get Value From Json ${response[0]['body']} $..criteria + Should Be Empty ${criteria} + Log Reports element is empty as expected + +Check HTTP Response Body Matches fields selector + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${response[0]['body']} $..criteria + Validate Json criteria.schema.json ${criteria[0]} + Log Validation for criteria schema OK + Log Trying to validate criteria schema + ${reports}= Get Value From Json ${response[0]['body']} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + +Check HTTP Response Body Matches exclude_default selector + Log Checking that reports element is missing + ${reports}= Get Value From Json ${response[0]['body']} $..reports + Should Be Empty ${reports} + Log Reports element is empty as expected + +Check HTTP Response Body Matches all_fields selector + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${response[0]['body']} $..criteria + Validate Json criteria.schema.json ${criteria[0]} + Log Validation for criteria schema OK + Log Trying to validate criteria schema + ${reports}= Get Value From Json ${response[0]['body']} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + Log Validating _links schema + ${links}= Get Value From Json ${response[0]['body']} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +Check HTTP Response Body Matches filter + Log Checking that attribute-based filter is matched + #todo + +Check HTTP Response Body Does Not Contain reports + Log Checking that field element is missing + ${reports}= Get Value From Json ${response[0]['body']} $..reports + Should Be Empty ${reports} + Log Reports element is empty 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 Status Code Is 40x + Should Contain Any ${response[0]['status']} 401 403 + Log Status code validated + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response[0]['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response[0]['headers']['Content-Type']} application/json + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response[0]['body']} + Log Json Schema Validation OK + diff --git a/SOL002/VNFPerformanceManagement-API/environment/pmJobs.txt b/SOL002/VNFPerformanceManagement-API/environment/pmJobs.txt index 57798d17d3210b25b49340d89c32b6e141adb325..d3bffe49dcfe216b32c698e553727a8db74a4e77 100644 --- a/SOL002/VNFPerformanceManagement-API/environment/pmJobs.txt +++ b/SOL002/VNFPerformanceManagement-API/environment/pmJobs.txt @@ -2,3 +2,4 @@ ${POS_FILTER} objectInstanceIds=1f50d68b-82e8-4deb-bd40-c934d4d1ac0a ${NEG_FILTER} criteriaPmJob=erroneousAttributeName ${fields} criteria,reports +@{response}= httpresponse diff --git a/SOL003/VNFFaultManagement-API/IndividualAlarm.robot b/SOL003/VNFFaultManagement-API/IndividualAlarm.robot index c860aa35d07dbf0af0eced8d1fbf09b5d18d819b..95f75985ff16e763a8200052da3cb3d00b62b34a 100644 --- a/SOL003/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL003/VNFFaultManagement-API/IndividualAlarm.robot @@ -8,6 +8,9 @@ Library JSONSchemaLibrary schemas/ Library DependencyLibrary +*** Variables *** +${original_etag} 1234 + *** Test Cases *** POST Alarm - Method not implemented log Trying to perform a POST. This method should not be implemented @@ -33,7 +36,8 @@ Get information about an alarm Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - #${Etag}= Output response headers Etag + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} Log Validate Status code Integer response status 200 ${contentType}= Output response headers Content-Type @@ -61,12 +65,13 @@ PATCH Alarm ... Post-Conditions: log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag + ${Etag_modified}= Output response headers ETag Integer response status 200 ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} @@ -74,50 +79,52 @@ PATCH Alarm Validate Json AlarmModification.schema.json ${result} Log Validation OK -PATCH Alarm - Conflict +PATCH Alarm - Precondition failed [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Conflict + ... Test title: Modify an individual alarm resource - Precondition failed ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified + Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 409 + Integer response status 412 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -PATCH Alarm - Precondition failed + +PATCH Alarm - Conflict [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Precondition failed + ... Test title: Modify an individual alarm resource - Conflict ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified - Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 412 + Integer response status 409 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK + DELETE Alarm - Method not implemented log Trying to perform a DELETE. This method should not be implemented Set Headers {"Accept":"${ACCEPT}"} diff --git a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot index c767d88be6ee65909be7510adbf3a2a02a95582d..374c52c85929f005fd362bab2a721ee0bfbb67cd 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot @@ -21,26 +21,6 @@ Change external VNF connectivity ${headers}= Output response headers Should Contain ${headers} Location Log Validation OK - -Change external VNF connectivity Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that another LCM operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/changeExtVnfConnectivityRequest .json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished GET Change external VNF connectivity - Method not implemented diff --git a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot index 6d08b6df77bcd9c7e25dd4ac14a08cae530395fe..fc2902c5d1c94e6c333c20edf153daa49b13353e 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot @@ -14,8 +14,7 @@ Change deployment flavour of a vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body_file}= Get File jsons/changeVnfFlavourRequest.json - ${body}= evaluate json.loads('''${body_file}''') json + ${body}= Get File jsons/changeVnfFlavourRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} Integer response status 202 Log Status code validated @@ -44,28 +43,8 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Change deployment flavour of a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body_file}= Get File jsons/changeVnfFlavourRequest.json - ${body}= evaluate json.loads('''${body_file}''') json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - + + Change deployment flavour of a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent [Documentation] Not Found diff --git a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot index 94dbab29018aca728e31aed04b5f8eab0f26ee59..d008d1d35e51abd075d489f831bec9a68e97b575 100644 --- a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot @@ -40,23 +40,7 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Fail operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + Post Fail operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot index c0115d04e9f5ae32738645f8184d89dca627093e..92b4bd3db8cdf4609d76b0be1bfea54f29a45054 100644 --- a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot @@ -42,26 +42,7 @@ Heal a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Heal a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to heal a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + Heal a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot index d59a4fc0959589b607b5160bd932fa849c6d8337..0273b05b2b6f8c0f0e362a23369d7e4d94290b4f 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot @@ -51,7 +51,7 @@ DELETE an individual subscription log Try to delete an individual subscription Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Log Validate Status code Integer response status 204 diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot index 48c72009643885ec421a643a87dda9691158f8e6..69df8f636c461888638912d6a3e0de6d37d16dd0 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -12,8 +12,7 @@ Documentation This resource represents an individual VNF instance. The client Suite Setup Check resource existance *** Variables *** -${Etag}= an etag -${Etag_modified}= a modified etag +${original_etag} 1234 *** Test Cases *** Post Individual VNFInstance - Method not implemented @@ -38,6 +37,8 @@ Get Information about an individual VNF Instance ${result}= Output response body Validate Json vnfInstance.schema.json ${result} Log Validation OK + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} PUT Individual VNFInstance - Method not implemented log Trying to perform a PUT. This method should not be implemented @@ -56,11 +57,12 @@ PATCH Individual VNFInstance log Trying to modify an individual VNF instance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag + ${Etag_modified}= Output response headers ETag Integer response status 202 ${headers}= Output response headers Should Contain ${headers} Location @@ -75,7 +77,7 @@ PATCH Individual VNFInstance Precondition failed log Trying to modify an individual VNF instance Precondition failed Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} @@ -122,7 +124,7 @@ DELETE Individual VNFInstance Conflict [Setup] Check resource instantiated log Trying to delete an individual VNF instance Conflict Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId} Log Validate Status code Integer response status 409 ${problemDetails}= Output response body diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot index 3859bdc9cdf6067bd802b29be6ad86f8678958cc..b728e71dd0904e14b0af10a05720f3d2a6c10ace 100644 --- a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot @@ -36,7 +36,7 @@ Instantiate a vnfInstance Conflict Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/instantiateVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId}/instantiate ${body} Integer response status 409 Log Status code validated ${problemDetails}= Output response body diff --git a/SOL003/VNFLifecycleManagement-API/LCMParallelOperation.robot b/SOL003/VNFLifecycleManagement-API/LCMParallelOperation.robot new file mode 100644 index 0000000000000000000000000000000000000000..e4bb01b39e313cb50282efc97af0606d7f5e899f --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/LCMParallelOperation.robot @@ -0,0 +1,42 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Scale a vnfInstance + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + + +Scale a vnfInstance Conflict (parallel LCM operation) + # TODO: Need to set the pre-condition of the test + [Documentation] Conflict + ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. + ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + log Trying to Scale a vnf Instance + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + Validate Json ProblemDetails.schema.json ${problemDetails} + Log Validation OK + diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot index 17f2a76a8f4cf348a8c19ab34a4cb00b9a9a812e..a4f5c940fbc2108e4136e43f8d49dc4043202bbd 100644 --- a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot @@ -14,7 +14,7 @@ Operate a vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 202 Log Status code validated @@ -34,7 +34,7 @@ Operate a vnfInstance Conflict (Not-Instantiated) Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 409 Log Status code validated @@ -42,26 +42,7 @@ Operate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Operate a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the operational state of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + Operate a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent @@ -74,7 +55,7 @@ Operate a vnfInstance Not Found Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 404 Log Status code validated diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot index b66dcca2cacecdbafb328c1a2b542eb9147c9ede..0c6a474fa23698bdf130ec49b704ad2a9842a99c 100644 --- a/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot @@ -37,7 +37,7 @@ Operate a VNF Instance *** Keywords *** Initialize System Create Sessions - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json ${changeVnfOperateRequest}= evaluate json.loads('''${body}''') json ${requestedState}= Get Value From Json ${changeVnfOperateRequest} $..changeStateTo diff --git a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot index 4be7f59f21962eee8563375fc7bb5c868925aac5..20ea983a0719756bdf25f5c559f21e2173ad84ca 100644 --- a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot @@ -41,24 +41,6 @@ Post Retry operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Retry operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as rollback or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Retry an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Post Retry operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot index 2083c792a77dc5ef017c3938f3f2e5d44abf5907..bfd7e64d83e7fac966144970c3ec02fe9c505024 100644 --- a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot @@ -40,24 +40,7 @@ Post Rollback operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Rollback operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or fail. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Rollback an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished + Post Rollback operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot index d7dd5e748f898cee996b5488f24e02c3793aed19..28589121ad8b523611c69776e53a15112aaae01d 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot @@ -41,25 +41,6 @@ Scale a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot index eb1231d6faa8eae0594c47c87ca47aaf90546a39..4ba305f447156f354eef4f00af69386b5a1ebbc0 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot @@ -41,24 +41,6 @@ Scale a vnfInstance to level Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance to level Conflict (parallel LCM operation) - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale a vnf Instance - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot index ca7fd6af1d798243b26220bd5ec48e9a04c806cc..87caa20cc32b30bf4d31ae1bf86f42b4d690eb82 100644 --- a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot +++ b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot @@ -12,7 +12,7 @@ Create a new subscription Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -30,7 +30,7 @@ Create a new Subscription - DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -46,7 +46,7 @@ Create a new Subscription - NO-DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 303 Log Status code validated diff --git a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot index be6be40017eb123a4f8d5149f72f05b4ce5cdf64..783fb7ff0a6379056d1862bc35247f79a2d4edf2 100644 --- a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot @@ -42,26 +42,6 @@ Terminate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Terminate a vnfInstance Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/terminateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - #[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished GET Terminate VNFInstance - Method not implemented log Trying to perform a GET. This method should not be implemented diff --git a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot index cb6d825ca110ef3c717b276b5273ead611d6cca6..ec71cb3bec2e0be086afffa2111d88edc5562467 100644 --- a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot +++ b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot @@ -22,7 +22,7 @@ Create a new vnfInstance Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/createVnfRequest.json - Post ${apiRoot}${apiName}/${apiVersion}/vnf_instances ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body} Integer response status 201 Log Status code validated ${headers}= Output response headers diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index dc544d355033d4aea5f3c5a59b1890cd7c02d28e..c36b188eec11c22c10e75192715524f3bc483411 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -132,7 +132,7 @@ Send Change VNF Operational State Request Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Send Heal VNF Request diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index bf673fbf8a28e0388169c156c1b18663d931c4d1..b044c85627177f764808f8a8284ff792dfa9027c 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -1,12 +1,13 @@ *** Variables *** ${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${instantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f #Change with an instantiated vnfInstanceID ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d ${callback_endpoint} /notification ${callback_endpoint_fwd} /notification/check ${callback_port} 9091 ${callback_uri} http://localhost - +${conflicVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${VnfLcmOperationOccurrenceNotification} {} ${VnfIdentifierCreationNotification} {} diff --git a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot index a5b5ce59145ab6f21a359d81b20e972a6ad4cf83..a0dada4eec36c4dcf5a709a77caf767dd50c626e 100644 --- a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot +++ b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot @@ -6,9 +6,11 @@ Resource environment/nsDescriptors.txt # Specific nsDescriptors Para Library OperatingSystem Library JSONLibrary Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - Library JSONSchemaLibrary schemas/ + *** Variable *** +${original_etag} 1234 + *** Test Cases *** GET Single Network Service Descriptor [Documentation] The GET method reads information about an individual NS descriptor. @@ -26,6 +28,8 @@ GET Single Network Service Descriptor ${result}= Output response body Validate Json NsdInfo.schema.json ${result} Log Validation OK + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} GET Single Network Service Descriptor (Negative: Not found) @@ -60,6 +64,7 @@ PATCH Single Network Service Descriptor - (Disabling a nsdInfo) Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set Headers {"If-Match": "${original_etag[0]}"} ${body}= Get File jsons/NsdInfoModificationDisable.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} ${body} @@ -83,7 +88,7 @@ PATCH Single Network Service Descriptor - (Enabling an previously disabled nsdIn Log Validation of NsdInfoModifications OK -PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previously enabled nsdInfo) +PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable a previously enabled nsdInfo) Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} @@ -104,13 +109,13 @@ PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previous Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be modified by another entity Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${original_etag[0]}"} ${body}= Get File jsons/NsdInfoModificationEnable.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${modifiedNsdInfoId} ${body} Integer response status 412 Log Received 412 Precondition failed as expected - ${returned_etag}= Output response headers Etag + ${returned_etag}= Output response headers ETag Log Verify different etags Should Not Be Equal ${Etag} ${returned_etag} ${contentType}= Output response headers Content-Type diff --git a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot index 58a279271757dfc51c16a652ccc8f9f046e4c5fb..27fe2485b2ec809631fa686fb2a443b1ed0b1fb2 100644 --- a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot +++ b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot @@ -4,7 +4,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} Library JSONLibrary Library JSONSchemaLibrary schemas/ Library OperatingSystem -Suite Teardown Terminate All Processes kill=true +#Suite Teardown Terminate All Processes kill=true Library MockServerLibrary Library Process diff --git a/SOL005/NSFaultManagement-API/Subscriptions.robot b/SOL005/NSFaultManagement-API/Subscriptions.robot index bfb48bf8b32c22842a07621ebd7281e0ba1d61a4..8b1c16752aff12b9fc1f4b851ce115cd6c0cfcf7 100644 --- a/SOL005/NSFaultManagement-API/Subscriptions.robot +++ b/SOL005/NSFaultManagement-API/Subscriptions.robot @@ -3,6 +3,7 @@ Resource environment/variables.txt Resource NSFMOperationKeywords.robot Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} Library OperatingSystem +Library DependencyLibrary Library JSONLibrary Library JSONSchemaLibrary schemas/ diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index f13d6bfe58d77e00668f554c93cf19be00355305..319dd27be62ed98454f7b5a16a6cb38ef81d1a3c 100644 --- a/SOL005/NSFaultManagement-API/environment/variables.txt +++ b/SOL005/NSFaultManagement-API/environment/variables.txt @@ -40,7 +40,7 @@ ${AlarmListRebuiltNotification} {} ${response} {} -&{req_mock} {} -&{resp_mock} {} +${req_mock} {} +${resp_mock} {}