Commit 21b067fa authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

added doc for SOL005 NS performance mgmt

parent 927a676f
Loading
Loading
Loading
Loading
+84 −70
Original line number Diff line number Diff line
@@ -2,84 +2,98 @@
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/individualSubscription.txt
Resource          NSDManagementKeywords.robot
Library           OperatingSystem
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}

*** Test Cases ***
GET Individual Subscription
    Log    Trying to get a single 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}    ${CONTENT_TYPE_JSON}
    ${result}=    Output    response body
    Validate Json    NsdmSubscription.schema.json    ${result}
    Log    Validated NsdmSubscription schema
GET Individual NSD Management Subscription
    [Documentation]    Test ID: 5.3.1.8.1
    ...    Test title: GET Individual NSD Management Subscription
    ...    Test objective: The objective is to test the retrieval of individual NSD Management subscription and perform a JSON schema and content validation of the returned subscription data structure
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.9.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual NSD Management Subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PkgmSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription

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}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
GET Individual NSD Management Subscription with invalid resource identifier
    [Documentation]    Test ID: 5.3.1.8.2
    ...    Test title: GET Individual NSD Management Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual NSD Management subscription fails when using an invalid resource identifier
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.9.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual NSD Management Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

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 NSD Management Subscription with invalid resource identifier
    [Documentation]    Test ID: 5.3.1.8.3
    ...    Test title: DELETE Individual NSD Management Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual NSD Management subscription fails when using an invalid resource identifier
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.9.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none   
    Send Delete request for individual NSD Management Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

POST Individual NSD Management Subscription - Method not implemented
    [Documentation]    Test ID: 5.3.1.8.4
    ...    Test title: POST Individual NSD Management Subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new NSD Management Subscription
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.9.3.1 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NSD Management Subscription is not created on the NFVO
    Send Post request for individual NSD Management Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition NSD Management Subscription is not Created

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}    ${CONTENT_TYPE_JSON}
    Log    Trying to validate ProblemDetails
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
PUT Individual NSD Management Subscription - Method not implemented
    [Documentation]    Test ID: 5.3.1.8.5
    ...    Test title: PUT Individual NSD Management Subscription - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing NSD Management subscription
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.9.3.3 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NSD Management subscription is not modified by the operation
    Send Put request for individual NSD Management Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition NSD Management Subscription is Unmodified (Implicit)

PUT Subscription - (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    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 NSD Management Subscription - Method not implemented
    [Documentation]    Test ID: 5.3.1.8.6
    ...    Test title: PATCH Individual NSD Management Subscription - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing NSD Management subscription
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.9.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NSD Management subscription is not modified by the operation
    Send Patch request for individual NSD Management Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition NSD Management Subscription is Unmodified (Implicit)

PATCH Subscription - (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    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)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    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
DELETE Individual NSD Management Subscription
    [Documentation]    Test ID: 5.3.1.8.7
    ...    Test title: DELETE Individual NSD Management Subscription
    ...    Test objective: The objective is to test the deletion of an individual NSD Management subscription
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.9.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NSD Management Subscription is not available anymore in the NFVO    
    Send Delete request for individual NSD Management Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition NSD Management Subscription is Deleted
 No newline at end of file
+88 −5
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@
Resource    environment/variables.txt
Resource    environment/subscriptions.txt
Resource    environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
Resource    environment/pnfDescriptors.txt    # Specific nsDescriptors Parameters
Resource    environment/pnfDescriptors.txt    # Specific pnfDescriptors Parameters
Resource    environment/individualSubscription.txt
Library    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library    MockServerLibrary 
Library    OperatingSystem
@@ -114,7 +115,7 @@ Check HTTP Response Body NsdInfos Matches the requested fields selector
    Log    Validation for schema OK

GET all Network Service Descriptors Information with exclude_fields attribute selector
    Log    Trying to get all VNF Packages present in the NFVO Catalogue, using filter params
    Log    Trying to get all NSD Managements present in the NFVO Catalogue, using filter params
    Pass Execution If    ${NFVO_FIELDS} == 0    The NFVO is not able to use exclude_fields option
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -344,7 +345,7 @@ Get single file NSD Content in Plain or Zip Format
    Set Suite Variable    ${response}    ${output}
    
Get multi file NSD Content in Plain or Zip Format
    Log    Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue
    Log    Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -370,7 +371,7 @@ Get NSD Content with invalid resource identifier
    Set Suite Variable    ${response}    ${output} 

Get NSD Content with conflict due to onboarding state
    Log    Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue
    Log    Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -890,7 +891,7 @@ Check HTTP Response Body Is Empty


Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filter
    Log    Check Response includes VNF Package Management according to filter
    Log    Check Response includes NSD Management Management according to filter
    #TODO


@@ -924,6 +925,88 @@ Check Postcondition Subscription Resource Returned in Location Header Is Availab
    Validate Json    NsdmSubscription.schema.json    ${result}
    Log    Validated NsdmSubscription schema
        
Get Individual NSD Management Subscription
    Log    Trying to get a single 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}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET individual NSD Management Subscription with invalid resource identifier
    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}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete request for individual NSD Management 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}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition NSD Management Subscription is Deleted
    Log    Check Postcondition Subscription is deleted
    GET individual NSD Management Subscription
    Check HTTP Response Status Code Is    404 

Send Delete request for individual NSD Management Subscription with invalid resource identifier
    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}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post request for individual NSD Management Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}

Send Put request for individual NSD Management Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    
Send Patch request for individual NSD Management Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
   
Check Postcondition NSD Management Subscription is Unmodified (Implicit)
    Log    Check postconidtion subscription not modified
    GET individual NSD Management Subscription
    Log    Check Response matches original VNF Threshold
    ${subscription}=    evaluate    json.loads('''${response['body']}''')    json
    Should Be Equal    ${origResponse['body']['id']}    ${subscription.id}
    Should Be Equal    ${origResponse['body']['callbackUri']}    ${subscription.callbackUri}

Check Postcondition NSD Management Subscription is not Created
    Log    Trying to get a new subscription
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Check HTTP Response Status Code Is    404

Check HTTP Response Body Subscription Identifier matches the requested Subscription
    Log    Trying to check response ID
    Should Be Equal    ${response['body']['id']}    ${subscriptionId} 
    Log    Subscription identifier as expected

Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
+13 −13

File changed.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
*** Variables ***
${subscriptionId}    f3ae6df7-07e1-47c9-8924-9ebe10343586
${erroneousSubscriptionId}    442e3ee5-0499-4849-9b31-eb91ce1638f1    # Not existing ID on the subscriptions
${newSubscriptionId}    newSubsciptionId
${response}    httpresponse
${origResponse}    httpresponse
+166 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading