Commit 66c6513d authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch 'master' into 'master'

TD doc for SOL002 VNF Indicator API

See merge request !25
parents 0b5be6c9 89ffd168
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ Get VNF Indicators with attribute-based filter
    Check HTTP Response Body Json Schema Is   vnfIndicators
    Check HTTP Response Body vnfIndicators Matches the requested attribute-based filter

Get all VNF Indicators with invalid attribute-based filter
Get VNF Indicators with invalid attribute-based filter
    [Documentation]    Test ID: 6.3.2.1.3
    ...    Test title: Get VNF Indicators with invalid attribute-based filter
    ...    Test objective: The objective is to test that the retrieval of VNF indicators fails when using invalid attribute-based filters, and perform the JSON schema validation of the failed operation HTTP response. 
@@ -121,7 +121,7 @@ PUT all VNF Indicators - Method not implemented

PATCH all VNF Indicators - Method not implemented
     [Documentation]    Test ID: 6.3.2.1.10
    ...    Test title: POST all VNF Indicators - Method not implemented
    ...    Test title: PATCH all VNF Indicators - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update VNF indicators
    ...    Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF
    ...    Reference: section 8.4.2.3.4 - SOL002 v2.4.1
@@ -133,7 +133,7 @@ PATCH all VNF Indicators - Method not implemented

DELETE all VNF Indicators - Method not implemented
    [Documentation]    Test ID: 6.3.2.1.11
    ...    Test title: POST all VNF Indicators - Method not implemented
    ...    Test title: DELETE all VNF Indicators - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete VNF indicators
    ...    Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF
    ...    Reference: section 8.4.2.3.5 - SOL002 v2.4.1
+8 −1
Original line number Diff line number Diff line
@@ -15,3 +15,10 @@ ${FIELD_USAGE} 1
${AUTHORIZATION}    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
${AUTH_USAGE}    1
${VNFM_DUPLICATION}    1
${VNFM_CHECKS_NOTIF_ENDPOINT}    1
${callback_uri}    http://localhost
${callback_port}    9091
${callback_endpoint}    /endpoint
${callback_endpoint_error}    /endpoint_404
${sleep_interval}    20s
${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar
 No newline at end of file
+83 −81
Original line number Diff line number Diff line
@@ -2,94 +2,96 @@
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/individualSubscription.txt
Resource          VNFIndicatorsKeywords.robot
Library           OperatingSystem
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}

*** Test Cases ***
GET Individual Subscription
    Log    Trying to get a given subscription identified by subscriptionId
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    200
    Log    Received a 200 OK as expected
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    ${result}=    Output    response body
    Log    Trying to validate result with VnfIndicatorSubscription schema
    Validate Json    VnfIndicatorSubscription.schema.json    ${result}
    Log    Validated VnfIndicatorSubscription schema
GET Individual VNF Indicator Subscription
    [Documentation]    Test ID: 7.3.6.5.1
    ...    Test title: GET Individual VNF Indicator Subscription
    ...    Test objective: The objective is to test the retrieval of individual VNF indicator subscription and perform a JSON schema validation of the returned subscription data structure
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNFM.
    ...    Reference:  section 8.4.6.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual VNF Indicator Subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   VnfIndicatorSubscription

GET Subscription - Negative (Not Found)
    Log    Trying to perform a request on a subscriptionID which doesn't exist
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    Integer    response status    404
    Log    Received 404 Not Found as expected
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    ${problemDetails}=    Output    response body
    Log    Trying to validate ProblemDetails
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
GET Individual VNF Indicator Subscription with invalid resource identifier
    [Documentation]    Test ID: 7.3.6.5.2
    ...    Test title: GET Individual VNF Indicator Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of individual VNF indicator subscription fails when using an invalid resource identifier.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNFM.
    ...    Reference:  section 8.4.6.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Indicator Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

GET Subscription - Negative (Unauthorized: Wrong Token)
    Log    Trying to perform a negative get, using wrong authorization bearer
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as VNFM is not supporting authentication
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    401
    Log    Received 401 Unauthorized as expected
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
DELETE Individual VNF Indicator Subscription
    [Documentation]    Test ID: 7.3.6.5.3
    ...    Test title: DELETE Individual VNF Indicator Subscription
    ...    Test objective: The objective is to test the deletion of an individual VNF indicator subscription.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNFM.
    ...    Reference:  section 8.4.6.3.5 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The subscription to VNF indicators is deleted
    Send Delete Request for Individual VNF Indicator Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition Individual VNF Indicator Subscription is Deleted

DELETE Subscription
    Log    Trying to perform a DELETE on a subscriptionId
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    204
    Log    Received 204 No Content as expected
DELETE Individual VNF Indicator Subscription with invalid resource identifier
    [Documentation]    Test ID: 7.3.6.5.4
    ...    Test title: DELETE Individual VNF Indicator Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual VNF indicator subscription fails when using an invalid resource identifier.
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNFM.
    ...    Reference:  section 8.4.6.3.5 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none   
    Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

DELETE Subscription - Negative (Not Found)
    Log    Trying to perform a DELETE on a subscriptionId which doesn't exist
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    Integer    response status    404
    Log    The subscriptionId is not present in database
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    ${problemDetails}=    Output
    Log    Trying to validate ProblemDetails
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
PUT Individual VNF Indicator Subscription - Method not implemented
    [Documentation]    Test ID: 7.3.6.5.5
    ...    Test title: PUT Individual VNF Indicator Subscription - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify an individual VNF indicator subscription
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNFM.
    ...    Reference: section 8.4.6.3.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The individual VNF indicator subscription is not modified by the operation
    Send Put Request for Individual VNF Indicator Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF indicator subscription Unmodified (Implicit)

PUT Subscription - (Method not implemented)
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
PATCH Individual VNF Indicator Subscription - Method not implemented
    [Documentation]    Test ID: 7.3.6.5.6
    ...    Test title: PATCH Individual VNF Indicator Subscription - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update an individual VNF indicator subscription
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNFM.
    ...    Reference: section 8.4.6.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The individual VNF indicator subscription is not modified by the operation
    Send Patch Request for Individual VNF Indicator Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF indicator subscription Unmodified (Implicit) 

PATCH Subscription - (Method not implemented)
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected

POST Subscription - (Method not implemented)
    Log    Trying to perform a POST. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
POST Individual VNF Indicator Subscription - Method not implemented
    [Documentation]    Test ID: 7.3.6.5.7
    ...    Test title: POST Individual VNF Indicator Subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new VNF indicator subscription
    ...    Pre-conditions: A VNF instance is instantiated.
    ...    Reference: section 8.4.6.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The individual VNF indicator subscription is not created by the operation
    Send Post Request for Individual VNF Indicator Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF indicator subscription is not created  
 No newline at end of file
+71 −82
Original line number Diff line number Diff line
@@ -2,93 +2,82 @@
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/individualVnfIndicator.txt
Resource          VNFIndicatorsKeywords.robot
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}

*** Test Cases ***
GET Individual VNF Indicator
    Log    The GET method reads a VNF indicator.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    Integer    response status    200
    ${contentType}=    Output     response headers Content-Type
    Should Contain    ${contentType}    application/json
    Log    Trying to validate response
    ${result}=    Output    response body
    Validate Json    vnfIndicator.schema.json    ${result}
    Log    Validation OK
Get Individual Indicator for VNF Instance
    [Documentation]    Test ID: 7.3.6.3.1
    ...    Test title: Get Individual Indicator for VNF Instance
    ...    Test objective: The objective is to test the retrieval of an indicator for a given VNF instance and perform a JSON schema validation of the returned indicator data structure
    ...    Pre-conditions: A VNF instance is instantiated. At least one measure of VNF indicator is available in the VNFM.
    ...    Reference:  section 8.4.4.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Indicator for a VNF instance
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   vnfIndicator
    Check HTTP Response Body Includes Requested VNF Instance ID
    Check HTTP Response Body Includes Requested Indicator ID

GET Individual VNF Indicator - Negative (Not Found)
    Log    Trying to perform a negative get, using an erroneous package ID
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId}
    Integer    response status    404
    Log    Received 404 Not Found as expected
    ${contentType}=    Output     response headers Content-Type
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
Get Individual Indicator for VNF Instance with invalid indicator identifier
    [Documentation]    Test ID: 7.3.6.3.2
    ...    Test title: Get Individual Indicator for VNF Instance with invalid indicator identifier
    ...    Test objective: The objective is to test that the retrieval of an indicator for a given VNF instance fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response.
    ...    Pre-conditions: A VNF instance is instantiated. At least one measure of VNF indicator is available in the VNFM.
    ...    Reference: section 8.4.4.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Indicator for a VNF instance with invalid indicator identifier
    Check HTTP Response Status Code Is    404

GET Individual VNF Indicator - Negative (Unauthorized: Wrong Token)
    Log    Trying to perform a negative get, using wrong authorization bearer
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as VNFM is not supporting authentication
    Set Headers    {"Accept" : "${ACCEPT_JSON}"}
    Set Headers    {"Authorization": "${NEG_AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    Integer    response status    401
    Log    Received 401 Unauthorized as expected
    ${contentType}=    Output     response headers Content-Type
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
POST Individual VNF Indicator for VNF Instance - Method not implemented
    [Documentation]    Test ID: 7.3.6.3.3
    ...    Test title: POST Individual VNF Indicator for VNF Instance - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new VNF indicator in the VNFM
    ...    Pre-conditions: A VNF instance is instantiated.
    ...    Reference: section 8.4.4.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send POST Request for individual indicator in VNF instance
    Check HTTP Response Status Code Is    405

GET Individual VNF Indicator - Negative (Unauthorized: No Token)
    Log    Trying to perform a negative get, without authentication token.
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as VNFM is not supporting authentication
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    Integer    response status    401
    Log    Received 401 Unauthozired as expected
    ${contentType}=    Output     response headers Content-Type
    Should Contain    ${contentType}    application/json
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
PUT Individual VNF Indicator for VNF Instance - Method not implemented
    [Documentation]    Test ID: 7.3.6.3.4
    ...    Test title: PUT Individual VNF Indicator for VNF Instance - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify an existing indicator for a VNF instance
    ...    Pre-conditions: A VNF instance is instantiated. At least one measure of VNF indicator is available in the VNFM
    ...    Reference: section 8.4.4.3.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PUT Request for individual indicator in VNF instance
    Check HTTP Response Status Code Is    405

POST Individual VNF Indicator (Method not implemented)
    Log    Trying to perform a POST (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
PATCH Individual VNF Indicator for VNF Instance - Method not implemented
    [Documentation]    Test ID: 7.3.6.3.5
    ...    Test title: PATCH Individual VNF Indicator for VNF Instance - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update an existing indicator for a VNF instance
    ...    Pre-conditions: A VNF instance is instantiated. At least one measure of VNF indicator is available for the given VNF instance.
    ...    Reference: section 8.4.4.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PATCH Request for individual indicator in VNF instance
    Check HTTP Response Status Code Is    405

PUT Individual VNF Indicator (Method not implemented)
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected

PATCH Individual VNF Indicator (Method not implemented)
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected

DELETE Individual VNF Indicator (Method not implemented)
    Log    Trying to perform a DELETE. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
DELETE Individual VNF Indicator for VNF Instance - Method not implemented
    [Documentation]    Test ID: 7.3.6.3.6
    ...    Test title: DELETE Individual VNF Indicator for VNF Instance - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete an existing indicator for a VNF instance
    ...    Pre-conditions: A VNF instance is instantiated. At least one measure of VNF indicator is available in the VNFM
    ...    Reference: section 8.4.3.3.5 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The individual indicator for the VNF instance is not deleted by the unsuccessful operation
    Send DELETE Request for individual indicator in VNF instance
    Check HTTP Response Status Code Is    405
    Check Postcondition Indicator for VNF instance Exist
 No newline at end of file
+91 −29

File changed.

Preview size limit exceeded, changes collapsed.

Loading