SOL005 NSD management more docs

Merge request reports

Loading
+12 −2
Changes for SOL005/NSDManagement-API/environment/nsDescriptors.txt: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -2,19 +2,29 @@
${POS_FIELDS}     name=nsdOnboardingState
${NEG_FIELDS}     wrongName=any_value
${nsdInfoId}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoIdPlain}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${nsdInfoIdZip}    5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${erroneous_nsdInfoId}  erroneous_nsdInfoId
${enabledNsdInfoId}  5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${disabledNsdInfoId}  5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${fields}    _links
${NFVO_FIELDS}    1
${Etag}=    an etag
${modifiedNsdInfoId}    f27200b1-1d8b-48c2-9d98-a993b8ab117f
${notOnboardedNsdInfoId}    b992a851-08b1-45a8-9282-a5f7a7df04a6
${ACCEPT_ZIP}    application/zip
${ACCEPT_PLAIN}    text/plain
${CONTENT_TYPE_ZIP}    application/zip
${CONTENT_TYPE_PLAIN}    text/plain
${NFVO_RANGE_OK}    1
${range}          bytes=0-1023
${erroneousRange}    bytes=100000-1000000    # Requesting a out of range number of bytes
${onboardingStateNsdInfoId}    b992a851-08b1-45a8-9282-a5f7a7df04a6
${contentFile}    files/nsdContent.zip
${contentZipFile}    files/nsdContent.zip
${contentPlainFile}    files/nsdContent.yaml
${creatingNsdInfoId}    71241932-994a-46e2-ad6c-1740674dda44
${NEG_AUTHORIZATION}    Bearer negativetoken
${BAD_AUTHORIZATION}    Bear sometoken
${original_etag}    1234
${wrong_etag}    abcd
${usageState}    state
${length}          1024
 No newline at end of file
+6 −0
Changes for SOL005/NSDManagement-API/schemas/UserDefinedData.schema.json: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
	"description": "list of user defined data in key-value pairs",
	"type": "object"
}

+146 −169
Changes for SOL005/NSDManagement-API/IndividualNSDescriptor.robot: 146 added lines, 169 removed lines.
Original line number Diff line number Diff line
@@ -3,180 +3,157 @@ Documentation This clause defines all the resources and methods provided by
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
Resource          NSDManagementKeywords.robot
Library           OperatingSystem
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library    JSONSchemaLibrary    schemas/

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

*** Test Cases ***
GET Single Network Service Descriptor
    [Documentation]   The GET method reads information about an individual NS descriptor.
    ...    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,
    ...    request and response data structures, and response codes.
    Log    The GET method reads information about an individual NS descriptor
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    application/json
    Log  Validation of Content-Type : OK
    Log    Trying to validate response
    ${result}=    Output    response body
    Validate Json    NsdInfo.schema.json    ${result}
    Log    Validation OK
    ${etag}    Output    response headers ETag
    Set Suite Variable    &{original_etag}    ${etag}


GET Single Network Service Descriptor (Negative: Not found)
    Log    Trying to perform a GET on an erroneous nsDescriptorInfoId
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}
    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


PATCH Single Network Service Descriptor - (Disabling a nsdInfo)
    [Documentation]    The PATCH method modifies the operational state and/or user defined data of an individual NS descriptor resource.
    ...    This method can be used to:
    ...    
    ...    1) Enable a previously disabled individual NS descriptor resource, allowing again its use for instantiation of new 
    ...    network service with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change as a
    ...    result.
    ...    
    ...    2) Disable a previously enabled individual NS descriptor resource, preventing any further use for instantiation of
    ...    new network service(s) with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change
    ...    as a result.
    ...    
    ...    3) Modify the user defined data of an individual NS descriptor resource.
    ...    
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${original_etag[0]}"}
    ${body}=    Get File    jsons/NsdInfoModificationDisable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    Integer    response status    200
    Log    Received 200 OK as expected
    ${result}=    Output    response body
    Validate Json    NsdInfoModification.schema.json    ${result}
    Log    Validation of NsdInfoModifications OK

PATCH Single Network Service Descriptor - (Enabling an previously disabled nsdInfo)
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in disabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    Integer    response status    200
    Log    Received 200 OK as expected
    ${result}=    Output    response body
    Validate Json    NsdInfoModification.schema.json    ${result}
    Log    Validation of NsdInfoModifications OK
    

PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable a previously enabled nsdInfo)
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId}    ${body}
    Integer    response status    409
    Log    Received 409 Conflict 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
    
    
 PATCH Single Network Service Descriptor - NEGATIVE (Trying to get an ETag mismatch)
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be modified by another entity
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${original_etag[0]}"}
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${modifiedNsdInfoId}    ${body}
    Integer    response status    412
    Log    Received 412 Precondition failed as expected
    ${returned_etag}=    Output    response headers ETag
    Log    Verify different etags
    Should Not Be Equal    ${Etag}    ${returned_etag}    
    ${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 Single Network Service Descriptor
    [Documentation]    The DELETE method deletes an individual NS descriptor resource.
    ...    An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState =
    ...    NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method
    ...    shall fail.
    Log    Trying to perform a DELETE nsdInfo. The nsdInfo should be in "NOT_USED" usageState and in "DISABLED" operationalState.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
    Integer    response status    204
    Log    Received 204 No Content as expected


DELETE Single Network Service Descriptor (Negative: Trying to delete an enabled nsdInfo)
    [Documentation]    The DELETE method deletes an individual NS descriptor resource.
    ...    An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState =
    ...    NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method
    ...    shall fail.
    Log    Trying to perform a DELETE nsdInfo in ENABLED operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId}
    Integer    response status    409
    Log    Received 409 Conflict 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 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
GET Individual Network Service Descriptor Information
    [Documentation]    Test ID: 5.3.1.2.1
    ...    Test title: GET Individual Network Service Descriptor Information
    ...    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
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO.
    ...    Reference: section 5.4.3.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual Network Service Descriptor Information
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   NsdInfo
    Check HTTP Response Header Contains ETag
    Check HTTP Response Body NsdInfo Identifier matches the requested Network Service Descriptor Information

GET Individual Network Service Descriptor Information with invalid resource identifier
    [Documentation]    Test ID: 5.3.1.2.2
    ...    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.
    ...    Reference: section 5.4.3.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual Network Service Descriptor Information with invalid resource identifier
    Check HTTP Response Status Code Is    404

Disable Individual Network Service Descriptor   
    [Documentation]    Test ID: 5.3.1.2.3
    ...    Test title: Disable Individual Network Service Descriptor  
    ...    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
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in enabled operational state.
    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The Network Service Descriptor is in operational state DISABLED and usage state is not modified
    Send PATCH to disable Individual Network Service Descriptor
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   NsdInfoModification
    Check Postcondition Network Service Descriptor is in operational state    DISABLED
    Check Postcondition Network Service Descriptor usage state is unmodified (Implicit)

Enable Individual Network Service Descriptor
    [Documentation]    Test ID: 5.3.1.2.4
    ...    Test title: Enable Individual Network Service Descriptor
    ...    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).
    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The Network Service Descriptor is in operational state ENABLED and usage state is not modified
    Send PATCH to enable Individual Network Service Descriptor
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   NsdInfoModification
    Check Postcondition Network Service Descriptor is in operational state    ENABLED
    Check Postcondition Network Service Descriptor usage state is unmodified (Implicit)   

Enable Individual Network Service Descriptor with conflict due to operational state ENABLED
    [Documentation]    Test ID: 5.3.1.2.5
    ...    Test title: Enable Individual Network Service Descriptor with conflict due to operational state ENABLED
    ...    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).
    ...    Reference: section 5.4.3.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PATCH to enable Individual Network Service Descriptor
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails

Enable Individual Network Service Descriptor with conflict due to onboarding state
    [Documentation]    Test ID: 5.3.1.2.6
    ...    Test title: Enable Individual Network Service Descriptor with conflict due to onboarding state
    ...    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
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none   
    Send PATCH to enable Individual Network Service Descriptor in onboarding state different from ONBOARDED
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
 Enable Individual Network Service Descriptor with HTTP Etag precondition failure
    [Documentation]    Test ID: 5.3.1.2.7
    ...    Test title:  Enable Individual Network Service Descriptor with HTTP Etag precondition failure
    ...    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.
    ...    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.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PATCH to enable Individual Network Service Descriptor with HTTP Etag precondition failure
    Check HTTP Response Status Code Is    412

DELETE Individual Network Service Descriptor
    [Documentation]    Test ID: 5.3.1.2.9
    ...    Test title:  DELETE Individual Network Service Descriptor
    ...    Test objective: The objective is to test the deletion of an individual Network Service Descriptor.
    ...    Pre-conditions: One or more Network Service Descriptors are set in the NFVO in DISABLED operational state and NOT_IN_USE usage state.
    ...    Reference: section 5.4.3.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The Network Service Descriptor is not available anymore in the NFVO 
    Send DELETE Request for Individual Network Service Descriptor
    Check HTTP Response Status Code Is    204
    Check Postcondition Network Service Descriptor is Deleted

DELETE Individual Network Service Descriptor in operational state ENABLED
    [Documentation]    Test ID: 5.3.1.2.10
    ...    Test title:  DELETE Individual Network Service Descriptor in operational state ENABLED
    ...    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
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The Network Service Descriptor is not deleted by the failed operation. 
    Send DELETE Request for Individual Network Service Descriptor in operational state ENABLED
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails
    Check Postcondition Network Service Descriptor Exists

POST Individual Network Service Descriptor - Method not implemented
    [Documentation]    Test ID: 5.3.1.2.11
    ...    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
    ...    Reference:  section 5.4.3.3.1 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send POST Request for Individual Network Service Descriptor
    Check HTTP Response Status Code Is    405

PUT Individual Network Service Descriptor - Method not implemented
    [Documentation]    Test ID: 5.3.1.2.12
    ...    Test title: PUT Individual Network Service Descriptor - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify a new Network Service Descriptor
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.3.3.3 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PUT Request for Individual Network Service Descriptor
    Check HTTP Response Status Code Is    405

+228 −198
Changes for SOL005/NSDManagement-API/NSDContent.robot: 228 added lines, 198 removed lines.
Original line number Diff line number Diff line
@@ -3,206 +3,236 @@ Documentation This clause defines the content of the individual NS descripto
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
Resource          NSDManagementKeywords.robot
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library           OperatingSystem

*** Test Cases ***
GET NSD Content
    [Documentation]   The GET method fetches the content of the NSD.
    ...    The NSD can be implemented as a single file or as a collection of multiple files. If the NSD is implemented in the form
    ...    of multiple files, a ZIP file embedding these files shall be returned. If the NSD is implemented as a single file, either
    ...    that file or a ZIP file embedding that file shall be returned.
    ...    
    ...    The selection of the format is controlled by the "Accept" HTTP header passed in the GET request:
    ...    
    ...    - If the "Accept" header contains only "text/plain" and the NSD is implemented as a single file, the file shall be
    ...    returned; otherwise, an error message shall be returned.
    ...    
    ...    - If the "Accept" header contains only "application/zip", the single file or the multiple files that make up the
    ...    NSD shall be returned embedded in a ZIP file.
    ...    
    ...    - If the "Accept" header contains both "text/plain" and "application/zip", it is up to the NFVO to choose the
    ...    format to return for a single-file NSD; for a multi-file NSD, a ZIP file shall be returned.
    ...    
    ...    NOTE: The structure of the NSD zip file is outside the scope of the present document.
    ...    
    ...    This method shall follow the provisions specified in the Tables 5.4.4.3.2-1 and 5.4.4.3.2-2 for URI query parameters,
    ...    request and response data structures, and response codes.
    Log    The GET method queries multiple NS descriptors
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_ZIP}


GET NSD Content - Range
    Log    Trying to get a NSD Content using RANGE using an NFVO that can handle it
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
    Integer    response status    206
    Log    Received 206 Partial Content as expected.
    ${headers}=    Output    response headers
    Should Contain    ${headers}    Content-Range
    Log    Header Content-Range is present
    Should Contain    ${headers}    Content-Length
    Log    Header Content-Length is present
    
    
        
GET NSD Content - Negative Range
    Log    Trying to get a range of bytes of the limit of the NSD Content
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
    Integer    response status    416
    Log    Received 416 Range not satisfiable 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 NSD Content- Negative (Not Found)
    Log    Trying to perform a negative get, using an erroneous package ID
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}/nsd_content
    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 NSD Content - Negative (onboardingState issue)
    Log    Trying to get a NSD content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${onboardingStateNsdInfoId}/nsd_content
    Integer    response status    409
    Log    Received 409 Conflict 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
      
        
PUT a NSD Content - Asynchronous mode
    [Documentation]    The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in
    ...    clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be
    ...    uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded.
    ...    The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the
    ...    NSD.
    ...    
    ...    - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain".
    ...    
    ...    - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip".
    ...    
    ...    This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters,
    ...    request and response data structures, and response codes.
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get Binary File  ${contentFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content    ${body}
    Integer    response status    202
    Log    Received 202 Accepted as expected
    ${response}=    Output    response body
    Should Be Empty    ${response}    
    
    
PUT a NSD Content - Synchronous mode
    [Documentation]    The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in
    ...    clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be
    ...    uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded.
    ...    The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the
    ...    NSD.
    ...    
    ...    - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain".
    ...    
    ...    - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip".
    ...    
    ...    This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters,
    ...    request and response data structures, and response codes.
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get Binary File  ${contentFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content    ${body}
    Integer    response status    200
    Log    Received 200 OK as expected
    ${response}=    Output    response body
    Should Be Empty    ${response}   
    
    
PUT a NSD Content - Negative. Nsd in CREATING state
    [Documentation]    The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in
    ...    clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be
    ...    uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded.
    ...    The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the
    ...    NSD.
    ...    
    ...    - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain".
    ...    
    ...    - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip".
    ...    
    ...    This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters,
    ...    request and response data structures, and response codes.
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get Binary File  ${contentFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${creatingNsdInfoId}/nsd_content    ${body}
    Integer    response status    409
    Log    Received 409 Conflict 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 a NSD Content (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
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
    Integer    response status    405
    Log    Received 405 Method not implemented as expected



PATCH a NSD Content (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
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
    Integer    response status    405
    Log    Received 405 Method not implemented as expected

DELETE a NSD Content (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
Get single file NSD Content in Plain Format
    [Documentation]    Test ID: 5.3.1.3.1
    ...    Test title: Get single file NSD Content in Plain Format
    ...    Test objective: The objective is to test the retrieval of the NSD Content in plain format and perform a validation that returned content is in plain format
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD is implemented as a single file
    ...    Post-Conditions: none
    Get single file NSD Content in Plain Format
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    text/plain

Get NSD Content in Zip Format
    [Documentation]    Test ID: 5.3.1.3.2
    ...    Test title: Get NSD Content in Zip Format
    ...    Test objective: The objective is to test the retrieval of the NSD Content in zip format and perform a validation that returned content is in zip format
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD Content in Zip Format
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    application/zip

Get single file NSD Content in Plain or Zip Format
    [Documentation]    Test ID: 5.3.1.3.3
    ...    Test title: Get single file NSD Content in Plain or Zip Format
    ...    Test objective: The objective is to test the retrieval of the single file NSD Content when requesting Plain or Zip format to NFVO by including both formats in the request, and perform a validation that returned content is in Plain or Zip format
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD Content is implemented as a single file
    ...    Post-Conditions: none
    Get single file NSD Content in Plain or Zip Format
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is Any of   text/plain    application/zip
    
Get multi file NSD Content in Plain or Zip Format
    [Documentation]    Test ID: 5.3.1.3.4
    ...    Test title: Get multi file NSD Content in Plain or Zip Format
    ...    Test objective: The objective is to test the retrieval of the multi file NSD Content when requesting Plain or Zip format to NFVO by including both formats in the request, and perform a validation that returned content is in Zip format
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD is implemented as a multi file
    ...    Post-Conditions: none
    Get multi file NSD Content in Plain or Zip Format
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    application/zip

Get multi file NSD Content in Plain Format
    [Documentation]    Test ID: 5.3.1.3.5
    ...    Test title: Get multi file NSD Content in Plain Format
    ...    Test objective: The objective is to test that the retrieval of the multi file NSD Content fails when requesting it in Plain format, and perform a validation of the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD Content is implemented as a multi file
    ...    Post-Conditions: none
    Get multi file NSD Content in Plain Format
    Check HTTP Response Status Code Is    406
    Check HTTP Response Body Json Schema Is   ProblemDetails

Get NSD Content with invalid resource identifier
    [Documentation]    Test ID: 5.3.1.3.6
    ...    Test title: Get NSD Content with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of the NSD Content fails when using an invalid resource identifier
    ...    Pre-conditions: none
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD Content with invalid resource identifier
    Check HTTP Response Status Code Is    404

Get NSD Content with conflict due to onboarding state
    [Documentation]    Test ID: 5.3.1.3.7
    ...    Test title: Get NSD Content with conflict due to onboarding state
    ...    Test objective: The objective is to test that the retrieval of the NSD Content fails due to a conflict when the NSD 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: The onboarding state of the NSD for which the NSD Content is requested is different from ONBOARDED.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
    Get NSD Content with conflict due to onboarding state
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails

GET NSD Content with Range Request and NFVO supporting Range Requests
    [Documentation]    Test ID: 5.3.1.3.8
    ...    Test title: GET NSD Content with Range Request and NFVO supporting Range Requests
    ...    Test objective: The objective is to test the retrieval of NSD Content when using a range request to return single range of bytes from the file, with the NFVO supporting it. The test also perform a validation that returned content matches the issued range
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports range requests to return single range of bytes from the NSD file
    ...    Post-Conditions: none
    GET NSD Content with Range Request
    Check HTTP Response Status Code Is    206
    Check HTTP Response Header Content-Type Is    application/zip
    Check HTTP Response Header Content-Range Is Present and Matches the requested range
    Check HTTP Response Header Content-Length Is Present and Matches the requested range length

GET NSD Content with Range Request and NFVO not supporting Range Requests
    [Documentation]    Test ID: 5.3.1.3.9
    ...    Test title: GET NSD Content with Range Request and NFVO not supporting Range Requests
    ...    Test objective: The objective is to test that the retrieval of NSD Content, when using a range request to return single range of bytes from the file and the NFVO not supporting it, returns the full NSD file.
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO does not support range requests to return single range of bytes from the NSD file
    ...    Post-Conditions: none    
    GET NSD Content with Range Request
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    application/zip    

GET NSD Content with invalid Range Request
    [Documentation]    Test ID: 5.3.1.3.10
    ...    Test title: GET NSD Content with invalid Range Request
    ...    Test objective: The objective is to test that the retrieval of NSD Content fails when using a range request that does not match any available byte range in the file.
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports range requests to return single range of bytes from the NSD file
    ...    Post-Conditions: none      
    GET NSD Content with invalid Range Request
    Check HTTP Response Status Code Is    416     
        
Upload NSD Content as Zip file in asynchronous mode
    [Documentation]    Test ID: 5.3.1.3.11
    ...    Test title: Upload NSD Content as Zip file in asynchronous mode
    ...    Test objective: The objective is to test the upload of an NSD Content in Zip format when the NFVO supports the asynchronous upload mode.
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports supports the upload of NSD contents in asynchronous mode
    ...    Post-Conditions: none
    Send PUT Request to upload NSD Content as zip file file in asynchronous mode
    Check HTTP Response Status Code Is    202
    
Upload NSD Content as plain text file in asynchronous mode
    [Documentation]    Test ID: 5.3.1.3.12
    ...    Test title: Upload NSD Content as plain text file in asynchronous mode
    ...    Test objective: The objective is to test the upload of an NSD Content in plain text format when the NFVO supports the asynchronous upload mode.
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports supports the upload of NSD contents in asynchronous mode
    ...    Post-Conditions: none
    Send PUT Request to upload NSD Content as plain text file in asynchronous mode
    Check HTTP Response Status Code Is    202   
    
Upload NSD Content as Zip file in synchronous mode
    [Documentation]    Test ID: 5.3.1.3.13
    ...    Test title: Upload NSD Content as Zip file in synchronous mode
    ...    Test objective: The objective is to test the upload of an NSD Content in Zip format when the NFVO supports the synchronous upload mode.
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports supports the upload of NSD contents in synchronous mode
    ...    Post-Conditions: none
    Send PUT Request to upload NSD Content as zip file in synchronous mode
    Check HTTP Response Status Code Is    204
    
Upload NSD Content as plain text file in synchronous mode
    [Documentation]    Test ID: 5.3.1.3.14
    ...    Test title: Upload NSD Content as plain text file in synchronous mode
    ...    Test objective: The objective is to test the upload of an NSD Content in plain text format when the NFVO supports the synchronous upload mode.
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: section 5.4.4.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports supports the upload of NSD contents in synchronous mode
    ...    Post-Conditions: none
    Send PUT Request to upload NSD Content as plain text file in synchronous mode
    Check HTTP Response Status Code Is    204   
 
Upload NSD Content with conflict due to onboarding state
   [Documentation]    Test ID: 5.3.1.3.15
    ...    Test title: Upload NSD Content with conflict due to onboarding state
    ...    Test objective: The objective is to test that the upload of the NSD Content fails due to a conflict when the NSD is not in onboarding state CREATED in the NFVO. The test also performs a validation of the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: The onboarding state of the NSD for which the NSD Content is requested is different from ONBOARDED.
    ...    Reference: section 5.4.4.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
    Send PUT Request to upload NSD Content with conflict due to onboarding state
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails             

POST NSD Content - Method not implemented
    [Documentation]    Test ID: 5.3.1.3.16
    ...    Test title: POST NSD Content - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new Network Service Descriptor content
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.4.3.1 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send POST Request for NSD Content
    Check HTTP Response Status Code Is    405

PATCH NSD Content - Method not implemented
    [Documentation]    Test ID: 5.3.1.3.16
    ...    Test title: PATCH NSD Content - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update Network Service Descriptor content
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.4.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PATCH Request for NSD Content
    Check HTTP Response Status Code Is    405

DELETE NSD Content - Method not implemented
    [Documentation]    Test ID: 5.3.1.3.17
    ...    Test title: DELETE NSD Content - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete Network Service Descriptor content
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.4.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NSD content is not deleted by the failed operation
    Send DELETE Request for NSD Content
    Check HTTP Response Status Code Is    405
    Check Postcondition NSD Content Exists
+442 −0
Changes for SOL005/NSDManagement-API/NSDManagementKeywords.robot: 442 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
Resource    environment/variables.txt
Resource    environment/subscriptions.txt
Resource    environment/nsDescriptors.txt    # Specific nsDescriptors Parameters
Resource    environment/pnfDescriptors.txt    # Specific nsDescriptors Parameters
Library    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library    MockServerLibrary 
Library    OperatingSystem
@@ -178,6 +179,442 @@ Check Postcondition Network Service Descriptors Exist
    Log    Checking that Pm Job still exists
    GET all Network Service Descriptors Information

GET Individual Network Service Descriptor Information
    Log    The GET method reads information about an individual NS descriptor
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check HTTP Response Body NsdInfo Identifier matches the requested Network Service Descriptor Information
    Log    Going to validate info retrieved
    Should Be Equal    ${response['body']['id']}    ${nsdInfoId} 
    Log    NSD identifier as expected

GET Individual Network Service Descriptor Information with invalid resource identifier
    Log    Trying to perform a GET on an erroneous nsDescriptorInfoId
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}
    Integer    response status    404
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${usageState}    ${response['body']['nsdUsageState']}

Send PATCH to disable Individual Network Service Descriptor
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${original_etag[0]}"}
    ${body}=    Get File    jsons/NsdInfoModificationDisable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition Network Service Descriptor is in operational state
    [Arguments]    ${status}
    Log    Checking postcondition op status
    Should Be Equal As Strings   ${response['body']['nsdOperationalState']}    ${status} 

Check Postcondition Network Service Descriptor usage state is unmodified (Implicit)
    Log    Checking postcondition use status
    Should Be Equal As Strings   ${response['body']['nsdUsageState']}    ${usageState} 

Send PATCH to enable Individual Network Service Descriptor
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be in disabled operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${original_etag[0]}"}
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PATCH to enable Individual Network Service Descriptor in onboarding state different from ONBOARDED
    Log    Trying to patch a NSD present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${original_etag[0]}"}
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${notOnboardedNsdInfoId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

 Send PATCH to enable Individual Network Service Descriptor with HTTP Etag precondition failure
    Log    Trying to perform a PATCH. As prerequisite the nsdInfo shall be modified by another entity
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${wrong_etag[0]}"}
    ${body}=    Get File    jsons/NsdInfoModificationEnable.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send DELETE Request for Individual Network Service Descriptor
    Log    Trying to perform a DELETE nsdInfo. The nsdInfo should be in "NOT_USED" usageState and in "DISABLED" operationalState.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${disabledNsdInfoId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition Network Service Descriptor is Deleted
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${disabledNsdInfoId}
    Integer    response status    404

Send DELETE Request for Individual Network Service Descriptor in operational state ENABLED
    Log    Trying to perform a DELETE nsdInfo in ENABLED operational state
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition Network Service Descriptor Exists
    GET Individual Network Service Descriptor Information

Send POST Request for Individual Network Service Descriptor
    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}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PUT Request for Individual Network Service Descriptor
    Log    Trying to perform a PUT. 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}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check HTTP Response Header Content-Type Is
    [Arguments]   ${header}
    Should Contain    ${response['headers']['Content-Type']}    ${header}

Check HTTP Response Header Content-Type Is Any of
    [Arguments]   ${header1}    ${header2}
    Should Contain Any  ${response['headers']['Content-Type']}    ${header1}    ${header2}

Check HTTP Response Header Content-Range Is Present and Matches the requested range
    Log    Check Content-Range HTTP Header
    Should Contain    ${response['headers']}    Content-Range
    Should Be Equal As Strings    ${response['headers']['Content-Range']}    ${range}
    Log    Header Content-Range is present
    
Check HTTP Response Header Content-Length Is Present and Matches the requested range length
    Log    Check Content-Length HTTP Header
    Should Contain    ${response['headers']}    Content-Length
    Should Be Equal As Integers    ${response['headers']['Content-Length']}    ${length}
    Log    Header Content-Length is present

Get single file NSD Content in Plain Format
    Log    Trying to get a NSD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Get NSD Content in Zip Format
    Log    Trying to get a NSD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Get single file NSD Content in Plain or Zip Format
    Log    Trying to get a NSD 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}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content
    ${output}=    Output    response
    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
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Get multi file NSD Content in Plain Format
    Log    Trying to get a negative case performing a get on a NSD present in the NFVO Catalogue. Accept will be text/plain but NSD is composed my multiple files.
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Get NSD Content with invalid resource identifier
    Log    Trying to perform a negative get, using an erroneous package ID
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}/nsd_content
    ${output}=    Output    response
    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
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${notOnboardedNsdInfoId}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

GET NSD Content with Range Request
    Log    Trying to get a NSD Content using RANGE using an NFVO that can handle it
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET NSD Content with invalid Range Request
    Log    Trying to get a range of bytes of the limit of the NSD
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PUT Request to upload NSD Content as zip file file in asynchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get File  ${contentZipFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PUT Request to upload NSD Content as plain text file in asynchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get File  ${contentPlainFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PUT Request to upload NSD Content as zip file in synchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get File  ${contentZipFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response} 
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PUT Request to upload NSD Content as plain text file in synchronous mode
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get File  ${contentPlainFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content    ${body}
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PUT Request to upload NSD Content with conflict due to onboarding state
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get Binary File  ${contentZipFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${creatingNsdInfoId}/nsd_content    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send POST Request for NSD Content
    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
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PATCH Request for NSD Content
    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
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send DELETE Request for NSD Content
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Check Postcondition NSD Content Exists
    Get NSD Content in Zip Format

GET all PNF Descriptors Information
    Log    The GET method queries multiple PNF descriptors
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET PNF Descriptors Information with attribute-based filter
    Log    The GET method queries multiple PNF descriptors using Attribute-based filtering parameters
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?${POS_FIELDS}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Check HTTP Response Body PnfdInfos Matches the requested attribute-based filter
    Log    Checking that attribute-based filter is matched
    #todo

GET PNF Descriptors Information with invalid attribute-based filter
    Log    The GET method queries multiple PNF descriptors using Attribute-based filtering parameters. Negative case, with erroneous attribute name
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?${NEG_FIELDS}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET all PNF Descriptors Information with all_fields attribute selector
    Log    The GET method queries multiple PNF descriptors using Attribute-based filtering parameters "all_fields"
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?all_fields
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check HTTP Response Body PnfdInfos Matches the requested all_fields selector
    Log    Validating user defined data schema
    ${user}=    Get Value From Json    ${response['body']}    $..UserDefinedData
    Validate Json    UserDefinedData.schema.json    ${user[0]}
    Log    Validation for schema OK

GET all PNF Descriptors Information with exclude_default attribute selector
    Log    Trying to get all PNFDs present in the NFVO Catalogue, using exclude_default filter.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check HTTP Response Body PnfdInfos Matches the requested exclude_default selector
    Log    Checking that element is missing
    ${user}=    Get Value From Json    ${response['body']}    $..UserDefinedData
    Should Be Empty    ${user}
    Log    Reports element is empty as expected


GET all PNF Descriptors Information with fields attribute selector
    Log    Trying to get all PNFDs present in the NFVO Catalogue, using fields filter.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}   

Check HTTP Response Body PnfdInfos Matches the requested fields selector
    Log    Validating user defined data schema
    ${user}=    Get Value From Json    ${response['body']}    $..UserDefinedData
    Validate Json    UserDefinedData.schema.json    ${user[0]}
    Log    Validation for schema OK

GET all PNF Descriptors Information with exclude_fields attribute selector
    Log    Trying to get all PNF 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}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?exclude_fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}   

Check HTTP Response Body PnfdInfos Matches the requested exclude_fields selector
    Log    Checking that element is missing
    ${user}=    Get Value From Json    ${response['body']}    $..UserDefinedData
    Should Be Empty    ${user}
    Log    Reports element is empty as expected   

Send Post Request to create new PNF Descriptor Resource
    Log    Creating a new network service descriptor
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    jsons/createPnfdInfoRequest.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Check Postcondition PnfdInfo Exists
    Log    Checking that nsd info exists
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${response['body']['id']}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    NsdInfo

Send PUT Request for all PNF Descriptors
    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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send PATCH Request for all PNF Descriptors
    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}/pnf_descriptors
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send DELETE Request for all PNF Descriptors
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    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}/pnf_descriptors
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition PNF Descriptors Exist
    Log    Checking that PNFD still exists
    GET all PNF Descriptors Information

Get all NS Descriptor Subscriptions
    [Documentation]    This method shall support the URI query parameters, request and response data structures, and response codes, as
    ...    specified in the Tables 5.4.8.3.2-1 and 5.4.8.3.2-2.
@@ -334,6 +771,11 @@ Check HTTP Response Header Contains
    Should Contain    ${response.headers}    ${CONTENT_TYPE}
    Log    Header is present

Check HTTP Response Header Contains Etag
    Should Contain    ${response.headers}    Etag
    Log    Header is present
    Set Suite Variable    &{original_etag}    ${response.headers['Etag']}


Create Sessions
    Pass Execution If    ${NFVO_CHECKS_NOTIF_ENDPOINT} == 0    MockServer not started as NFVO is not checking the notification endpoint
Loading
Loading