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

added oauth scope tests for individual peer entities

parent d52b68ec
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -107,3 +107,28 @@ DELETE Individual Peer Entity - Method not implemented
    ...    Post-Conditions: none
    Send Delete request for Individual Peer Entity
    Check HTTP Response Status Code Is    405

PATCH Individual Peer Entity with permitted authorization scope
    [Documentation]    Test ID: 8.3.1.9.9
    ...    Test title: PATCH Individual Peer Entity with permitted authorization scope
    ...    Test objective: This method modifies configuration and information of the producer NFV-MANO functional entity with permitted authorization scope.
    ...    Pre-conditions: At least one Peer Entity resource is created
    ...    Reference: clause 5.5.14.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Peer Entity Resource is modified by the operation
    Send Patch request for Individual Peer Entity with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PeerEntityConfigModifications

PATCH Individual Peer Entity with not permitted authorization scope
    [Documentation]    Test ID: 8.3.1.9.10
    ...    Test title: PATCH Individual Peer Entity with not permitted authorization scope
    ...    Test objective: This method tests that modification of configuration and information of the producer NFV-MANO functional entity fails with not permitted authorization scope.
    ...    Pre-conditions: At least one Peer Entity resource is created
    ...    Reference: clause 5.5.14.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Peer Entity Resource is modified by the operation
    Send Patch request for Individual Peer Entity with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
@@ -814,6 +814,32 @@ Send Patch request for Individual Peer Entity
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Send Patch request for Individual Peer Entity with permitted authorization scope
    log    Trying to modify an NFV-MANO Entity
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    ${scopeValue}=    Create Dictionary    scope=${PEER_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/PeerEntityConfigModificationRequest.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}   ${body}	
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Send Patch request for Individual Peer Entity with not permitted authorization scope
    log    Trying to modify an NFV-MANO Entity
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    ${scopeValue}=    Create Dictionary    scope=${PEER_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/PeerEntityConfigModificationRequest.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}   ${body}	
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Delete request for Individual Peer Entity
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT_JSON}"}