diff --git a/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot b/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot index db5402f17e0dc995ad31b0aca26f36aa51b7d37b..298ca365a252e60c7bfadbed6512fce5fd7a8a7a 100644 --- a/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot +++ b/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot @@ -2,65 +2,82 @@ Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters Resource environment/individualVnfPackage.txt +Resource VNFPackageManagementKeywords.robot Library JSONLibrary Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** GET Individual VNF Package - Log Trying to get a VNF Package present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate response - ${vnfPkgInfo}= Output response body - Validate Json vnfPkgInfo.schema.json ${vnfPkgInfo} - Log Validation OK + [Documentation] Test ID: 7.3.3.2.1 + ... Test title: GET Individual VNF Package + ... Test objective: The objective is to test the retrieval of an individual VNF package information perform a JSON schema validation of the collected data structure + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Individual VNF Package + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfPkgInfo + Check HTTP Response Body vnfPkgInfo Identifier matches the requested VNF Package -GET Individual VNF Package - Negative (Not Found) - Log Trying to perform a negative get, using wrong authorization bearer - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPackageId} - 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 body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK +GET Individual VNF Package with invalid resource identifier + [Documentation] Test ID: 7.3.3.2.2 + ... Test title: GET Individual VNF Package with invalid resource identifier + ... Test objective: The objective is to test that the retrieval of an individual VNF package fails when using an invalid resource identifier + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Individual VNF Package with invalid resource identifier + Check HTTP Response Status Code Is 404 -POST Individual VNF Package - (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected +POST Individual VNF Package - Method not implemented + [Documentation] Test ID: 7.3.3.2.3 + ... Test title: POST Individual VNF Package - Method not implemented + ... Test objective: The objective is to test that POST method is not allowed to create new VNF Package + ... Pre-conditions: none + ... Reference: section 10.4.3.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send POST Request for individual VNF Package + Check HTTP Response Status Code Is 405 -PUT Individual VNF Package - (Method not implemented) - 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}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected +PUT Individual VNF Package - Method not implemented + [Documentation] Test ID: 7.3.3.2.4 + ... Test title: PUT Individual VNF Package - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to modify a VNF Package + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: The VNF Package is not deleted by the failed operation + Send PUT Request for individual VNF Package + Check HTTP Response Status Code Is 405 -PATCH Individual VNF Package - (Method not implemented) - 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}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected +PATCH Individual VNF Package - Method not implemented + [Documentation] Test ID: 7.3.3.2.5 + ... Test title: PATCH Individual VNF Package - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to update a VNF Package + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.3.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for individual VNF Package + Check HTTP Response Status Code Is 405 -DELETE Individual VNF Package - (Method not implemented) - 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}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Integer response status 405 - Log Received 405 Method not implemented as expected +DELETE Individual VNF Package - Method not implemented + [Documentation] Test ID: 7.3.3.2.6 + ... Test title: DELETE Individual VNF Package - Method not implemented + ... Test objective: The objective is to test that DELETE method is not allowed to delete a VNF Package + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.3.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send DELETE Request for individual VNF Package + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Package Exist \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/VNFPackageContent.robot b/SOL003/VNFPackageManagement-API/VNFPackageContent.robot index 8972f5d24fe1c9c54b230741e0d12bd2df44c825..7318bea06c1d075f44c37e2e686e46d1dc6d2aa0 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackageContent.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackageContent.robot @@ -2,107 +2,134 @@ Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters Resource environment/vnfPackageContent.txt +Resource VNFPackageManagementKeywords.robot Library JSONLibrary Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** -GET VNF Package Content - Log Trying to get a VNF Package Content - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_ZIP} +GET Individual VNF Package Content + [Documentation] Test ID: 7.3.3.3.1 + ... Test title: GET Individual VNF Package Content + ... Test objective: The objective is to test the retrieval of an individual VNF package content and perform a validation that returned content is in zip format + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Individual VNF Package Content + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Content-Type Is application/zip -GET VNF Package Content - Range - Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it - Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Set Headers {"Range": "${range}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 206 - Log Received 206 Partial Content as expected. - ${headers}= Output response headers - Should Contain ${headers} Content-Range - Log Header Content-Range is present - Should Contain ${headers} Content-Length - Log Header Content-Length is present +GET Individual VNF Package Content with Range Request and NFVO supporting Range Requests + [Documentation] Test ID: 7.3.3.3.2 + ... Test title: GET Individual VNF Package Content with Range Request and NFVO supporting Range Requests + ... Test objective: The objective is to test the retrieval of an individual VNF package content when using a range request to return single range of bytes from the file, with the NFVO supporting it. The test also perform a validation that returned content matches the issued range + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The NFVO supports range requests to return single range of bytes from the VNF package file + ... Post-Conditions: none + GET Individual VNF Package Content with Range Request + Check HTTP Response Status Code Is 206 + Check HTTP Response Header Content-Type Is application/zip + Check HTTP Response Header Content-Range Is Present and Matches the requested range + Check HTTP Response Header Content-Length Is Present and Matches the requested range length +GET Individual VNF Package Content with Range Request and NFVO not supporting Range Requests + [Documentation] Test ID: 7.3.3.3.3 + ... Test title: GET Individual VNF Package Content with Range Request and NFVO not supporting Range Requests + ... Test objective: The objective is to test that the retrieval of an individual VNF package content, when using a range request to return single range of bytes from the file and the NFVO not supporting it, returns the full VNF Package file. + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The NFVO does not support range requests to return single range of bytes from the VNF package file + ... Post-Conditions: none + GET Individual VNF Package Content with Range Request + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Content-Type Is application/zip -GET VNF Package Content - Negative Range - Log Trying to get a range of bytes of the limit of the VNF Package - Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Set Headers {"Range": "${erroneousRange}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 416 - Log Received 416 Range not satisfiable as expected. - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK +GET Individual VNF Package Content with invalid Range Request + [Documentation] Test ID: 7.3.3.3.4 + ... Test title: GET Individual VNF Package Content with invalid Range Request + ... Test objective: The objective is to test that the retrieval of an individual VNF package content fails when using a range request that does not match any available byte range in the file. + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The NFVO supports range requests to return single range of bytes from the VNF package file + ... Post-Conditions: none + GET Individual VNF Package Content with invalid Range Request + Check HTTP Response Status Code Is 416 + +GET Individual VNF Package Content with invalid resource identifier + [Documentation] Test ID: 7.3.3.3.5 + ... Test title: GET Individual VNF Package Content with invalid resource identifier + ... Test objective: The objective is to test that the retrieval of an individual VNF package content fails when using an invalid resource identifier + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Individual VNF Package Content with invalid resource identifier + Check HTTP Response Status Code Is 404 -GET VNF Package Content - Negative (Not Found) - Log Trying to perform a negative get, using an erroneous package ID - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/package_content - 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 body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK +GET Individual VNF Package Content with conflict due to onboarding state + [Documentation] Test ID: 7.3.3.3.6 + ... Test title: GET Individual VNF Package Content with conflict due to onboarding state + ... Test objective: The objective is to test that the retrieval of an individual VNF package content fails due to a conflict when the VNF Package is not in onboarding state ONBOARDED in the NFVO. The test also performs a validation of the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: The onboarding state of the VNF package for which the content is requested is different from ONBOARDED. + ... Reference: section 10.4.5.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Content for VNF Package in onboarding state different from ONBOARDED + Check HTTP Response Status Code Is 409 + Check HTTP Response Body Json Schema Is ProblemDetails -GET VNF Package Content - Negative (onboardingState issue) - Log Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/package_content - Integer response status 409 - Log Received 409 Conflict as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK +POST Individual VNF Package Content - Method not implemented + [Documentation] Test ID: 7.3.3.3.7 + ... Test title: POST Individual VNF Package Content - Method not implemented + ... Test objective: The objective is to test that POST method is not allowed to create new VNF Package content + ... Pre-conditions: none + ... Reference: section 10.4.3.5.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send POST Request for individual VNF Package + Check HTTP Response Status Code Is 405 -POST VNF Package Content - (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected +PUT Individual VNF Package Content - Method not implemented + [Documentation] Test ID: 7.3.3.3.8 + ... Test title: PUT Individual VNF Package Content - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to modify a VNF Package content + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.5.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send PUT Request for individual VNF Package + Check HTTP Response Status Code Is 405 -PUT VNF Package Content - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected +PATCH Individual VNF Package Content - Method not implemented + [Documentation] Test ID: 7.3.3.3.9 + ... Test title: PATCH Individual VNF Package Content - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to update a VNF Package content + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.5.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for individual VNF Package + Check HTTP Response Status Code Is 405 -PATCH VNF Package Content - (Method not implemented) - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected - -DELETE VNF Package Content - (Method not implemented) - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Integer response status 405 - Log Received 405 Method not implemented as expected +DELETE Individual VNF Package Content - Method not implemented + [Documentation] Test ID: 7.3.3.3.10 + ... Test title: DELETE Individual VNF Package Content - Method not implemented + ... Test objective: The objective is to test that DELETE method is not allowed to delete a VNF Package content + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.3.5.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: The VNF Package content is not deleted by the failed operation + Send DELETE Request for individual VNF Package + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Package Content Exist \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index dcaa1ca367787acbc7909baed0feac05f15b2796..54c59717d6c223c9b971c4e676ec8d386fe99c7b 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -1,6 +1,9 @@ *** Settings *** Resource environment/variables.txt Resource environment/subscriptions.txt +Resource environment/vnfPackages.txt +Resource environment/individualVnfPackage.txt +Resource environment/vnfPackageContent.txt Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false Library MockServerLibrary Library OperatingSystem @@ -12,6 +15,326 @@ Library Process *** Keywords *** +Get all VNF Packages + Log Trying to get all VNF Packages present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Body Does Not Contain softwareImages + Log Checking that field element is missing + ${softwareImages}= Get Value From Json ${response['body']} $..softwareImages + Should Be Empty ${softwareImages} + Log Element is empty as expected + +Check HTTP Response Body Does Not Contain additionalArtifacts + Log Checking that field element is missing + ${additionalArtifacts}= Get Value From Json ${response['body']} $..additionalArtifacts + Should Be Empty ${additionalArtifacts} + Log Element is empty as expected + +Check HTTP Response Body Does Not Contain userDefinedData + Log Checking that field element is missing + ${userDefinedData}= Get Value From Json ${response['body']} $..userDefinedData + Should Be Empty ${userDefinedData} + Log Element is empty as expected + +GET VNF Packages with attribute-based filter + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${POS_FILTER} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Body VnfPkgsInfo Matches the requested Attribute-Based Filter + Log Checking that attribute-based filter is matched + #todo + +GET VNF Packages with invalid attribute-based filter + Log Trying to perform a negative get, filtering by the inexistent filter 'nfvId' + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${NEG_FILTER} + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET VNF Packages with all_fields attribute selector + Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?all_fields + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Body VnfPkgsInfo Matches the requested all_fields selector + Log Trying to validate softwareImages schema + ${softwareImages}= Get Value From Json ${response['body']} $..softwareImages + Validate Json softwareImage.schema.json ${softwareImages[0]} + Log Validation for softwareImage schema OK + Log Trying to validate additionalArtifacts schema + ${additional_artifacts}= Get Value From Json ${response['body']} $..additionalArtifacts + Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} + Log Validation for additionalArtifacts schema OK + ${links}= Get Value From Json ${response['body']} $.._links + Validate Json links.schema.json ${links[0]} + Log Validation for _links schema OK + +GET VNF Packages with exclude_default attribute selector + Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_default + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Body VnfPkgsInfo Matches the requested exclude_default selector + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${response['body']} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${response['body']} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + +GET VNF Packages with fields attribute selector + Log Trying to get all VNF Packages present in the NFVO Catalogue, using fields + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use fields parameter + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Body vnfPkgsInfo Matches the requested fields selector + Log Trying to validate softwareImages schema + ${softwareImages}= Get Value From Json ${response['body']} $..softwareImages + Validate Json softwareImage.schema.json ${softwareImages[0]} + Log Validation for softwareImage schema OK + Log Trying to validate additionalArtifacts schema + ${additional_artifacts}= Get Value From Json ${response['body']} $..additionalArtifacts + Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} + Log Validation for additionalArtifacts schema OK + +GET VNF Packages with exclude_fields attribute selector + Log Trying to get all VNF Packages present in the NFVO Catalogue, using fields + Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use fields parameter + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Body vnfPkgsInfo Matches the requested exclude_fields selector + Log Checking missing information for softwareImages element + ${softwareImages}= Get Value From Json ${response['body']} $..softwareImages + Should Be Empty ${softwareImages} + Log softwareImages element is missing as excepted + Log Checking missing information for additionalArtifact element + ${additional_artifacts}= Get Value From Json ${response['body']} $..additionalArtifacts + Should Be Empty ${additional_artifacts} + Log additionalArtifact element is missing as excepted + +GET all VNF Packages 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}/vnf_package + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send POST Request for all VNF Packages + Log Trying to perform a POST (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PUT Request for all VNF Packages + Log Trying to perform a PUT (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PATCH Request for all VNF Packages + Log Trying to perform a PATCH (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send DELETE Request for all VNF Packages + Log Trying to perform a DELETE (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check Postcondition VNF Packages Exist + Log Checking that Pm Job still exists + GET all VNF Packages + +GET Individual VNF Package + Log Trying to get a VNF Package present in the NFVO Catalogue + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Body vnfPkgInfo Identifier matches the requested VNF Package + Log Going to validate pacakge info retrieved + Should Be Equal ${response['body']['id']} ${vnfPackageId} + Log Pacakge identifier as expected + +GET Individual VNF Package with invalid resource identifier + Log Trying to perform a negative get, using wrong authorization bearer + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPackageId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send POST Request for individual VNF Package + Log Trying to perform a POST (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PUT Request for individual VNF Package + Log Trying to perform a PUT (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PATCH Request for individual VNF Package + Log Trying to perform a PATCH (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send DELETE Request for individual VNF Package + Log Trying to perform a DELETE (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check Postcondition VNF Package Exist + Log Checking that vnf pacakge still exists + GET Individual VNF Package + +GET Individual VNF Package Content + Log Trying to get a VNF Package Content + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Header Content-Type Is + [Arguments] ${header} + Should Contain ${response['headers']['Content-Type']} ${header} + +GET Individual VNF Package Content with Range Request + Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check HTTP Response Header Content-Range Is Present and Matches the requested range + Log Check Content-Range HTTP Header + Should Contain ${response['headers']} Content-Range + Should Be Equal As Strings ${response['headers']['Content-Range']} ${range} + Log Header Content-Range is present + +Check HTTP Response Header Content-Length Is Present and Matches the requested range length + Log Check Content-Length HTTP Header + Should Contain ${response['headers']} Content-Length + Should Be Equal As Integers ${response['headers']['Content-Length']} ${length} + Log Header Content-Length is present + +GET Individual VNF Package Content with invalid Range Request + Log Trying to get a range of bytes of the limit of the VNF Package + Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${erroneousRange}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET Individual VNF Package Content with invalid resource identifier + Log Trying to perform a negative get, using an erroneous package ID + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET Content for VNF Package in onboarding state different from ONBOARDED + Log Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send POST Request for individual VNF Package Content + Log Trying to perform a POST (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PUT Request for individual VNF Package Content + Log Trying to perform a PUT (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send PATCH Request for individual VNF Package Content + Log Trying to perform a PATCH (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +Send DELETE Request for individual VNF Package Content + Log Trying to perform a DELETE (method should not be implemented) + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + ${output}= Output response + Set Suite Variable ${response} ${output} + +Check Postcondition VNF Package Content Exist + Log Checking that vnf pacakge still exists + GET Individual VNF Package Content + Get all VNF Package Subscriptions Log Trying to get the list of subscriptions Set Headers {"Accept": "${ACCEPT_JSON}"} @@ -20,8 +343,6 @@ Get all VNF Package Subscriptions ${output}= Output response Set Suite Variable ${response} ${output} - - Get VNF Package Subscriptions with attribute-based filters Log Trying to get the list of subscriptions using filters Set Headers {"Accept": "${ACCEPT_JSON}"} @@ -29,9 +350,6 @@ Get VNF Package Subscriptions with attribute-based filters GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} ${output}= Output response Set Suite Variable ${response} ${output} - - - Get VNF Package Subscriptions with invalid attribute-based filters Log Trying to get the list of subscriptions using filters with wrong attribute name @@ -40,9 +358,7 @@ Get VNF Package Subscriptions with invalid attribute-based filters GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ko} ${output}= Output response Set Suite Variable ${response} ${output} - - - + Get VNF Package Subscriptions with invalid resource endpoint Log Trying to perform a request on a Uri which doesn't exist Set Headers {"Accept": "${ACCEPT_JSON}"} @@ -51,8 +367,6 @@ Get VNF Package Subscriptions with invalid resource endpoint ${output}= Output response Set Suite Variable ${response} ${output} - - Send Post Request for VNF Package Subscription Log Trying to create a new subscription Set Headers {"Accept": "${ACCEPT_JSON}"} @@ -110,8 +424,7 @@ Check HTTP Response Status Code Is Should Be Equal ${response['status']} ${expected_status} Log Status code validated - - + Check HTTP Response Body Json Schema Is [Arguments] ${input} Should Contain ${response['headers']['Content-Type']} application/json diff --git a/SOL003/VNFPackageManagement-API/VNFPackages.robot b/SOL003/VNFPackageManagement-API/VNFPackages.robot index 7199d62af02aa6837f5f2f902601663acf1784db..506794c8eb7dbc50e190dfc820b823b6e4ca1c8e 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackages.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackages.robot @@ -2,216 +2,167 @@ Resource environment/vnfPackages.txt # VNF Packages specific parameters Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters +Resource VNFPackageManagementKeywords.robot Library JSONLibrary Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** -GET all Packages - Log Trying to get all VNF Packages present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - 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 vnfPkgsInfo.schema.json ${result} - Log Validation OK - Log Checking missing information for softwareImages element - ${softwareImages}= Get Value From Json ${result} $..softwareImages - Should Be Empty ${softwareImages} - Log softwareImages element is missing as excepted - Log Checking missing information for additionalArtifact element - ${additional_artifacts}= Get Value From Json ${result} $..additionalArtifacts - Should Be Empty ${additional_artifacts} - Log additionalArtifact element is missing as excepted +GET all VNF Packages + [Documentation] Test ID: 7.3.3.1.1 + ... Test title: GET all VNF Packages + ... Test objective: The objective is to test the retrieval of all the available VNF packages information and perform a JSON schema and content validation of the collected data structure + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET all VNF Packages + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfPkgsInfo + Check HTTP Response Body Does Not Contain softwareImages + Check HTTP Response Body Does Not Contain additionalArtifacts + Check HTTP Response Body Does Not Contain userDefinedData -GET all Packages - Filter - Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${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 vnfPkgsInfo.schema.json ${result} - Log Validation OK +GET VNF Packages with attribute-based filter + [Documentation] Test ID: 7.3.3.1.2 + ... Test title: GET VNF Packages with attribute-based filter + ... Test objective: The objective is to test the retrieval of VNF packages 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: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET VNF Packages with attribute-based filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfPkgsInfo + Check HTTP Response Body VnfPkgsInfo Matches the requested attribute-based filter -GET all Packages - Negative (wronge filter name) - Log Trying to perform a negative get, filtering by the inexistent filter 'nfvId' - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${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 body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -GET all Packages - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK - -GET all Packages - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Set Headers {"Accept": "${ACCEPT_JSON}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 401 - Log Received 401 Unauthorized as expected - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK +GET VNF Packages with invalid attribute-based filter + [Documentation] Test ID: 7.3.3.1.3 + ... Test title: GET VNF Packages with invalid attribute-based filter + ... Test objective: The objective is to test that the retrieval of VNF packages fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET VNF Packages with invalid attribute-based filter + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails GET all Packages - all_fields - Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?all_fields - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - Log Trying to validate response - Validate Json vnfPkgsInfo.schema.json ${vnfPkgInfos} - Log Validation OK - Log Trying to validate softwareImages schema - ${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages - Validate Json softwareImage.schema.json ${softwareImages[0]} - Log Validation for softwareImage schema OK - Log Trying to validate additionalArtifacts schema - ${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts - Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} - Log Validation for additionalArtifacts schema OK - ${links}= Get Value From Json ${vnfPkgInfos} $.._links - Validate Json links.schema.json ${links[0]} - Log Validation for _links schema OK + [Documentation] Test ID: 7.3.3.1.4 + ... Test title: GET VNF Packages with all_fields attribute selector + ... Test objective: The objective is to test the retrieval of VNF packages with all_fields attribute selector, perform a JSON schema validation of the collected data structure, and verify that the retrieved information matches the issued all_fileds selector + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 4.3.3.2.1, 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET VNF Packages with all_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfPkgsInfo + Check HTTP Response Body vnfPkgsInfo Matches the requested all_fields selector -GET all Packages - exclude_default - Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter. - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_default - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - Log Trying to validate response - Validate Json vnfPkgsInfo.schema.json ${vnfPkgInfos} - Log Validation OK - Log Checking missing information for softwareImages element - ${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages - Should Be Empty ${softwareImages} - Log softwareImages element is missing as excepted - Log Checking missing information for additionalArtifact element - ${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts - Should Be Empty ${additional_artifacts} - Log additionalArtifact element is missing as excepted - +GET VNF Packages with exclude_default attribute selector + [Documentation] Test ID: 7.3.3.1.5 + ... Test title: GET VNF Packages with exclude_default attribute selector + ... Test objective: The objective is to test the retrieval of VNF packages with exclude_default attribute selector, perform a JSON schema validation of the collected data structure, and verify that the retrieved information matches the issued exclude_default selector + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 4.3.3.2.1, 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET VNF Packages with exclude_default attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfPkgsInfo + Check HTTP Response Body vnfPkgsInfo Matches the requested exclude_default selector -GET all Packages - fields - Log Trying to get all VNF Packages present in the NFVO Catalogue, using fields - Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use fields parameter - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - Log Trying to validate response, checking vnfPkgInfo and other complex attributes included in the vnfPkgInfo - Validate Json vnfPkgsInfo.schema.json ${vnfPkgInfos} - Log Validation for vnfPkgInfo OK - Log Trying to validate softwareImages schema - ${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages - Validate Json softwareImage.schema.json ${softwareImages[0]} - Log Validation for softwareImage schema OK - Log Trying to validate additionalArtifacts schema - ${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts - Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} - Log Validation for additionalArtifacts schema OK +GET VNF Packages with fields attribute selector + [Documentation] Test ID: 7.3.3.1.6 + ... Test title: GET VNF Packages with fields attribute selector + ... Test objective: The objective is to test the retrieval of VNF packages with fields attribute selector, perform a JSON schema validation of the collected data structure, and verify that the retrieved information matches the issued fields selector + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 4.3.3.2.1, 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The VNFM supports the use of fields attribute selector + ... Post-Conditions: none + GET VNF Packages with fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfPkgsInfo + Check HTTP Response Body vnfPkgsInfo Matches the requested fields selector -GET all Packages - exclude_fields - Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exclude_fields=${fields} - Integer response status 200 - ${contentType}= Output response headers Content-Type - Should Contain ${contentType} ${CONTENT_TYPE_JSON} - ${vnfPkgInfos}= Output response body - Log Checking missing information for softwareImages element - ${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages - Should Be Empty ${softwareImages} - Log softwareImages element is missing as excepted - Log Checking missing information for additionalArtifact element - ${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts - Should Be Empty ${additional_artifacts} - Log additionalArtifact element is missing as excepted +GET VNF Packages with exclude_fields attribute selector + [Documentation] Test ID: 7.3.3.1.7 + ... Test title: GET VNF Packages with exclude_fields attribute selector + ... Test objective: The objective is to test the retrieval of VNF packages with exclude_fields attribute selector, perform a JSON schema validation of the collected data structure, and verify that the retrieved information matches the issued exclude_fields selector + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 4.3.3.2.1, 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The VNFM supports the use of exclude_fields attribute selector + ... Post-Conditions: none + GET VNF Packages with exclude_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfPkgsInfo + Check HTTP Response Body vnfPkgsInfo Matches the requested exclude_fields selector -GET all PACKAGE (Negative: Not found) - 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}/vnf_package - 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 body - Validate Json ProblemDetails.schema.json ${problemDetails} - Log Validation OK +GET all VNF Packages with invalid resource endpoint + [Documentation] Test ID: 7.3.3.1.8 + ... Test title: GET VNF Packages with invalid resource endpoint + ... Test objective: The objective is to test that the retrieval of VNF packages fails when using invalid resource endpoint + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.2.3.2 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET all VNF Packages with invalid resource endpoint + Check HTTP Response Status Code Is 404 -POST all PACKAGE (Method not implemented) - Log Trying to perform a POST (method should not be implemented) - Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected +POST all VNF Packages - Method not implemented + [Documentation] Test ID: 7.3.3.1.9 + ... Test title: POST all VNF Packages - Method not implemented + ... Test objective: The objective is to test that POST method is not allowed to create new VNF Packages + ... Pre-conditions: none + ... Reference: section 10.4.2.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send POST Request for all VNF Packages + Check HTTP Response Status Code Is 405 -PUT all PACKAGE (Method not implemented) - 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}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected +PUT all VNF Packages - Method not implemented + [Documentation] Test ID: 7.3.3.1.10 + ... Test title: PUT all VNF Packages - Method not implemented + ... Test objective: The objective is to test that PUT method is not allowed to modify existing VNF Packages + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.2.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send PUT Request for all VNF Packages + Check HTTP Response Status Code Is 405 -PATCH all PACKAGE (Method not implemented) - 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}"} - PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected +PATCH all VNF Packages - Method not implemented + [Documentation] Test ID: 7.3.3.1.11 + ... Test title: PATCH all VNF Packages - Method not implemented + ... Test objective: The objective is to test that PATCH method is not allowed to update existing VNF Packages + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.2.3.4 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Send PATCH Request for all VNF Packages + Check HTTP Response Status Code Is 405 -DELETE all PACKAGE (Method not implemented) - 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}"} - DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Integer response status 405 - Log Received 405 Method not implemented as expected +DELETE all VNF Packages - Method not implemented + [Documentation] Test ID: 7.3.3.1.12 + ... Test title: DELETE all VNF Packages - Method not implemented + ... Test objective: The objective is to test that DELETE method is not allowed to delete existing VNF Packages + ... Pre-conditions: One or more VNF packages are onboarded in the NFVO. + ... Reference: section 10.4.2.3.5 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: The VNF Packages are not deleted by the failed operation + Send DELETE Request for all VNF Packages + Check HTTP Response Status Code Is 405 + Check Postcondition VNF Packages Exist \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt b/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt index a4fd739b48275fe68b56b56dd4a9f166fc81115e..1fd004bfd7248c4c637c50524c3738628e4f2bca 100644 --- a/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt +++ b/SOL003/VNFPackageManagement-API/environment/vnfPackageContent.txt @@ -2,6 +2,7 @@ ${ACCEPT_ZIP} application/zip ${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO ${range} bytes=0-1023 +${length} 1024 ${erroneousRange} bytes=10000000-1000000000 # Requesting a out of range number of bytes ${erroneousVnfPkgId} erroneousPkgId ${CONTENT_TYPE_ZIP} application/zip diff --git a/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt b/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt index 8efcc7d312d40bf9388877a3de5a3352dab5b324..9786732e6ba2f30f8373efb232ab00fb56a59052 100644 --- a/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt +++ b/SOL003/VNFPackageManagement-API/environment/vnfPackages.txt @@ -2,3 +2,4 @@ ${POS_FILTER} vnfdId=41fdd38a-3d4c-465c-83e0-f80e014425f8 ,vnfProvider=NXW # Positive case, suing compiant fields name for filtering get request ${NEG_FILTER} nfvId=41fdd38a-3d4c-465c-83e0-f80e014425f8 # Negative case, using wrong name of field ${fields} softwareImages,additionalArtifacts +${response} httpresponse