Commit d73c2ad9 authored by Najam UI Hassan's avatar Najam UI Hassan Committed by Giacomo Bernini
Browse files

added test case for subscription attribute-based filtering

parent 07594114
Loading
Loading
Loading
Loading
+106 −2
Original line number Diff line number Diff line
@@ -345,14 +345,118 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba
    Should Be Equal As Strings    ${response['body']['id']}    ${alarmId}

GET Alarms Task with filter "managedObjectId"
	Log    Query VNF The GET method queries information about multiple alarms with filters "vnfcInstanceIds".
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "NFV-MANOcInstanceIds".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms?vnfcInstanceIds=${managedObjectId}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms?NFV-MANOcInstanceIds=${managedObjectId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "managedObjectId"
    Should Be Equal As Strings    ${response['body']['managedObjectId']}    ${managedObjectId}

GET Alarms Task with filter "eventType"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "eventType".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms?eventType=${eventType}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "eventType"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['eventType']}   ${eventType}
    END
	
GET Alarms Task with filter "perceivedSeverity"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "perceivedSeverity".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms?perceivedSeverity=${perceivedSeverity}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "perceivedSeverity"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['perceivedSeverity']}   ${perceivedSeverity}
    END
	
GET Alarms Task with filter "probableCause"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "probableCause".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/alarms?probableCause=${probableCause}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "probableCause"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['probableCause']}   ${probableCause}
    END

Get subscriptions with filter "id"
    Log    Get the list of active subscriptions using a filter "id"
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?id=${subscription_id}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body Subscription Matches the requested attribute-based filter "id"
    Should Be Equal As Strings    ${response['body']['id']}    ${subscription_id}
	
Get subscriptions with filter "filter_notificationTypes"
    Log    Get the list of active subscriptions using a filter "filter.notificationTypes"
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.notificationTypes=${notification_type}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_notificationTypes"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['filter']['notificationTypes']}   ${notification_type}
    END
	
Get subscriptions with filter "filter_perceivedSeverities"
    Log    Get the list of active subscriptions using a filter "filter.perceivedSeverities"
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.perceivedSeverities=${perceivedSeverity}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_perceivedSeverities"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['filter']['perceivedSeverities']}   ${perceivedSeverity}
    END
	
Get subscriptions with filter "filter_eventTypes"
    Log    Get the list of active subscriptions using a filter "filter.eventTypes"
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.eventTypes=${eventType}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_eventTypes"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['filter']['eventTypes']}   ${eventType}
    END
	
Get subscriptions with filter "filter_probableCauses"
    Log    Get the list of active subscriptions using a filter "filter.probableCauses"
    Set Headers    {"Accept": "${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.probableCauses=${probableCause}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_probableCauses"
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['filter']['probableCauses']}   ${probableCause}
    END
+75 −3
Original line number Diff line number Diff line
@@ -119,8 +119,80 @@ Get information about multiple alarms - Bad Request Response too Big
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
PUT subscriptions - Method not implemented
GET Subscription with attribute-based filter "id"
    [Documentation]    Test ID: 8.3.3.3.9
    ...    Test title: GET Subscription with attribute-based filter "id"
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter "id"
    ...    Pre-conditions: 
    ...    Reference: Clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability:  
    ...    Post-Conditions: 
    Get subscriptions with filter "id"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   FmSubscription
    Check PostCondition HTTP Response Body Subscription Matches the requested attribute-based filter "id"
    
    
Get subscriptions with filter "filter.notificationTypes"
    [Documentation]    Test ID: 8.3.3.3.10
    ...    Test title: GET Subscription with attribute-based filter "filter.notificationTypes"
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.notificationTypes"
    ...    Pre-conditions: 
    ...    Reference: Clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability:  
    ...    Post-Conditions: 
    Get subscriptions with filter "filter_notificationTypes"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   FmSubscriptions 
    Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_notificationTypes"
    
Get subscriptions with filter "filter.perceivedSeverities"
    [Documentation]    Test ID: 8.3.3.3.11
    ...    Test title: GET Subscription with attribute-based filter "filter.perceivedSeverities"
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.perceivedSeverities"
    ...    Pre-conditions: 
    ...    Reference: Clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability:  
    ...    Post-Conditions: 
    Get subscriptions with filter "filter_perceivedSeverities"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   FmSubscriptions
    Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_perceivedSeverities"
    
Get subscriptions with filter "filter.eventTypes"
    [Documentation]    Test ID: 8.3.3.3.12
    ...    Test title: GET Subscription with attribute-based filter "filter.eventTypes"
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.eventTypes"
    ...    Pre-conditions: 
    ...    Reference: Clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability:  
    ...    Post-Conditions: 
    Get subscriptions with filter "filter_eventTypes"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   FmSubscriptions
    Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_eventTypes"
    
Get subscriptions with filter "filter.probableCauses"
    [Documentation]    Test ID: 8.3.3.3.13
    ...    Test title: GET Subscription with attribute-based filter "filter.probableCauses"
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.probableCauses"
    ...    Pre-conditions: 
    ...    Reference: Clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability:  
    ...    Post-Conditions: 
    Get subscriptions with filter "filter_probableCauses"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   FmSubscriptions
    Check PostCondition HTTP Response Body Subscriptions Matches the requested attribute-based filter "filter_probableCauses"

    
PUT subscriptions - Method not implemented
    [Documentation]    Test ID: 8.3.3.3.14
    ...    Test title:PUT subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to for fault management subscriptions on VNF 
    ...    Pre-conditions: none
@@ -132,7 +204,7 @@ PUT subscriptions - Method not implemented
    Check HTTP Response Status Code Is    405

PATCH subscriptions - Method not implemented
    [Documentation]    Test ID: 8.3.3.3.10
    [Documentation]    Test ID: 8.3.3.3.15
    ...    Test title: PATCH subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to for fault management subscriptions on VNF  
    ...    Pre-conditions: none
@@ -144,7 +216,7 @@ PATCH subscriptions - Method not implemented
    Check HTTP Response Status Code Is    405

DELETE subscriptions - Method not implemented
    [Documentation]    Test ID: 8.3.3.3.11
    [Documentation]    Test ID: 8.3.3.3.16
    ...    Test title: DELETE subscriptions - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to for fault management subscriptions on VNF  
    ...    Pre-conditions: none 
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ ${sub_filter} filter
${sub_filter_invalid}    filter_invalid

${subscriptionId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${faultyResourceType}    
${notification_type}    AlarmNotification

${callback_uri}    http://localhost
${callback_port}    9091