Commit 4672d187 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for VNF Snaphot Mgmt access configuration

parent e64fc145
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -76,3 +76,28 @@ DELETE Access Configuration for External Artifacts - Method Not implemented
    ...    Post-Conditions: none
    DELETE Access Configuration for External Artifacts
    Check HTTP Response Status Code Is    405

GET Access Configuration for External Artifacts with permitted authorization scope
    [Documentation]    Test ID: 5.3.7.9.7
    ...    Test title: GET Access Configuration for External Artifacts with permitted authorization scope
    ...    Test objective: The objective is to test that GET method reads the access configuration information that is used by the NFVO to get the content of external VNF snapshot package artifacts with permitted authorization scope.
    ...    Pre-conditions: Individual VNF Snapshot Package resource have been created.
    ...    Reference: Clause 11.4.9.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Access Configuration for External Artifacts with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   VnfSnapshotPkgExtArtifactsAccessConfig

GET Access Configuration for External Artifacts with not permitted authorization scope
    [Documentation]    Test ID: 5.3.7.9.2
    ...    Test title: GET Access Configuration for External Artifacts with not permitted authorization scope
    ...    Test objective: The objective is to test that GET method fails to read the access configuration information that is used by the NFVO to get the content of external VNF snapshot package artifacts when using not permitted authorization scope.
    ...    Pre-conditions: Individual VNF Snapshot Package resource have been created.
    ...    Reference: Clause 11.4.9.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Access Configuration for External Artifacts with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+24 −0
Original line number Diff line number Diff line
@@ -1004,6 +1004,30 @@ GET Access Configuration for External Artifacts
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

GET Access Configuration for External Artifacts with permitted authorization scope
    log    Trying to read the access configuration information that is used by the NFVO to get the content of external VNF snapshot package artifacts
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${ACCESS_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}/ext_artifacts_access 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

GET Access Configuration for External Artifacts with not permitted authorization scope
    log    Trying to read the access configuration information that is used by the NFVO to get the content of external VNF snapshot package artifacts
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${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}/ext_artifacts_access 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

PATCH Access Configuration for External Artifacts
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ ${URI_PERMITTED_SCOPE} vnfsnapshotpkgm:v2:upload_from_uri
${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
${NOT_PERMITTED_SCOPE}    vnfsnapshotpkgm:v2:invalid

${ACCEPT_JSON}    application/json