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 Original line Diff line number Diff line
@@ -2,84 +2,98 @@
Library           JSONSchemaLibrary    schemas/
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/individualSubscription.txt
Resource          environment/individualSubscription.txt
Resource          NSDManagementKeywords.robot
Library           OperatingSystem
Library           OperatingSystem
Library           JSONLibrary
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}


*** Test Cases ***
*** Test Cases ***
GET Individual Subscription
GET Individual NSD Management Subscription
    Log    Trying to get a single subscription identified by subscriptionId
    [Documentation]    Test ID: 5.3.1.8.1
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: GET Individual NSD Management Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    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
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    Integer    response status    200
    ...    Reference:  section 5.4.9.3.2 - SOL005 v2.4.1
    Log    Received a 200 OK as expected
    ...    Config ID: Config_prod_NFVO
    ${contentType}=    Output    response headers Content-Type
    ...    Applicability: none
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ...    Post-Conditions: none
    ${result}=    Output    response body
    Get Individual NSD Management Subscription
    Validate Json    NsdmSubscription.schema.json    ${result}
    Check HTTP Response Status Code Is    200
    Log    Validated NsdmSubscription schema
    Check HTTP Response Body Json Schema Is   PkgmSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription


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


DELETE Subscription
DELETE Individual NSD Management Subscription with invalid resource identifier
    Log    Trying to perform a DELETE on a subscriptionId
    [Documentation]    Test ID: 5.3.1.8.3
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: DELETE Individual NSD Management Subscription with invalid resource identifier
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that the deletion of an individual NSD Management subscription fails when using an invalid resource identifier
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    Integer    response status    204
    ...    Reference:  section 5.4.9.3.5 - SOL005 v2.4.1
    Log    Received 204 No Content as expected
    ...    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)
PUT Individual NSD Management Subscription - Method not implemented
    Log    Trying to perform a DELETE on a subscriptionId which doesn't exist
    [Documentation]    Test ID: 5.3.1.8.5
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: PUT Individual NSD Management Subscription - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing NSD Management subscription
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    Integer    response status    404
    ...    Reference:  section 5.4.9.3.3 - SOL005 v2.4.1
    Log    The subscriptionId is not present in database
    ...    Config ID: Config_prod_NFVO
    ${contentType}=    Output    response headers Content-Type
    ...    Applicability: none
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ...    Post-Conditions: The NSD Management subscription is not modified by the operation
    Log    Trying to validate ProblemDetails
    Send Put request for individual NSD Management Subscription
    ${problemDetails}=    Output    response body
    Check HTTP Response Status Code Is    405
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Check Postcondition NSD Management Subscription is Unmodified (Implicit)
    Log    Validation OK


PUT Subscription - (Method not implemented)
PATCH Individual NSD Management Subscription - Method not implemented
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.1.8.6
    Log    Trying to perform a PUT. This method should not be implemented
    ...    Test title: PATCH Individual NSD Management Subscription - Method not implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing NSD Management subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Reference:  section 5.4.9.3.4 - SOL005 v2.4.1
    Integer    response status    405
    ...    Config ID: Config_prod_NFVO
    Log    Received 405 Method not implemented as expected
    ...    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)
DELETE Individual NSD Management Subscription
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    [Documentation]    Test ID: 5.3.1.8.7
    Log    Trying to perform a PATCH. This method should not be implemented
    ...    Test title: DELETE Individual NSD Management Subscription
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test objective: The objective is to test the deletion of an individual NSD Management subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Reference:  section 5.4.9.3.5 - SOL005 v2.4.1
    Integer    response status    405
    ...    Config ID: Config_prod_NFVO
    Log    Received 405 Method not implemented as expected
    ...    Applicability: none

    ...    Post-Conditions: The NSD Management Subscription is not available anymore in the NFVO    
POST Subscription - (Method not implemented)
    Send Delete request for individual NSD Management Subscription
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Check HTTP Response Status Code Is    204
    Log    Trying to perform a POST. This method should not be implemented
    Check Postcondition NSD Management Subscription is Deleted
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
 No newline at end of file
    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
+88 −5
Original line number Original line Diff line number Diff line
@@ -2,7 +2,8 @@
Resource    environment/variables.txt
Resource    environment/variables.txt
Resource    environment/subscriptions.txt
Resource    environment/subscriptions.txt
Resource    environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
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    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library    MockServerLibrary 
Library    MockServerLibrary 
Library    OperatingSystem
Library    OperatingSystem
@@ -114,7 +115,7 @@ Check HTTP Response Body NsdInfos Matches the requested fields selector
    Log    Validation for schema OK
    Log    Validation for schema OK


GET all Network Service Descriptors Information with exclude_fields attribute selector
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
    Pass Execution If    ${NFVO_FIELDS} == 0    The NFVO is not able to use exclude_fields option
    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}"}
@@ -344,7 +345,7 @@ Get single file NSD Content in Plain or Zip Format
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Get multi file NSD Content in Plain or Zip Format
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_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    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} 
    Set Suite Variable    ${response}    ${output} 


Get NSD Content with conflict due to onboarding state
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_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    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
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
    #TODO




@@ -924,6 +925,88 @@ Check Postcondition Subscription Resource Returned in Location Header Is Availab
    Validate Json    NsdmSubscription.schema.json    ${result}
    Validate Json    NsdmSubscription.schema.json    ${result}
    Log    Validated NsdmSubscription schema
    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
Check HTTP Response Header Contains
    [Arguments]    ${CONTENT_TYPE}
    [Arguments]    ${CONTENT_TYPE}
+13 −13

File changed.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Original line Diff line number Diff line
*** Variables ***
*** Variables ***
${subscriptionId}    f3ae6df7-07e1-47c9-8924-9ebe10343586
${subscriptionId}    f3ae6df7-07e1-47c9-8924-9ebe10343586
${erroneousSubscriptionId}    442e3ee5-0499-4849-9b31-eb91ce1638f1    # Not existing ID on the subscriptions
${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