Commit e64fc145 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for VNF Snaphot Mgmt cancel task

parent 9ade82c3
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -74,3 +74,27 @@ DELETE Cancel VNF Snapshot Package Content Task - Method Not implemented
    ...    Post-Conditions: none
    DELETE Cancel VNF Snapshot Package Content Task
    Check HTTP Response Status Code Is    405

POST Cancel VNF Snapshot Package Content Task with permitted authorization scope
    [Documentation]    Test ID: 5.3.7.8.1
    ...    Test title: POST Cancel VNF Snapshot Package Content Task with permitted authorization scope
    ...    Test objective: The objective is to test that  POST method provides the information for the NFVO to cancel the ongoing operation related to the content of a VNF snapshot package with permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.8.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Cancel VNF Snapshot Package Content Task with permitted authorization scope
    Check HTTP Response Status Code Is    202 

POST Cancel VNF Snapshot Package Content Task with not permitted authorization scope
    [Documentation]    Test ID: 5.3.7.8.1
    ...    Test title: POST Cancel VNF Snapshot Package Content Task with not permitted authorization scope
    ...    Test objective: The objective is to test that  POST method fails to  provide the information for the NFVO to cancel the ongoing operation related to the content of a VNF snapshot package when using not permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: Clause 11.4.8.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Cancel VNF Snapshot Package Content Task with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+27 −1
Original line number Diff line number Diff line
@@ -877,6 +877,32 @@ POST Cancel VNF Snapshot Package Content Task
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}    

POST Cancel VNF Snapshot Package Content Task with permitted authorization scope
    Log    Trying to initiate cancelation of VNF Snapshot Content Task
    Set Headers    {"Accept":"${ACCEPT_JSON}"} 
    Set Headers    {"Content-Type":"${CONTENT_TYPE_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${CANCEL_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
    ${body}=    Get File    jsons/CancelVnfSnapshotPkgOperationRequest.json
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshot_packages/${vnfSnapshotPkgId}/package_content/cancel    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

POST Cancel VNF Snapshot Package Content Task with not permitted authorization scope
    Log    Trying to initiate cancelation of VNF Snapshot Content Task
    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
    ${body}=    Get File    jsons/CancelVnfSnapshotPkgOperationRequest.json
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshot_packages/${vnfSnapshotPkgId}/package_content/cancel    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  
    
POST Cancel VNF Snapshot Package Content Task - Conflict
    Check Conflict State for Cancel VNF Snapshot Package Content
    Log    Trying to initiate the cancelation of VNF Snapshot Content task when the state of the VNF Snapshot Package is other than "UPLOADING", "BUILDING", "PROCESSING" or "EXTRACTING".
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ ${CONTENT_NOT_PERMITTED_SCOPE} vnfsnapshotpkgm:v2:package_content:readonly
${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 

${NOT_PERMITTED_SCOPE}    vnfsnapshotpkgm:v2:invalid