From 95e31ed7252859c3096d02a2fdd20fe6fc2ec5a3 Mon Sep 17 00:00:00 2001 From: hammad zafar <hammad.zafar@xflowresearch.com> Date: Mon, 8 Mar 2021 20:23:12 +0500 Subject: [PATCH] added a new resource in VNFSnapshotPackageManagement-API --- ...IndividualVNFSnapshotPackageArtifact.robot | 128 ++++++++++++++++++ ...VnfSnapshotPackageManagementKeywords.robot | 13 ++ .../environment/variables.txt | 1 + 3 files changed, 142 insertions(+) create mode 100644 SOL005/VNFSnapshotPackageManagement-API/IndividualVNFSnapshotPackageArtifact.robot diff --git a/SOL005/VNFSnapshotPackageManagement-API/IndividualVNFSnapshotPackageArtifact.robot b/SOL005/VNFSnapshotPackageManagement-API/IndividualVNFSnapshotPackageArtifact.robot new file mode 100644 index 00000000..72384260 --- /dev/null +++ b/SOL005/VNFSnapshotPackageManagement-API/IndividualVNFSnapshotPackageArtifact.robot @@ -0,0 +1,128 @@ +*** Settings *** +Resource VnfSnapshotPackageManagementKeywords.robot + +*** Test Cases *** +POST Individual VNF Snapshot Package Artifact - Method not implemented + [Documentation] Test ID: 5.3.6.10.1 + ... Test title: POST Individual VNF Snapshot Package Artifact - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.1 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + POST Individual VNF Snapshot Package Artifact + Check HTTP Response Status Code Is 405 + +GET Individual VNF Snapshot Package Artifact - Complete File + [Documentation] Test ID: 5.3.6.10.2 + ... Test title: GET Information about an individual VNF Snapshot Package - Complete File + ... Test objective: The objective is to fetch the whole content of a VNF snapshot package using GET method. + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + GET Individual VNF Snapshot Package Artifact - Complete + Check HTTP Response Status Code Is 200 + Check HTTP Content-Type Header Is Set For Package Artifact + +GET Individual VNF Snapshot Package Artifact - Partial Content + [Documentation] Test ID: 5.3.6.10.3 + ... Test title: GET Individual VNF Snapshot Package Artifact - Partial Content + ... Test objective: The objective is to fetch partial content of a VNF snapshot package by sending a range request using GET method. + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: NFVO supports range requests + ... Post-Conditions: none + GET Individual VNF Snapshot Package Artifact - Range Request + Check HTTP Response Status Code Is 206 + Check HTTP Content-Type Header Is Set For Package Artifact + Check HTTP Content-Range Header Is Set + +GET Individual VNF Snapshot Package Artifact - Range Request Not Supported + [Documentation] Test ID: 5.3.6.10.4 + ... Test title: GET Information about an individual VNF Snapshot Package - Range Request Not Supported + ... Test objective: The objective is to test that the whole content of a VNF snapshot package is delivered even with a range request when NFVO does not support range requests. + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: NFVO does not support range requests + ... Post-Conditions: none + GET Individual VNF Snapshot Package Artifact - Range Request + Check HTTP Response Status Code Is 200 + Check HTTP Content-Type Header Is Set For Package Artifact + +GET Individual VNF Snapshot Package Artifact - Range Not Satisfiable + [Documentation] Test ID: 5.3.6.10.5 + ... Test title: GET Information about an individual VNF Snapshot Package - Range Not Satisfiable + ... Test objective: The objective is to test that an error is returned when the byte range passed in the "Range" header does not match any available byte range in the VNF snapshot package file. + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: NFVO supports range requests + ... Post-Conditions: none + GET Individual VNF Snapshot Package Artifact - Invalid Range + Check HTTP Response Status Code Is 416 + +GET Individual VNF Snapshot Package Artifact - Conflict + [Documentation] Test ID: 5.3.6.10.6 + ... Test title: GET Information about an individual VNF Snapshot Package - Conflict + ... Test objective: The objective is to test that an error is returned when the "state" of the VNF snapshot package has a value different from "AVAILABLE". + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The "state" of the VNF snapshot package has a value different from "AVAILABLE". + ... Post-Conditions: none + GET Individual VNF Snapshot Package Artifact - Not Available + Check HTTP Response Status Code Is 409 + +GET Individual VNF Snapshot Package Artifact - External Artifact + [Documentation] Test ID: 5.3.6.10.7 + ... Test title: GET Information about an individual VNF Snapshot Package - External Artifact + ... Test objective: The objective is to test that an error is returned when the "state" of the VNF snapshot package has a value different from "AVAILABLE". + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: The "state" of the VNF snapshot package has a value different from "AVAILABLE". + ... Post-Conditions: none + GET Individual VNF Snapshot Package Artifact - External + Check HTTP Response Status Code Is 302 + Check HTTP Response Contains Resource URI + +PUT Individual VNF Snapshot Package Artifact - Method not implemented + [Documentation] Test ID: 5.3.6.10.8 + ... Test title: PUT Individual VNF Snapshot Package Artifact - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.3 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: VNF Snapshot Package not modified + PUT Individual VNF Snapshot Package Artifact + Check HTTP Response Status Code Is 405 + +PATCH Individual VNF Snapshot Package Artifact - Method Not implemented + [Documentation] Test ID: 5.3.6.10.9 + ... Test title: PATCH Individual VNF Snapshot Package Artifact + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.4 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PATCH Individual VNF Snapshot Package Artifact + Check HTTP Response Status Code Is 405 + +DELETE Individual VNF Snapshot Package Artifact - Method Not implemented + [Documentation] Test ID: 5.3.6.10.10 + ... Test title: DELETE Individual VNF Snapshot Package Artifact - Method Not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 11.4.10.3.5 - ETSI GS NFV-SOL 005 [3] v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + DELETE Individual VNF Snapshot Package Artifact + Check HTTP Response Status Code Is 405 \ No newline at end of file diff --git a/SOL005/VNFSnapshotPackageManagement-API/VnfSnapshotPackageManagementKeywords.robot b/SOL005/VNFSnapshotPackageManagement-API/VnfSnapshotPackageManagementKeywords.robot index b54ed478..1025fefe 100644 --- a/SOL005/VNFSnapshotPackageManagement-API/VnfSnapshotPackageManagementKeywords.robot +++ b/SOL005/VNFSnapshotPackageManagement-API/VnfSnapshotPackageManagementKeywords.robot @@ -435,12 +435,21 @@ GET Individual VNF Snapshot Package Artifact - Invalid Range Set Global Variable ${response} ${outputResponse} GET Individual VNF Snapshot Package Artifact - Not Available + Check Conflict State for Extract VNF Snapshot Package Content Log Trying to get information about an individual artifact of a VNF Snapshot Package which is not in AVAILABLE state Set Headers {"Accept":"${ACCEPT_OCTET}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshot_packages/${vnfSnapshotPkgId_notInAvailableState}/artifacts/${artifactPath} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} + +GET Individual VNF Snapshot Package Artifact - External + log Trying to fetch information about an external VNF Snapshot artifact + Set Headers {"Accept":"${ACCEPT_OCTET}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshot_packages/${vnfSnapshotPkgId}/artifacts/${ext_artifactPath} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} PUT Individual VNF Snapshot Package Artifact log Trying to perform a PUT. This method should not be implemented @@ -468,6 +477,10 @@ DELETE Individual VNF Snapshot Package Artifact ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} +Check HTTP Response Contains Resource URI + ${ResourceURI}= Get Value From Json ${response['headers']} $..Location + Should Not Be Empty ${ResourceURI} + Check HTTP Content-Type Header Is Set For Package Artifact Log Check Content-Type HTTP Header Should Contain ${response['headers']} Content-Type diff --git a/SOL005/VNFSnapshotPackageManagement-API/environment/variables.txt b/SOL005/VNFSnapshotPackageManagement-API/environment/variables.txt index e614f4a8..0c2117dd 100644 --- a/SOL005/VNFSnapshotPackageManagement-API/environment/variables.txt +++ b/SOL005/VNFSnapshotPackageManagement-API/environment/variables.txt @@ -74,6 +74,7 @@ ${vndIdZipVnfd} f5b220d4-6177-4ebb-a554-a43311e16075 ${artifactPath} artifactPath +${ext_artifactPath} artifactPath/external ${CONTENT_TYPE_OCTET} application/octet-stream ${NFVO_RANGE_OK} 1 # If 1 means that Range is supported by the NFVO ${range} bytes=0-1023 -- GitLab