Commit 93e3627b authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for individual mano service interfaces

parent 9fa790f5
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -108,3 +108,29 @@ DELETE Individual NFV-MANO Service Interface - Method not implemented
    ...    Post-Conditions: none
    Send Delete request for Individual NFV-MANO Service Interface
    Check HTTP Response Status Code Is    405

PATCH Individual NFV-MANO Service Interface with permitted authorization scope
    [Documentation]    Test ID: 8.3.1.6.9
    ...    Test title: PATCH Individual NFV-MANO Service Interface with permitted authorization scope
    ...    Test objective: This method modifies the Individual NFV-MANO Service Interface resource with permitted authorization scope.
    ...    Pre-conditions: Individual NFV-MANO Service Interface resource is already created.
    ...    Reference: clause 5.5.11.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Individual NFV-MANO Service Interface is modified by the operation
    Send Patch request for Individual NFV-MANO Service Interface with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   ManoServiceInterfaceModifications

PATCH Individual NFV-MANO Service Interface with not permitted authorization scope
    [Documentation]    Test ID: 8.3.1.6.10
    ...    Test title: PATCH Individual NFV-MANO Service Interface with not permitted authorization scope
    ...    Test objective: The objective is to test that modification of Individual NFV-MANO Service Interface resource fails with not permitted authorization scope.
    ...    Pre-conditions: Individual NFV-MANO Service Interface resource is already created.
    ...    Reference: clause 5.5.11.3.4 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Individual NFV-MANO Service Interface is modified by the operation
    Send Patch request for Individual NFV-MANO Service Interface with not permitted authorization scope
    Check HTTP Response Status Code Is    401
+27 −1
Original line number Diff line number Diff line
@@ -536,6 +536,32 @@ Send Patch request for Individual NFV-MANO Service Interface
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Send Patch request for Individual NFV-MANO Service Interface 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=${ENTITY_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/ManoServiceInterfaceModificationRequest.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces/${manoServiceInterfaceId}   ${body}	
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Send Patch request for Individual NFV-MANO Service Interface 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=${ENTITY_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/ManoServiceInterfaceModificationRequest.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces/${manoServiceInterfaceId}   ${body}	
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Delete request for Individual NFV-MANO Service Interface
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT_JSON}"}