Commit 2d9d84ed authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSLCM individual vnf snapshots

parent d5366f9d
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -90,3 +90,28 @@ DELETE Individual VNF Snapshot - Conflict
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check Postcondition VNF Snapshot Resource Existence

GET Information about an individual VNF Snapshot with permitted authorization scope
    [Documentation]    Test ID: 5.3.2.28.8
    ...    Test title: GET Information about an individual VNF Snapshot with permitted authorization scope
    ...    Test objective: The objective is to GET information about an individual VNF Snapshot with permitted authorization scope
    ...    Pre-conditions: none
    ...    Reference: Clause 6.4.20.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 with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    VnfSnapshotInfo

GET Information about an individual VNF Snapshot with not permitted authorization scope
    [Documentation]    Test ID: 5.3.2.28.9
    ...    Test title: GET Information about an individual VNF Snapshot with permitted authorization scope
    ...    Test objective: The objective is to test that GET information about an individual VNF Snapshot fails when using not permitted authorization scope
    ...    Pre-conditions: none
    ...    Reference: Clause 6.4.20.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 with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+25 −1
Original line number Diff line number Diff line
@@ -2055,6 +2055,30 @@ POST individual VNF Snapshot
	Set Global Variable    ${response}    ${outputResponse}        

GET individual VNF Snapshot
    log    Trying to get information about an individual VNF snapshot
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    ${scopeValue}=    Create Dictionary    scope=${SNAPSHOT_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_snapshots/${vnfSnapshotInfoId} 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

GET individual VNF Snapshot with permitted authorization scope
    log    Trying to get information about an individual VNF snapshot
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    ${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_snapshots/${vnfSnapshotInfoId} 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

GET individual VNF Snapshot with not permitted authorization scope
    log    Trying to get information about an individual VNF snapshot
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}