Commit 934f6047 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSLCM individual NS Instances

parent e62f6a5b
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -85,3 +85,28 @@ DELETE Individual NSInstance Conflict
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check Postcondition NS Instance is not deleted

DELETE Individual NSInstance with permitted authorization scope
     [Documentation]    Test ID: 5.3.2.2.7
    ...    Test title: DELETE Individual NSInstance with permitted authorization scope
    ...    Test objective: The objective is to test that DELETE method delete a not INSTANTIATED NS instance with permitted authorization scope
    ...    Pre-conditions: NS instance is not INSTANTIATED .
    ...    Reference: Clause 6.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: Check Postcondition NS Instance is deleted
    DELETE IndividualNSInstance with permitted authorization scope  
    Check HTTP Response Status Code Is    204
    Check Postcondition NS Instance is deleted

DELETE Individual NSInstance with not permitted authorization scope
     [Documentation]    Test ID: 5.3.2.2.8
    ...    Test title: DELETE Individual NSInstance with not permitted authorization scope
    ...    Test objective: The objective is to test that DELETE method fails to delete a not INSTANTIATED NS instance when using a not permitted authorization scope
    ...    Pre-conditions: NS instance is not INSTANTIATED .
    ...    Reference: Clause 6.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    DELETE IndividualNSInstance with not permitted authorization scope  
    Check HTTP Response Status Code Is    401
 No newline at end of file
+20 −1
Original line number Diff line number Diff line
@@ -571,6 +571,25 @@ DELETE IndividualNSInstance
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

DELETE IndividualNSInstance with permitted authorization scope
    log    Trying to delete an individual VNF instance
    ${scopeValue}=    Create Dictionary    scope=${NSINSTANCE_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}
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	
	
DELETE IndividualNSInstance with not permitted authorization scope
    log    Trying to delete an individual VNF instance
    ${scopeValue}=    Create Dictionary    scope=${NSINSTANCE_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}
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

DELETE IndividualNSInstance Conflict
    log    Trying to delete an individual VNF instance