Commit 99abe8d9 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSLCM Op Occs

parent 32d2301c
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -197,3 +197,28 @@ GET status information about multiple NS LCM occurrences - Filter
	GET NS LCM OP Occurrences using filtering parameters
	Check HTTP Response Status Code Is    200
	Check HTTP Response Body Json Schema Is    NsLcmOpOccs

GET status information about multiple NS LCM occurrences with permitted authorization scope 
     [Documentation]    Test ID: 5.3.2.8.16
    ...    Test title: GET status information about multiple NS LCM occurrences with permitted authorization scope
    ...    Test objective: The objective is to test that GET method returns a list of LCM occurrences of the NS with permitted authorization scope
    ...    Pre-conditions: At least one LCM occurrences available in the NFVO
    ...    Reference: Clause 6.4.9.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
	GET NS LCM OP Occurrences with permitted authorization scope
	Check HTTP Response Status Code Is    200
	Check HTTP Response Body Json Schema Is    NsLcmOpOccs

GET status information about multiple NS LCM occurrences with not permitted authorization scope 
     [Documentation]    Test ID: 5.3.2.8.17
    ...    Test title: GET status information about multiple NS LCM occurrences with not permitted authorization scope
    ...    Test objective: The objective is to test that GET method returns a list of LCM occurrences of the NS with permitted authorization scope
    ...    Pre-conditions: At least one LCM occurrences available in the NFVO
    ...    Reference: Clause 6.4.9.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
	GET NS LCM OP Occurrences with not permitted authorization scope
	Check HTTP Response Status Code Is    401
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -1028,6 +1028,28 @@ DELETE NS LCM OP Occurrences
	Set Global Variable    ${response}    ${outputResponse}
	
GET NS LCM OP Occurrences
    Log    Query status information about multiple NS lifecycle management operation occurrences.
	Set Headers  {"Accept":"${ACCEPT}"}  
    ${scopeValue}=    Create Dictionary    scope=${OPCCS_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}/ns_lcm_op_occs
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

GET NS LCM OP Occurrences with permitted authorization scope
    Log    Query status information about multiple NS lifecycle management operation occurrences.
	Set Headers  {"Accept":"${ACCEPT}"}  
    ${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}/ns_lcm_op_occs
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

GET NS LCM OP Occurrences with not permitted authorization scope
    Log    Query status information about multiple NS lifecycle management operation occurrences.
	Set Headers  {"Accept":"${ACCEPT}"}  
	Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
+3 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ ${SCALE_PERMITTED_SCOPE} nslcm:v2:scale
${UPDATE_PERMITTED_SCOPE}    nslcm:v2:update
${HEAL_PERMITTED_SCOPE}    nslcm:v2:heal
${TERMINATE_PERMITTED_SCOPE}    nslcm:v2:tearminate
${OPOCCS_PERMITTED_SCOPE}    nslcm:v2:op_occs

${NOT_PERMITTED_SCOPE}    nslcm:v2:invalid


${CONTENT_TYPE}    application/json