Commit 25e25bd4 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for VNF Snaphot Mgmt individual artifact

parent 4672d187
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -128,3 +128,28 @@ DELETE Individual VNF Snapshot Package Artifact - Method Not implemented
    ...    Post-Conditions: none
    DELETE Individual VNF Snapshot Package Artifact
    Check HTTP Response Status Code Is    405

GET Individual VNF Snapshot Package Artifact with permitted authorization scope
    [Documentation]    Test ID: 5.3.7.10.11
    ...    Test title: GET Information about an individual VNF Snapshot Package with permitted authorization scope
    ...    Test objective: The objective is to fetch the whole content of a VNF snapshot package using GET method with permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Snapshot Package Artifact with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Content-Type Header Is Set For Package Artifact

GET Individual VNF Snapshot Package Artifact with not permitted authorization scope
    [Documentation]    Test ID: 5.3.7.10.12
    ...    Test title: GET Information about an individual VNF Snapshot Package with not permitted authorization scope
    ...    Test objective: The objective is to test that fetch the whole content of a VNF snapshot package using GET method fails when using not permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.10.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Snapshot Package Artifact with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -513,6 +513,28 @@ GET Individual VNF Snapshot Package Artifact - Complete
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

GET Individual VNF Snapshot Package Artifact with permitted authorization scope
    log    Trying to fetch the complete contents of an individual VNF Snapshot Package artifact
    Set Headers    {"Accept":"${ACCEPT_OCTET}"}  
    ${scopeValue}=    Create Dictionary    scope=${ARTIFACT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshot_packages/${vnfSnapshotPkgId}/artifacts/${artifactPath} 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

GET Individual VNF Snapshot Package Artifact with not permitted authorization scope
    log    Trying to fetch the complete contents of an individual VNF Snapshot Package artifact
    Set Headers    {"Accept":"${ACCEPT_OCTET}"}  
    ${scopeValue}=    Create Dictionary    scope=${NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshot_packages/${vnfSnapshotPkgId}/artifacts/${artifactPath} 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

GET Individual VNF Snapshot Package Artifact - Range Request
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    log    Trying to get information about an individual VNF Snapshot Package artifact using a range request
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ ${BUILD_PERMITTED_SCOPE} vnfsnapshotpkgm:v2:build
${EXTRACT_PERMITTED_SCOPE}    vnfsnapshotpkgm:v2:extract 
${CANCEL_PERMITTED_SCOPE}    vnfsnapshotpkgm:v2:cancel 
${ACCESS_PERMITTED_SCOPE}    vnfsnapshotpkgm:v2:ext_artifacts_access
${ARTIFACT_PERMITTED_SCOPE}    vnfsnapshotpkgm:v2:artifacts:readonly
${NOT_PERMITTED_SCOPE}    vnfsnapshotpkgm:v2:invalid

${ACCEPT_JSON}    application/json