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

more doc for SOL005 NSD mgmt

parent 3b8cc907
Loading
Loading
Loading
Loading
+145 −168
Original line number Original line Diff line number Diff line
@@ -3,180 +3,157 @@ Documentation This clause defines all the resources and methods provided by
Library           JSONSchemaLibrary    schemas/
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
Resource          environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
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}
Library    JSONSchemaLibrary    schemas/
Library    JSONSchemaLibrary    schemas/


*** Variable ***
${original_etag}    1234

*** Test Cases ***
*** Test Cases ***
GET Single Network Service Descriptor
GET Individual Network Service Descriptor Information
    [Documentation]   The GET method reads information about an individual NS descriptor.
    [Documentation]    Test ID: 5.3.1.2.1
    ...    This method shall follow the provisions specified in the Tables 5.4.3.3.2-1 and 5.4.3.3.2-2 for URI query parameters,
    ...    Test title: GET Individual Network Service Descriptor Information
    ...    request and response data structures, and response codes.
    ...    Test objective: The objective is to test the retrieval of an individual Network Service Descriptor information and perform a JSON schema validation of the collected data structure
    Log    The GET method reads information about an individual NS descriptor
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Reference: section 5.4.3.3.2 - SOL005 v2.4.1
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Config ID: Config_prod_NFVO
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
    ...    Applicability: none
    Integer    response status    200
    ...    Post-Conditions: none
    ${contentType}=    Output    response headers Content-Type
    GET Individual Network Service Descriptor Information
    Should Contain    ${contentType}    application/json
    Check HTTP Response Status Code Is    200
    Log  Validation of Content-Type : OK
    Check HTTP Response Body Json Schema Is   NsdInfo
    Log    Trying to validate response
    Check HTTP Response Header Contains ETag
    ${result}=    Output    response body
    Check HTTP Response Body NsdInfo Identifier matches the requested Network Service Descriptor Information
    Validate Json    NsdInfo.schema.json    ${result}

    Log    Validation OK
GET Individual Network Service Descriptor Information with invalid resource identifier
    ${etag}    Output    response headers ETag
    [Documentation]    Test ID: 5.3.1.2.2
    Set Suite Variable    &{original_etag}    ${etag}
    ...    Test title: GET Individual Network Service Descriptor Information with invalid resource identifier

    ...    Test objective: The objective is to test that the retrieval of an individual Network Service Descriptor Information fails when using an invalid resource identifier

    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO.
GET Single Network Service Descriptor (Negative: Not found)
    ...    Reference: section 5.4.3.3.2 - SOL005 v2.4.1
    Log    Trying to perform a GET on an erroneous nsDescriptorInfoId
    ...    Config ID: Config_prod_NFVO
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Applicability: none
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Post-Conditions: none
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}
    GET Individual Network Service Descriptor Information with invalid resource identifier
    Integer    response status    404
    Check HTTP Response Status Code Is    404
    Log    Received 404 Not Found as expected

    ${contentType}=    Output    response headers Content-Type
Disable Individual Network Service Descriptor   
    Should Contain    ${contentType}    application/json
    [Documentation]    Test ID: 5.3.1.2.3
    Log    Trying to validate ProblemDetails
    ...    Test title: Disable Individual Network Service Descriptor  
    ${problemDetails}=    Output    response body
    ...    Test objective: The objective is to test the disabling of an individual Network Service Descriptor and perform a JSON schema and content validation of the collected data structure
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in enabled operational state.
    Log    Validation OK
    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1

    ...    Config ID: Config_prod_NFVO

    ...    Applicability: none
PATCH Single Network Service Descriptor - (Disabling a nsdInfo)
    ...    Post-Conditions: The Network Service Descriptor is in operational state DISABLED and usage state is not modified
    [Documentation]    The PATCH method modifies the operational state and/or user defined data of an individual NS descriptor resource.
    Send PATCH to disable Individual Network Service Descriptor
    ...    This method can be used to:
    Check HTTP Response Status Code Is    200
    ...    
    Check HTTP Response Body Json Schema Is   NsdInfoModification
    ...    1) Enable a previously disabled individual NS descriptor resource, allowing again its use for instantiation of new 
    Check Postcondition Network Service Descriptor is in operational state    DISABLED
    ...    network service with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change as a
    Check Postcondition Network Service Descriptor usage state is unmodified (Implicit)
    ...    result.

    ...    
Enable Individual Network Service Descriptor
    ...    2) Disable a previously enabled individual NS descriptor resource, preventing any further use for instantiation of
    [Documentation]    Test ID: 5.3.1.2.4
    ...    new network service(s) with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change
    ...    Test title: Enable Individual Network Service Descriptor
    ...    as a result.
    ...    Test objective: The objective is to test the enabling of an individual Network Service Descriptor and perform a JSON schema and content validation of the collected data structure
    ...    
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in DISABLED operational state (Test ID 5.3.1.2.3).
    ...    3) Modify the user defined data of an individual NS descriptor resource.
    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1
    ...    
    ...    Config ID: Config_prod_NFVO
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
    ...    Applicability: none
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Post-Conditions: The Network Service Descriptor is in operational state ENABLED and usage state is not modified
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Send PATCH to enable Individual Network Service Descriptor
    Set Headers    {"If-Match": "${original_etag[0]}"}
    Check HTTP Response Status Code Is    200
    ${body}=    Get File    jsons/NsdInfoModificationDisable.json
    Check HTTP Response Body Json Schema Is   NsdInfoModification
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Check Postcondition Network Service Descriptor is in operational state    ENABLED
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    Check Postcondition Network Service Descriptor usage state is unmodified (Implicit)   
    Integer    response status    200

    Log    Received 200 OK as expected
Enable Individual Network Service Descriptor with conflict due to operational state ENABLED
    ${result}=    Output    response body
    [Documentation]    Test ID: 5.3.1.2.5
    Validate Json    NsdInfoModification.schema.json    ${result}
    ...    Test title: Enable Individual Network Service Descriptor with conflict due to operational state ENABLED
    Log    Validation of NsdInfoModifications OK
    ...    Test objective: The objective is to test that enabling an individual Network Service Descriptor that is already in ENABLED operational state failsand perform a JSON schema validation of the failder operation HTTP response

    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in ENABLED operational state (Test ID 5.3.1.2.4).
PATCH Single Network Service Descriptor - (Enabling an previously disabled nsdInfo)
    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in disabled operational state
    ...    Config ID: Config_prod_NFVO
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Applicability: none
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ...    Post-Conditions: none
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Send PATCH to enable Individual Network Service Descriptor
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Check HTTP Response Status Code Is    409
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    Check HTTP Response Body Json Schema Is   ProblemDetails
    Integer    response status    200

    Log    Received 200 OK as expected
Enable Individual Network Service Descriptor with conflict due to onboarding state
    ${result}=    Output    response body
    [Documentation]    Test ID: 5.3.1.2.6
    Validate Json    NsdInfoModification.schema.json    ${result}
    ...    Test title: Enable Individual Network Service Descriptor with conflict due to onboarding state
    Log    Validation of NsdInfoModifications OK
    ...    Test objective: The objective is to test that the retrieval of an Network Service Descriptor fails due to a conflict when the Network Service Descriptor is not in onboarding state ONBOARDED in the NFVO. The test also performs a validation of the JSON schema validation of the failed operation HTTP response
    
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in ENABLED operational state. The onboarding state of the Network Service Descriptor for which the enabling is requested is different from ONBOARDED.

    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1
PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable a previously enabled nsdInfo)
    ...    Config ID: Config_prod_NFVO
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
    ...    Applicability: none
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Post-Conditions: none   
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Send PATCH to enable Individual Network Service Descriptor in onboarding state different from ONBOARDED
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Check HTTP Response Status Code Is    409
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Check HTTP Response Body Json Schema Is   ProblemDetails
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId}    ${body}
    
    Integer    response status    409
 Enable Individual Network Service Descriptor with HTTP Etag precondition failure
    Log    Received 409 Conflict as expected
    [Documentation]    Test ID: 5.3.1.2.7
    ${contentType}=    Output    response headers Content-Type
    ...    Test title:  Enable Individual Network Service Descriptor with HTTP Etag precondition failure
    Should Contain    ${contentType}    application/json
    ...    Test objective: The objective is to test that the retrieval of an Network Service Descriptor fails due to a precondition failure when using an uncorrect Http Etag identified.
    Log    Trying to validate ProblemDetails
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in ENABLED operational state (Test ID 5.3.1.2.4).
    ${problemDetails}=    Output    response body
    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    ...    Config ID: Config_prod_NFVO
    Log    Validation OK
    ...    Applicability: none
    
    ...    Post-Conditions: none
    
    Send PATCH to enable Individual Network Service Descriptor with HTTP Etag precondition failure
 PATCH Single Network Service Descriptor - NEGATIVE (Trying to get an ETag mismatch)
    Check HTTP Response Status Code Is    412
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be modified by another entity

    Set Headers    {"Accept": "${ACCEPT_JSON}"}
DELETE Individual Network Service Descriptor
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    [Documentation]    Test ID: 5.3.1.2.9
    Set Headers    {"If-Match": "${original_etag[0]}"}
    ...    Test title:  DELETE Individual Network Service Descriptor
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    ...    Test objective: The objective is to test the deletion of an individual Network Service Descriptor.
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in DISABLED operational state and NOT_IN_USE usage state.
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${modifiedNsdInfoId}    ${body}
    ...    Reference: section 5.4.3.3.5 - SOL005 v2.4.1
    Integer    response status    412
    ...    Config ID: Config_prod_NFVO
    Log    Received 412 Precondition failed as expected
    ...    Applicability: none
    ${returned_etag}=    Output    response headers ETag
    ...    Post-Conditions: The Network Service Descriptor is not available anymore in the NFVO 
    Log    Verify different etags
    Send DELETE Request for Individual Network Service Descriptor
    Should Not Be Equal    ${Etag}    ${returned_etag}    
    Check HTTP Response Status Code Is    204
    ${contentType}=    Output    response headers Content-Type
    Check Postcondition Network Service Descriptor is Deleted
    Should Contain    ${contentType}    application/json

    Log    Trying to validate ProblemDetails
DELETE Individual Network Service Descriptor in operational state ENABLED
    ${problemDetails}=    Output    response body
    [Documentation]    Test ID: 5.3.1.2.10
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    ...    Test title:  DELETE Individual Network Service Descriptor in operational state ENABLED
    Log    Validation OK  
    ...    Test objective: The objective is to test that the deletion of an individual Network Service Descriptor in operational state ENABLED fails. The test also performs a JSON schema validation of the failed operation HTTP response.
    
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in ENABLED operational state (Test ID 5.3.1.2.4).

    ...    Reference: section 5.4.3.3.5 - SOL005 v2.4.1
DELETE Single Network Service Descriptor
    ...    Config ID: Config_prod_NFVO
    [Documentation]    The DELETE method deletes an individual NS descriptor resource.
    ...    Applicability: none
    ...    An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState =
    ...    Post-Conditions: The Network Service Descriptor is not deleted by the failed operation. 
    ...    NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method
    Send DELETE Request for Individual Network Service Descriptor in operational state ENABLED
    ...    shall fail.
    Check HTTP Response Status Code Is    409
    Log    Trying to perform a DELETE nsdInfo. The nsdInfo should be in "NOT_USED" usageState and in "DISABLED" operationalState.
    Check HTTP Response Body Json Schema Is   ProblemDetails
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Check Postcondition Network Service Descriptor Exists
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}

    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
POST Individual Network Service Descriptor - Method not implemented
    Integer    response status    204
    [Documentation]    Test ID: 5.3.1.2.11
    Log    Received 204 No Content as expected
    ...    Test title: POST Individual Network Service Descriptor - Method not implemented

    ...    Test objective: The objective is to test that POST method is not allowed to create a new Network Service Descriptor

    ...    Pre-conditions: none
DELETE Single Network Service Descriptor (Negative: Trying to delete an enabled nsdInfo)
    ...    Reference:  section 5.4.3.3.1 - SOL005 v2.4.1
    [Documentation]    The DELETE method deletes an individual NS descriptor resource.
    ...    Config ID: Config_prod_NFVO
    ...    An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState =
    ...    Applicability: none
    ...    NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method
    ...    Post-Conditions: none
    ...    shall fail.
    Send POST Request for Individual Network Service Descriptor
    Log    Trying to perform a DELETE nsdInfo in ENABLED operational state
    Check HTTP Response Status Code Is    405
    Set Headers    {"Accept": "${ACCEPT_JSON}"}

    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
PUT Individual Network Service Descriptor - Method not implemented
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId}
    [Documentation]    Test ID: 5.3.1.2.12
    Integer    response status    409
    ...    Test title: PUT Individual Network Service Descriptor - Method not implemented
    Log    Received 409 Conflict as expected
    ...    Test objective: The objective is to test that PUT method is not allowed to modify a new Network Service Descriptor
    ${contentType}=    Output    response headers Content-Type
    ...    Pre-conditions: none
    Should Contain    ${contentType}    application/json
    ...    Reference:  section 5.4.3.3.3 - SOL005 v2.4.1
    Log    Trying to validate ProblemDetails
    ...    Config ID: Config_prod_NFVO
    ${problemDetails}=    Output    response body
    ...    Applicability: none
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    ...    Post-Conditions: none
    Log    Validation OK
    Send PUT Request for Individual Network Service Descriptor

    Check HTTP Response Status Code Is    405

POST Single Network Service Descriptor (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}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected



PUT Single Network Service Descriptor (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}/ns_descriptors/${nsdInfoId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected


+214 −184

File changed.

Preview size limit exceeded, changes collapsed.

+442 −0

File changed.

Preview size limit exceeded, changes collapsed.

+139 −143

File changed.

Preview size limit exceeded, changes collapsed.

+13 −3
Original line number Original line Diff line number Diff line
@@ -2,19 +2,29 @@
${POS_FIELDS}     name=nsdOnboardingState
${POS_FIELDS}     name=nsdOnboardingState
${NEG_FIELDS}     wrongName=any_value
${NEG_FIELDS}     wrongName=any_value
${nsdInfoId}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoId}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoIdPlain}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoIdZip}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${erroneous_nsdInfoId}  erroneous_nsdInfoId
${erroneous_nsdInfoId}  erroneous_nsdInfoId
${enabledNsdInfoId}  5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${disabledNsdInfoId}  5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${fields}    _links
${fields}    _links
${NFVO_FIELDS}    1
${NFVO_FIELDS}    1
${Etag}=    an etag
${Etag}=    an etag
${modifiedNsdInfoId}    f27200b1-1d8b-48c2-9d98-a993b8ab117f
${modifiedNsdInfoId}    f27200b1-1d8b-48c2-9d98-a993b8ab117f
${notOnboardedNsdInfoId}    b992a851-08b1-45a8-9282-a5f7a7df04a6
${ACCEPT_ZIP}    application/zip
${ACCEPT_ZIP}    application/zip
${ACCEPT_PLAIN}    text/plain
${CONTENT_TYPE_ZIP}    application/zip
${CONTENT_TYPE_ZIP}    application/zip
${CONTENT_TYPE_PLAIN}    text/plain
${NFVO_RANGE_OK}    1
${NFVO_RANGE_OK}    1
${range}          bytes=0-1023
${range}          bytes=0-1023
${erroneousRange}    bytes=100000-1000000    # Requesting a out of range number of bytes
${erroneousRange}    bytes=100000-1000000    # Requesting a out of range number of bytes
${onboardingStateNsdInfoId}    b992a851-08b1-45a8-9282-a5f7a7df04a6
${onboardingStateNsdInfoId}    b992a851-08b1-45a8-9282-a5f7a7df04a6
${contentFile}    files/nsdContent.zip
${contentZipFile}    files/nsdContent.zip
${contentPlainFile}    files/nsdContent.yaml
${creatingNsdInfoId}    71241932-994a-46e2-ad6c-1740674dda44
${creatingNsdInfoId}    71241932-994a-46e2-ad6c-1740674dda44
${NEG_AUTHORIZATION}    Bearer negativetoken
${NEG_AUTHORIZATION}    Bearer negativetoken
${BAD_AUTHORIZATION}    Bear sometoken
${BAD_AUTHORIZATION}    Bear sometoken
${original_etag}    1234
${wrong_etag}    abcd
${usageState}    state
${length}          1024
 No newline at end of file