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

added oauth scope tests for NSLCM vnf snapshots

parent 8c3ed067
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1921,6 +1921,30 @@ GET multiple VNF Snapshots
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 	

GET multiple VNF Snapshots with permitted authorization scope	
    Log    Query VNF The GET method queries information about multiple VNF snapshots.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    ${scopeValue}=    Create Dictionary    scope=${SNAPSHOT_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}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots 
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 		

GET multiple VNF Snapshots with not permitted authorization scope	
    Log    Query VNF The GET method queries information about multiple VNF snapshots.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    ${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}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots 
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

GET multiple VNF Snapshots with bad attribute	
    Log    Query VNF The GET method queries information about multiple VNF snapshots.
    Set Headers  {"Accept":"${ACCEPT}"}  
+26 −1
Original line number Diff line number Diff line
@@ -192,3 +192,28 @@ GET information about multiple VNF Snapshots using Filter
    GET multiple VNF Snapshots using filter
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    VnfSnapshotsInfo

GET information about multiple VNF Snapshots with permitted authorization scope 
    [Documentation]    Test ID: 5.3.2.27.16
    ...    Test title: GET information about multiple VNF Snapshots with permitted authorization scope 
    ...    Test objective: The objective is to get information about multiples VNF snapshots with permitted authorization scope 
    ...    Pre-conditions: none
    ...    Reference: Clause 6.4.19.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET multiple VNF Snapshots with permitted authorization scope 
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    VnfSnapshotsInfo

GET information about multiple VNF Snapshots with not permitted authorization scope 
    [Documentation]    Test ID: 5.3.2.27.17
    ...    Test title: GET information about multiple VNF Snapshots with not permitted authorization scope 
    ...    Test objective: The objective is to test that get information about multiples VNF snapshots fails when using not permitted authorization scope 
    ...    Pre-conditions: none
    ...    Reference: Clause 6.4.19.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET multiple VNF Snapshots with not permitted authorization scope 
    Check HTTP Response Status Code Is    401
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@ ${HEAL_PERMITTED_SCOPE} nslcm:v2:heal
${TERMINATE_PERMITTED_SCOPE}    nslcm:v2:tearminate
${OPOCCS_PERMITTED_SCOPE}    nslcm:v2:op_occs
${OPOCCS_NOT_PERMITTED_SCOPE}    nslcm:v2:op_occs:readonly
${SUBSCRIPTIONS_NOT_PERMITTED_SCOPE}    nslcm:v2:subscriptions

${SUBSCRIPTIONS_PERMITTED_SCOPE}    nslcm:v2:subscriptions
${SNAPSHOT_PERMITTED_SCOPE}    nslcm:v2:subscriptions
${NOT_PERMITTED_SCOPE}    nslcm:v2:invalid