Commit 4dff63af authored by Eisha Ayaz's avatar Eisha Ayaz
Browse files

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

[test-new][SOL003][VNF-FM][v5.3.1][7.3.5.x.x Test-IDs][NFVSOL(26)000093] New tests for 401/404 gaps identified by tacker
parent 407ca73a
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -204,7 +204,18 @@ Get information about multiple alarms with not permitted authorization scope
    GET Fault Management 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: 7.3.5.1.16
    ...    Test title: Get information about multiple alarms - Unauthorized
    ...    Test objective: The objective is to try to retrieve information about the alarm list without authorization and perform a JSON schema and content validation of the returned problem details data structure
    ...    Pre-conditions: none
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Fault Management Alarms - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails
*** Keywords ***
Void
    Log    do nothing
+74 −6
Original line number Diff line number Diff line
@@ -145,6 +145,13 @@ GET Fault Management Alarms
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

GET Fault Management Alarms - Unauthorized
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers    {"Version": "${API_VERSION}"}
    Log    Execute Query
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
GET Fault Management Alarms with nextpage_opaque_marker parameter
    Log    Get next page of subscriptions
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
@@ -272,7 +279,14 @@ GET Fault Management Individual Alarm
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
    
GET Fault Management Individual Alarm - Unauthorized
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Version": "${API_VERSION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}    
GET Fault Management Individual Alarm with invalid id
    Log    Query NFVO The GET method queries information about an invalid alarm. Should return does not exist
    Set Headers  {"Accept":"${ACCEPT}"}  
@@ -364,6 +378,22 @@ POST Subscription
	Verify Mock Expectation   ${notification_request}
	Clear Requests    ${callback_endpoint}

POST Subscription - Unauthorized
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Version": "${API_VERSION}"}
    ${template}=    Get File    jsons/fmSubscriptionRequest.json
    ${body}=        Format String   ${template}    vnfdIds=${vnfdIds}      callback_uri=${callback_uri}:${callback_port}    callback_endpoint=${callback_endpoint}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}
    &{notification_response}=  Create Mock Response	status_code=204
    Log    Issue the subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    allow_redirects=false
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Verify Mock Expectation   ${notification_request}
	Clear Requests    ${callback_endpoint}    
Send POST Request for duplicated subscription
    Log    Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions
    Pass Execution If    ${VNFM_DUPLICATION} == 0    NVFO is not permitting duplication. Skipping the test
@@ -455,6 +485,12 @@ GET Subscriptions
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

GET Subscriptions - Unauthorized
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}        
GET Subscriptions with filter
    Log    Get the list of active subscriptions using a filter
    Set Headers    {"Accept": "${ACCEPT}"}
@@ -548,7 +584,12 @@ GET Individual Subscription
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

GET Individual Subscription - Unauthorized
    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 with permitted authorization scope
    log    Trying to get information about an individual subscription with permitted authorization scope
    Set Headers    {"Accept":"${ACCEPT}"}  
@@ -598,6 +639,19 @@ DELETE Individual Subscription
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

DELETE Individual Subscription - Unauthorized
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers    {"Version": "${API_VERSION}"}
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}  
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse} 
DELETE Individual Subscription - Not found
    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/${nonExistentSubscriptionId}  
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}   
Check HTTP Response Header Contain Link
    ${linkURL}=    Get Value From Json    ${response['headers']}    $..Link
    Should Not Be Empty    ${linkURL}
@@ -716,7 +770,15 @@ Post Alarm Notification
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}	

Post Alarm Notification - Unauthorized
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Version": "${API_VERSION}"}
    ${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}"}  
@@ -748,6 +810,12 @@ GET reach the notification endpoint
    GET    ${callbackResp}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
GET reach the notification endpoint - Unauthorized
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Version": "${API_VERSION}"}
    GET    ${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}"}
+13 −0
Original line number Diff line number Diff line
@@ -139,3 +139,16 @@ PATCH Fault Management Individual Alarm with not permitted authorization scope
    PATCH Fault Management 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 fault management individual alarm - Unauthorized
    [Documentation]    Test ID: 7.3.5.2.11
    ...    Test title: Get information about an fault management individual alarm - Unauthorized
    ...    Test objective: The objective is to test that retrieval of information about an individual alarm fails when the requester is not authorized
    ...    Pre-conditions: The related alarm exists
    ...    Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions:  none 
    GET Fault Management Individual Alarm - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails
 No newline at end of file
+36 −0
Original line number Diff line number Diff line
@@ -106,3 +106,39 @@ Get Information about an individual subscription with not permitted authorizatio
    GET Individual Subscription 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 subscription - Unauthorized
    [Documentation]    Test ID: 7.3.5.4.9
    ...    Test title: Get Information about an individual subscription - Unauthorized
    ...    Test objective: The objective is to read an individual subscription for NFVO alarms subscribed by the client and perform a JSON schema and content validation of the returned fault management individual subscription data structure without authorization
    ...    Pre-conditions: The subscription with the given id exists
    ...   Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 003 [1] 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: 7.3.5.4.10
    ...    Test title:DELETE an individual subscription - Unauthorized
    ...    Test objective: The objective is to test that DELETE method removes individual subscription on VNF  without authorization  
    ...    Pre-conditions: The Subsbcription already exists
    ...    Reference: Clause 7.4.5.3.5 - ETSI GS NFV-SOL 003 [1] v5.3.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  none
    ...    Post-Conditions:  none
    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: 7.3.5.4.11
    ...    Test title:DELETE an individual subscription - Not Found
    ...    Test objective: The objective is to test that DELETE method returns appropriate response when trying to delete a non-existent subscription
    ...    Pre-conditions: The subscription with the given id does not exist
    ...    Reference: Clause 7.4.5.3.5 - ETSI GS NFV-SOL 003 [1] 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
 No newline at end of file
+23 −1
Original line number Diff line number Diff line
@@ -88,3 +88,25 @@ DELETE Notification endpoint - Method Not Implemented
    ...    Post-Conditions: none 
    DELETE notification endpoint
    Check HTTP Response Status Code Is    405
VNF Fault Alarm Notification - Unauthorized
    [Documentation]    Test ID: 7.3.5.7.8
    ...    Test title: VNF Fault Alarm Notification - Unauthorized
    ...    Test objective: The objective is to test that the POST request triggers VNF Fault Alarm Notification without proper authorization.
    ...    Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm notifications is available in the VNFM.
    ...    Reference: Clause 7.4.6.3.1 - ETSI GS NFV-SOL 003 [1] 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: 7.3.5.7.9
    ...    Test title: Test the Notification Endpoint - Unauthorized
    ...    Test objective: The objective is to test the Notification Endpoint provided by the notification consumer without proper authorization.
    ...    Pre-conditions: A notification endpoint is provided by the API consumer upon subscription.
    ...    Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 003 [1] 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
Loading