Commit 9fa790f5 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for mano service interfaces

parent caff35fe
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -397,6 +397,30 @@ Get NFV-MANO Service Interfaces
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Get NFV-MANO Service Interfaces with permitted authorization scope
    Log    Query to GET information about multiple NFV-MANO service interfaces of the NFV-MANO functional entity.
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    ${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}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Get NFV-MANO Service Interfaces with not permitted authorization scope
    Log    Query to GET information about multiple NFV-MANO service interfaces of the NFV-MANO functional entity.
    Set Headers  {"Accept":"${ACCEPT_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}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Get NFV-MANO Service Interfaces with invalid filter
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
+26 −1
Original line number Diff line number Diff line
@@ -198,3 +198,28 @@ DELETE NFV-MANO Service Interfaces - Method not implemented
    ...    Post-Conditions: none
    Send Delete request for NFV-MANO Service Interfaces
    Check HTTP Response Status Code Is    405

GET NFV-MANO Service Interfaces with permitted authorization scope
    [Documentation]    Test ID: 8.3.1.5.16
    ...    Test title: GET NFV-MANO Service Interfaces with permitted authorization scope
    ...    Test objective: The objective is to query status information about multiple NFV-MANO service interfaces of the NFV-MANO functional entity with permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.10.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions:  none
    Get NFV-MANO Service Interfaces with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ManoServiceInterfaces

GET NFV-MANO Service Interfaces with not permitted authorization scope
    [Documentation]    Test ID: 8.3.1.5.17
    ...    Test title: GET NFV-MANO Service Interfaces with not permitted authorization scope
    ...    Test objective: The objective is test that the query status information about multiple NFV-MANO service interfaces of the NFV-MANO functional entity fails when using not permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.10.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions:  none
    Get NFV-MANO Service Interfaces with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file