Commit c9558d09 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

addressed comments to TD SOL002 indicators subscriptions on contribution 075

parent 0b364a4f
Loading
Loading
Loading
Loading
+50 −51
Original line number Original line Diff line number Diff line
@@ -9,12 +9,12 @@ Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT}
*** Test Cases ***
*** Test Cases ***
GET VNF Indicators Subscriptions
GET VNF Indicators Subscriptions
    [Documentation]    Test ID: 6.3.2.4.1
    [Documentation]    Test ID: 6.3.2.4.1
    ...    Test title: Get all subscriptions to VNF performance indicators
    ...    Test title: GET VNF Indicators Subscriptions
    ...    Test objective: The objective is to test the retrieval of all VNF performance indicators subscriptions and perform a JSON schema validation of the returned subscriptions data structure
    ...    Test objective: The objective is to test the retrieval of all VNF indicators subscriptions and perform a JSON schema validation of the returned subscriptions data structure
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Reference:  section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Reference:  section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators
    ...    Applicability: The VNF supports the generation and maintenance of indicators
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Get VNF Indicators Subscriptions
    Get VNF Indicators Subscriptions
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
@@ -22,26 +22,26 @@ GET VNF Indicators Subscriptions


GET VNF Indicators Subscriptions with attribute-based filter
GET VNF Indicators Subscriptions with attribute-based filter
    [Documentation]    Test ID: 6.3.2.4.2
    [Documentation]    Test ID: 6.3.2.4.2
    ...    Test title: Get all subscriptions to VNF performance indicators with attribute-based filter
    ...    Test title: GET VNF Indicators Subscriptions with attribute-based filter
    ...    Test objective: The objective is to test the retrieval of all VNF performance indicators subscriptions using attribute-based filter and perform a JSON schema and content validation of the returned subscriptions data structure
    ...    Test objective: The objective is to test the retrieval of all VNF indicators subscriptions using attribute-based filter and perform a JSON schema and content validation of the returned subscriptions data structure
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Reference:  section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Reference:  section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators
    ...    Applicability: The VNF supports the generation and maintenance of indicators
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Get VNF Indicators Subscriptions with filter
    Get VNF Indicators Subscriptions with filter
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   VnfIndicatorSubscriptions
    Check HTTP Response Body Json Schema Is   VnfIndicatorSubscriptions
    Check HTTP Response Body Matches Attribute-Based Filter
    Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filter


GET VNF Indicators Subscriptions with invalid attribute-based filter
GET VNF Indicators Subscriptions with invalid attribute-based filter
    [Documentation]    Test ID: 6.3.2.4.3
    [Documentation]    Test ID: 6.3.2.4.3
    ...    Test title: Get all subscriptions to VNF performance indicators with invalid attribute-based filter
    ...    Test title: GET VNF Indicators Subscriptions with invalid attribute-based filter
    ...    Test objective: The objective is to test that the retrieval of all VNF performance indicators subscriptions fails when using invalid attribute-based filter. The test also checks the JSON schema of the unsuccessful operation HTTP response.
    ...    Test objective: The objective is to test that the retrieval of all VNF indicators subscriptions fails when using invalid attribute-based filter. The test also checks the JSON schema of the unsuccessful operation HTTP response.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Reference:  section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Reference:  section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators
    ...    Applicability: The VNF supports the generation and maintenance of indicators
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Get VNF Indicators Subscriptions with invalid filter
    Get VNF Indicators Subscriptions with invalid filter
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400
@@ -49,64 +49,63 @@ GET VNF Indicators Subscriptions with invalid attribute-based filter


GET VNF Indicators Subscriptions with invalid resource endpoint
GET VNF Indicators Subscriptions with invalid resource endpoint
    [Documentation]    Test ID 6.3.2.4.4
    [Documentation]    Test ID 6.3.2.4.4
    ...    Test title: Get all subscriptions to VNF performance indicators with invalid resource endpoint
    ...    Test title: GET VNF Indicators Subscriptions with invalid resource endpoint
    ...    Test objective: The objective is to test that the retrieval of all VNF performance indicators subscriptions fails when using invalid resource endpoint. The test also checks the JSON schema of the unsuccessful operation HTTP response.
    ...    Test objective: The objective is to test that the retrieval of all VNF indicators subscriptions fails when using invalid resource endpoint.
    ...    Pre-conditions: A VNF instance is up and running. At least one VNF indicator subscription is available in the VNF.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Reference: section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Reference: section 8.4.5.3.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators.
    ...    Applicability: The VNF supports the generation and maintenance of indicators.
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Get VNF Indicators Subscriptions with invalid resource endpoint
    Get VNF Indicators Subscriptions with invalid resource endpoint
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails


POST VNF Indicator Subscription
Create new VNF indicator subscription
    [Documentation]    Test ID 6.3.2.4.5
    [Documentation]    Test ID 6.3.2.4.5
    ...    Test title: Create a new VNF performance indicator subscription
    ...    Test title: Create new VNF indicator subscription
    ...    Test objective: The objective is to test the creation of a new VNF performance indicator subscription perform a JSON schema and content validation of the returned subscriptions data structure
    ...    Test objective: The objective is to test the creation of a new VNF indicator subscription perform a JSON schema and content validation of the returned subscriptions data structure
    ...    Pre-conditions: A VNF instance is up and running
    ...    Pre-conditions: A VNF instance is instantiated.
    ...    Reference: section 8.4.5.3.1 - SOL002 v2.4.1
    ...    Reference: section 8.4.5.3.1 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators.
    ...    Applicability: The VNF supports the generation and maintenance of indicators.
    ...    Post-Conditions: The VNF indicator subscription is successfully set and it matches the issued subscription
    ...    Post-Conditions: The VNF indicator subscription is successfully set and it matches the issued subscription
    Send Post Request for VNF Indicator Subscription
    Send Post Request for VNF Indicator Subscription
    Check HTTP Response Status Code Is    201
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    VnfIndicatorSubscription
    Check HTTP Response Body Json Schema Is    VnfIndicatorSubscription
    Check HTTP Response Body Matches the Subscription
    Check HTTP Response Body Matches the Subscription
    Check Postcondition VNF Performance Indicator Subscription Is Set
    Check Postcondition VNF Indicator Subscription Is Set


PUT VNF Indicator Subscriptions - Method not implemented
PUT VNF Indicator Subscriptions - Method not implemented
    [Documentation]    Test ID 6.3.2.4.6
    [Documentation]    Test ID 6.3.2.4.6
    ...    Test title: PUT VNF indicator subscriptions - Method not implemented
    ...    Test title: PUT VNF Indicator Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify VNF performance indicator subscriptions
    ...    Test objective: The objective is to test that PUT method is not allowed to modify VNF indicator subscriptions
    ...    Pre-conditions: A VNF instance is instantiated.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Reference: section 8.4.5.3.3 - SOL002 v2.4.1
    ...    Reference: section 8.4.5.3.3 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators.
    ...    Applicability: The VNF supports the generation and maintenance of indicators.
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Send Put Request for VNF Indicator Subscriptions
    Send Put Request for VNF Indicator Subscriptions
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405


PATCH VNF Indicator Subscriptions - Method not implemented
PATCH VNF Indicator Subscriptions - Method not implemented
    [Documentation]    Test ID 6.3.2.4.7
    [Documentation]    Test ID 6.3.2.4.7
    ...    Test title: PATCH VNF indicator subscriptions - Method not implemented
    ...    Test title: PATCH VNF Indicator Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update VNF performance indicator subscriptions
    ...    Test objective: The objective is to test that PATCH method is not allowed to update VNF indicator subscriptions
    ...    Pre-conditions: A VNF instance is instantiated.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Reference: section 8.4.5.3.4 - SOL002 v2.4.1
    ...    Reference: section 8.4.5.3.4 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators.
    ...    Applicability: The VNF supports the generation and maintenance of indicators.
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Send Patch Request for VNF Indicator Subscriptions
    Send Patch Request for VNF Indicator Subscriptions
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405


DELETE VNF Indicator Subscriptions - Method not implemented
DELETE VNF Indicator Subscriptions - Method not implemented
    [Documentation]    Test ID 6.3.2.4.8
    [Documentation]    Test ID 6.3.2.4.8
    ...    Test title: DELETE VNF indicator subscriptions - Method not implemented
    ...    Test title: DELETE VNF Indicator Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to delete VNF performance indicator subscriptions
    ...    Test objective: The objective is to test that PUT method is not allowed to delete VNF indicator subscriptions
    ...    Pre-conditions: A VNF instance is instantiated.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF.
    ...    Reference: section 8.4.5.3.5 - SOL002 v2.4.1
    ...    Reference: section 8.4.5.3.5 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VE
    ...    Config ID: Config_prod_VE
    ...    Applicability: The VNF supports the generation and maintenance of performance indicators.
    ...    Applicability: The VNF supports the generation and maintenance of indicators.
    ...    Post-Conditions: none
    ...    Post-Conditions: none
    Send Delete Request for VNF Indicator Subscriptions
    Send Delete Request for VNF Indicator Subscriptions
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405
@@ -118,7 +117,7 @@ Get VNF Indicators Subscriptions
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Get VNF Indicators Subscriptions with filter
Get VNF Indicators Subscriptions with filter
    Log    Trying to get the list of subscriptions using filters
    Log    Trying to get the list of subscriptions using filters
@@ -126,7 +125,7 @@ Get VNF Indicators Subscriptions with filter
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Get VNF Indicators Subscriptions with invalid filter   
Get VNF Indicators Subscriptions with invalid filter   
    Log    Trying to get the list of subscriptions using filters with wrong attribute name
    Log    Trying to get the list of subscriptions using filters with wrong attribute name
@@ -134,7 +133,7 @@ Get VNF Indicators Subscriptions with invalid filter
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}   
    Set Suite Variable    ${response}    ${output}   
    
    
Get VNF Indicators Subscriptions with invalid resource endpoint
Get VNF Indicators Subscriptions with invalid resource endpoint
        Log    Trying to perform a request on a Uri which doesn't exist
        Log    Trying to perform a request on a Uri which doesn't exist
@@ -142,7 +141,7 @@ Get VNF Indicators Subscriptions with invalid resource endpoint
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscription
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscription
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}   
    Set Suite Variable    ${response}    ${output}   


Send Post Request for VNF Indicator Subscription
Send Post Request for VNF Indicator Subscription
    Log    Trying to create a new subscription
    Log    Trying to create a new subscription
@@ -152,7 +151,7 @@ Send Post Request for VNF Indicator Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}   
    Set Suite Variable    ${response}    ${output}   


Send Put Request for VNF Indicator Subscriptions
Send Put Request for VNF Indicator Subscriptions
    Log    Trying to create a new subscription
    Log    Trying to create a new subscription
@@ -160,7 +159,7 @@ Send Put Request for VNF Indicator Subscriptions
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send Patch Request for VNF Indicator Subscriptions
Send Patch Request for VNF Indicator Subscriptions
    Log    Trying to create a new subscription
    Log    Trying to create a new subscription
@@ -168,7 +167,7 @@ Send Patch Request for VNF Indicator Subscriptions
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send Delete Request for VNF Indicator Subscriptions
Send Delete Request for VNF Indicator Subscriptions
    Log    Trying to create a new subscription
    Log    Trying to create a new subscription
@@ -176,43 +175,43 @@ Send Delete Request for VNF Indicator Subscriptions
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}


Check HTTP Response Status Code Is
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    [Arguments]    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    ${status}=    Convert To Integer    ${expected_status}    
    Should Be Equal    ${response[0]['status']}    ${status}
    Should Be Equal    ${response['status']}    ${status}
    Log    Status code validated
    Log    Status code validated


Check HTTP Response Header Contains
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    [Arguments]    ${CONTENT_TYPE}
    Log    ${response[0]['headers']}
    Log    ${response['headers']}
    Should Contain    ${response[0]['headers']}    ${CONTENT_TYPE}
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
    Log    Header is present
    
    
Check HTTP Response Body Json Schema Is
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    [Arguments]    ${input}
    Should Contain    ${response[0]['headers']['Content-Type']}    application/json
    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    ${input}    .schema.json
    ${schema} =    Catenate    ${input}    .schema.json
    Validate Json    ${schema}    ${response[0]['body']}
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
    Log    Json Schema Validation OK


Check HTTP Response Body Matches the Subscription
Check HTTP Response Body Matches the Subscription
    Log    Check Response matches subscription
    Log    Check Response matches subscription
    ${body}=    Get File    jsons/subscriptions.json
    ${body}=    Get File    jsons/subscriptions.json
    ${subscription}=    evaluate    json.loads('''${body}''')    json
    ${subscription}=    evaluate    json.loads('''${body}''')    json
    Should Be Equal    ${response[0]['body']['callbackUri']}    ${subscription.callbackUri}
    Should Be Equal    ${response['body']['callbackUri']}    ${subscription.callbackUri}


Check Postcondition VNF Performance Indicator Subscription Is Set
Check Postcondition VNF Indicator Subscription Is Set
    Log    Check Postcondition subscription exist
    Log    Check Postcondition subscription exist
    Log    Trying to get the subscription
    Log    Trying to get the subscription
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response[0]['body']['id']}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    ${response}    ${output}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    
    
Check HTTP Response Body Matches Attribute-Based Filter
Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filter
    Log    Check Response includes VNF Indicators according to filter
    Log    Check Response includes VNF Indicators according to filter
    #todo
    #todo
+1 −1
Original line number Original line Diff line number Diff line
@@ -4,4 +4,4 @@ ${indicatorId} 34e70855-a9d3-4fef-aece-76a3cd266ec8
${erroneousIndicatorId}    erroneousIndicatorId
${erroneousIndicatorId}    erroneousIndicatorId
${POS_FILTER}     callbackUri=http://127.0.0.1/subscribe
${POS_FILTER}     callbackUri=http://127.0.0.1/subscribe
${NEG_FILTER}     callback=http://127.0.0.1/subscribe
${NEG_FILTER}     callback=http://127.0.0.1/subscribe
@{response}=    httpresponse
${response}=    httpresponse