Commit a36def27 authored by Eisha Ayaz's avatar Eisha Ayaz
Browse files

[test-new][SOL002][VNF-FM][v5.3.1][6.3.4.x.x Test-IDs][NFVSOL(26)000093] New...

[test-new][SOL002][VNF-FM][v5.3.1][6.3.4.x.x Test-IDs][NFVSOL(26)000093] New tests for 401/404 gaps identified by tacker
parent f686723c
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -282,6 +282,18 @@ GET information about multiple alarms with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is    ProblemDetails

GET information about multiple alarms - Unauthorized
    [Documentation]    Test ID: 6.3.4.1.22
    ...    Test title: GET information about multiple alarms - Unauthorized
    ...    Test objective: The objective is to retrieve information about the alarm list without authorization.
    ...    Pre-conditions: none 
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Alarms Task - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails  
*** Keywords ***
POST Alarms Task
    log    Trying to perform a POST. This method should not be implemented
@@ -324,6 +336,14 @@ GET Alarms Task
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
GET Alarms Task - Unauthorized
    Log    Query VNF The GET method queries information about multiple alarms without authorization.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}  
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
GET Alarms Task with filter
	Log    Query VNF The GET method queries information about multiple alarms with filters.
    Set Headers    {"Accept": "${ACCEPT}"}
+24 −1
Original line number Diff line number Diff line
@@ -90,6 +90,19 @@ Escalate the perceived severity with NOT permitted authorization scope
    POST escalate severity with not permitted authorization scope
    Check HTTP Response Status Code Is    403

Escalate the perceived severity - Unauthorized
    [Documentation]    Test ID: 6.3.4.3.8
    ...    Test title: Escalate the perceived severity - Unauthorized
    ...    Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource with unauthorized.
    ...    Pre-conditions: The resource representing the individual alarm has been created
    ...    Reference: Clause 7.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Post escalate severity - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails

*** Keywords ***
Check resource existence
    Set Headers    {"Accept":"${ACCEPT}"}
@@ -110,6 +123,16 @@ POST escalate severity
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST escalate severity - Unauthorized
    Log    escalate the perceived severity of an alarm with the VNFM without authorization.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    ${template}=    Get File    jsons/EscalatePerceivedSeverity.json
    ${body}=    Format String    ${template}    perceivedSeverity=${PerceivedSeverity}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}/escalate    ${body}  
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
GET escalate severity
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
+70 −0
Original line number Diff line number Diff line
@@ -141,6 +141,42 @@ PATCH Individual Alarm with NOT permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is     ProblemDetails

GET information about an individual alarm - Unauthorized
    [Documentation]    Test ID: 6.3.4.2.11
    ...    Test title: GET information about an individual alarm - Unauthorized
    ...    Test objective: The objective is to read an individual alarm without authorization.
    ...    Pre-conditions: The related alarm exists
    ...    Reference: Clause 7.4.3.3.2  - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none 
    ...    Post-Conditions: none
    GET Alarm Task - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails
PATCH Individual Alarm - Unauthorized
    [Documentation]    Test ID: 6.3.4.2.12
    ...    Test title: PATCH Individual Alarm - Unauthorized
    ...    Test objective: The objective is to Modify an individual alarm resource without authorization.
    ...    Pre-conditions: The related alarm exists
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    PATCH Alarm Task - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is     ProblemDetails
PATCH Individual Alarm - Not Found
    [Documentation]    Test ID: 6.3.4.2.13
    ...    Test title: PATCH Individual Alarm - Not Found
    ...    Test objective: The objective is to Modify an individual alarm resource that does not exist
    ...    Pre-conditions: The related alarm exists
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    PATCH Alarm Task - Not Found
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is     ProblemDetails
*** Keywords ***
POST Alarm Task
    log    Trying to perform a POST. This method should not be implemented
@@ -170,6 +206,29 @@ PATCH Alarm Task
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

PATCH Alarm Task - Unauthorized
    log    Trying to perform a PATCH. This method modifies an individual alarm resource without authorization.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Set Headers  {"If-Match": "${original_etag[0]}"}
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

PATCH Alarm Task - Not Found
    log    Trying to perform a PATCH. This method modifies an individual alarm resource on a not existing resource.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Set Headers  {"If-Match": "${original_etag[0]}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${body}=    Get File    jsons/alarmModifications.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${not_existing_alarmId}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
PATCH Alarm Task with wrong precondition
    log    Trying to perform a PATCH. This method modifies an individual alarm resource
    Set Headers    {"Accept": "${ACCEPT}"}
@@ -203,6 +262,17 @@ GET Alarm Task
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

GET Alarm Task - Unauthorized
	Log    Query VNF The GET method queries information about individual alarm without authorization.
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}  
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}
    ${etag}    Output    response headers ETag
    Set Suite Variable    &{original_etag}    ${etag}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Check HTTP Response Header Contains ETag and Last-Modified
    Pass Execution If    ${HEADER_TEST_SUPPORTED} == 0    Headers testing not supported. Skipping the Test.
    Log    ${response['headers']}
+58 −1
Original line number Diff line number Diff line
@@ -106,6 +106,42 @@ GET Information about an individual subscription with NOT permitted authorizatio
    ...    Post-Conditions: none
    Get individual subscription with not permitted authorization scope
    Check HTTP Response Status Code Is    403
GET Information about an individual subscription - Unauthorized
    [Documentation]    Test ID: 6.3.4.5.9
    ...    Test title: GET Information about an individual subscription without authorization
    ...    Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client without authorization
    ...    Pre-conditions: The subscription with the given id exists
    ...    Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  none
    ...    Post-Conditions: none
    Get individual subscription - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is   ProblemDetails
DELETE an individual subscription - Unauthorized
    [Documentation]    Test ID: 6.3.4.5.10
    ...    Test title: DELETE an individual subscription - Unauthorized
    ...    Test objective: The objective is to test that the deletion of a individual subscription resource without authorization fails.
    ...    Pre-conditions: one or more subscription already exsist
    ...    Reference: Clause 7.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: the subscription is deleted
    Delete individual subscription - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is   ProblemDetails
DELETE an individual subscription - Not Found
    [Documentation]    Test ID: 6.3.4.5.11
    ...    Test title: DELETE an individual subscription which does not exist
    ...    Test objective: The objective is to test that the deletion of a individual subscription resource fails when the subscription does not exist.
    ...    Pre-conditions: none
    ...    Reference: Clause 7.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Delete individual subscription - Not Found
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails
*** Keywords ***
Check resource existence
    Set Headers    {"Accept":"${ACCEPT}"}
@@ -129,6 +165,13 @@ Get individual subscription
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	
Get individual subscription - Unauthorized
    log    Trying to get information about an individual subscription without authorization
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}  
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	
Get individual subscription - filter
    Log    Get the list of active individual subscription using a filter
    Set Headers    {"Accept": "${ACCEPT}"}
@@ -168,7 +211,21 @@ DELETE individual subscription
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}    	   
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	      
	
DELETE individual subscription - Not Found
    log    Try to delete an individual subscription which does not exist
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${not_existing_subscriptionId}    	   
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	
DELETE individual subscription - Unauthorized
    log    Try to delete an individual subscription without authorization
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}  
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}    	   
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	 
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
+61 −0
Original line number Diff line number Diff line
@@ -88,6 +88,41 @@ DELETE Notification endpoint - Method Not Implemented
    DELETE notification endpoint
    Check HTTP Response Status Code Is    405

VNF Fault Alarm Notification - Unauthorized
    [Documentation]    Test ID: 6.3.4.8.8
    ...    Test title: VNF Fault Alarm Notification - Unauthorized
    ...    Test objective: The objective is to test that VNF Fault Alarm Notification isn't delivered with success to the notification consumer without authorization. 
    ...    Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm notifications is available in the VNFM.
    ...    Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post Alarm Notification - Unauthorized
    Check HTTP Response Status Code Is    401

Test the Notification Endpoint - Unauthorized
    [Documentation]    Test ID: 6.3.4.8.9
    ...    Test title: Test the Notification Endpoint - Unauthorized
    ...    Test objective: The objective is to test the Notification Endpoint provided by the notification consumer without authorization.
    ...    Pre-conditions: A notification endpoint is provided by the API consumer upon subscription.
    ...    Reference: Clause 7.4.7.3.2 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Get reach the notification endpoint - Unauthorized
    Check HTTP Response Status Code Is    401
Test the Notification Endpoint - Not Found
    [Documentation]    Test ID: 6.3.4.8.10
    ...    Test title: Test the Notification Endpoint - Not Found
    ...    Test objective: The objective is to test the Notification Endpoint provided by the notification consumer when it does not exist.
    ...    Pre-conditions: A notification endpoint is provided by the API consumer upon subscription.
    ...    Reference: Clause 7.4.7.3.2 - ETSI GS NFV-SOL 002 [2] v5.3.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Get reach the notification endpoint - Not Found
    Check HTTP Response Status Code Is    404

*** Keywords ***
Check resource existence and get CallbackUri
    Set Headers    {"Accept": "${ACCEPT}"}
@@ -116,6 +151,16 @@ Post Alarm Notification
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	

Post Alarm Notification - Unauthorized
    log    Trying to perform a POST to get notification without authorization
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    ${template} =    Get File    jsons/AlarmNotification.json
    ${body}=        Format String   ${template}    subscriptionId=${subscriptionId}
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	
Post Alarm Cleared Notification
    log    Trying to perform a POST to get notification
    Set Headers    {"Accept": "${ACCEPT}"}
@@ -147,6 +192,22 @@ GET reach the notification endpoint
    GET    ${callbackResp}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

GET reach the notification endpoint - Unauthorized
    Log    Trying to reach the notification endpoint using GET method without authorization.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Version": "${API_VERSION}"}
    GET    ${callbackResp}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
GET reach the notification endpoint - Not Found
    Log    Trying to reach the notification endpoint that does not existusing GET method.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Version": "${API_VERSION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${Invalid_callbackResp}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
PUT notification endpoint  
    Log    Trying to perform a PUT. This method should not be implemented.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
Loading