added SOL005 nsd management docs for PNFs

Merge request reports

Loading
+2 −1
Changes for SOL005/NSDManagement-API/environment/pnfDescriptors.txt: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -10,5 +10,6 @@ ${ACCEPT_PLAIN} text/plain
${CONTENT_TYPE_PLAIN}    text/plain
${erroneous_pnfdId}    erroneousPnfdId
${onboardingStatePnfdId}    8ed2bf1f-f6ae-4d18-b478-bfab02fd4cd2
${contentFile}    files/pnfdContent.zip
${contentFilePnfd}    files/pnfdContent.zip
${creatingPnfdId}    2e4ce0ef-3ea8-49f9-92dd-8771866015bb
${userDefinedDataSet}    some
 No newline at end of file
+84 −74
Changes for SOL005/NSDManagement-API/IndividualPnfDescriptor.robot: 84 added lines, 74 removed lines.
Original line number Diff line number Diff line
@@ -3,89 +3,99 @@ Documentation This clause defines all the resources and methods provided by
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/pnfDescriptors.txt    # Specific nsDescriptors Parameters
Resource          NSDManagementKeywords.robot
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library           OperatingSystem

*** Test Cases ***
GET Single PNF Descriptor
    [Documentation]   The GET method reads information about an individual PNF descriptor.
    ...    This method shall follow the provisions specified in the Tables 5.4.6.3.2-1 and 5.4.6.3.2-2 for URI query parameters,
    ...    request and response data structures, and response codes.
    Log    The GET method reads information about an individual PNF descriptor
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}
    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    PnfdInfo.schema.json    ${result}
   Log    Validation OK
GET Individual PNF Descriptor Information
    [Documentation]    Test ID: 5.3.1.5.1
    ...    Test title: GET Individual PNF Descriptor Information
    ...    Test objective: The objective is to test the retrieval of an individual PNF Descriptor information and perform a JSON schema validation of the collected data structure
    ...    Pre-conditions: One or more PNF Descriptors are set in the NFVO.
    ...    Reference: section 5.4.6.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual PNF Descriptor Information
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PnfdInfo
    Check HTTP Response Header Contains ETag
    Check HTTP Response Body PnfdInfo Identifier matches the requested PNF Descriptor Information

GET Individual PNF Descriptor Information with invalid resource identifier
    [Documentation]    Test ID: 5.3.1.5.2
    ...    Test title: GET Individual PNF Descriptor Information with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual PNF Descriptor Information fails when using an invalid resource identifier
    ...    Pre-conditions: One or more PNF Descriptors are set in the NFVO.
    ...    Reference: section 5.4.6.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual PNF Descriptor Information with invalid resource identifier
    Check HTTP Response Status Code Is    404

GET Single PNF Descriptor (Negative: Not found)
    Log    Trying to perform a GET on an erroneous pnfDescriptorInfoId
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdInfoId}
    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
Update Individual PNF Descriptor
    [Documentation]    Test ID: 5.3.1.5.3
    ...    Test title: Update Individual PNF Descriptor
    ...    Test objective: The objective is to test the update of an individual PNF Descriptor and perform a JSON schema and content validation of the collected data structure
    ...    Pre-conditions: One or more Update Individual PNF Descriptors are onboarded in the NFVO.
    ...    Reference: section 5.4.6.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The PNF Descriptor is modified according to the update request
    Send PATCH to update Individual PNF Descriptor
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PnfdInfoModification
    Check Postcondition PNF Descriptor is modified according to the requested update  


PATCH Single PNF Descriptor - (Disabling a nsdInfo)
    [Documentation]   The PATCH method modifies the user defined data of an individual PNF descriptor resource.
    ...    This method shall follow the provisions specified in the Tables 5.4.6.3.4-1 and 5.4.6.3.4-2 for URI query parameters,
    ...    request and response data structures, and response codes.
    Log    The PATCH method modifies the user defined data of an individual PNF descriptor resource.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    jsons/PnfdInfoModification.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}    ${body}
    Integer    response status    200
    Log    Received 200 OK as expected
   ${result}=    Output    response body
   Validate Json    PnfdInfoModification.schema.json    ${result}
   Log    Validation of PnfdInfoModification OK
Update Individual PNF Descriptor with HTTP Etag precondition failure
    [Documentation]    Test ID: 5.3.1.5.4
    ...    Test title:  Update Individual PNF Descriptor with HTTP Etag precondition failure
    ...    Test objective: The objective is to test that the update of a PNF Descriptor fails due to a precondition failure when using an uncorrect Http Etag identified.
    ...    Pre-conditions: One or more Update Individual PNF Descriptors are onboarded in the NFVO.
    ...    Reference: section 5.4.6.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PATCH to update Individual PNF Descriptor with HTTP Etag precondition failure
    Check HTTP Response Status Code Is    412

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

DELETE Single PNF Descriptor
    Log    Trying to perform a DELETE pnfdInfo.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}
    Integer    response status    204
    Log    Received 204 No Content as expected


POST Single PNF 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}/pnf_descriptors/${pnfdInfoId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected



PUT Single PNF 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}/pnf_descriptors/${pnfdInfoId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected

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

DELETE Individual PNF Descriptor
    [Documentation]    Test ID: 5.3.1.5.7
    ...    Test title:  DELETE Individual PNF Descriptor
    ...    Test objective: The objective is to test the deletion of an individual PNF Descriptor.
    ...    Pre-conditions: One or more Individual PNF Descriptors are onboarded in the NFVO.
    ...    Reference: section 5.4.6.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The PNF Descriptor is not available anymore in the NFVO 
    Send DELETE Request for Individual PNF Descriptor
    Check HTTP Response Status Code Is    204
    Check Postcondition PNF Descriptor is Deleted
 No newline at end of file
+167 −12
Changes for SOL005/NSDManagement-API/NSDManagementKeywords.robot: 167 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -615,7 +615,159 @@ Check Postcondition PNF Descriptors Exist
    Log    Checking that PNFD still exists
    GET all PNF Descriptors Information

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

Check HTTP Response Body PnfdInfo Identifier matches the requested PNF Descriptor Information
    Log    Going to validate info retrieved
    Should Be Equal    ${response['body']['id']}    ${pnfdInfoId} 
    Log    PNFD identifier as expected

GET Individual PNF 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}/pnf_descriptors/${erroneous_pnfdInfoId}
    Integer    response status    404
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PATCH to update Individual PNF Descriptor
    Log    Trying to perform a PATCH.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"If-Match": "${original_etag[0]}"}
    ${body}=    Get File    jsons/PnfdInfoModification.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${body["userDefinedData"]}    ${userDefinedDataSet}

Check Postcondition PNF Descriptor is modified according to the requested update
    Log    Checking postcondition op status
    Should Be Equal   ${response['body']['userDefinedData']}    ${userDefinedDataSet} 

Send PATCH to update Individual PNF Descriptor with HTTP Etag precondition failure
    Log    Trying to perform a PATCH. As prerequisite the pnfdInfo 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/PnfdInfoModification.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send DELETE Request for Individual PNF Descriptor
    Log    Trying to perform a DELETE pnfdInfo.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

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

Send POST Request for Individual PNF 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}/pnf_descriptors/${pnfdInfoId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PUT Request for Individual PNF 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}/pnf_descriptors/${pnfdInfoId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get PNFD Content
    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}/pnf_descriptors/${pnfdInfoId}/pnfd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get PNFD Content with invalid resource identifier
    Log    Trying to perform a negative get, using an erroneous package ID
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdInfoId}/pnfd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Get PNFD Content with conflict due to onboarding state
    Log    Trying to get a PNFD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${onboardingStatePnfdId}/pnfd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

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

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

Send POST Request for PNFD 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}/pnf_descriptors/${pnfdInfoId}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PATCH Request for PNFD 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}/pnf_descriptors/${pnfdInfoId}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send DELETE Request for PNFD 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}/pnf_descriptors/${pnfdInfoId}/nsd_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Check Postcondition PNFD Content Exists
    Get PNFD Content
    
Get all NSD Management 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.
    Log    Trying to get the list of subscriptions
@@ -625,7 +777,7 @@ Get all NS Descriptor Subscriptions
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get NS Descriptor Subscriptions with attribute-based filters
Get NSD Management Subscriptions with attribute-based filters
    Log    Trying to get the list of subscriptions using filters
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -634,7 +786,7 @@ Get NS Descriptor Subscriptions with attribute-based filters
    Set Suite Variable    ${response}    ${output}


Get NS Descriptor Subscriptions with invalid attribute-based filters
Get NSD Management Subscriptions with invalid attribute-based filters
    Log    Trying to get the list of subscriptions using filters with wrong attribute name
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -643,7 +795,7 @@ Get NS Descriptor Subscriptions with invalid attribute-based filters
    Set Suite Variable    ${response}    ${output}


Get NS Descriptor Subscriptions with invalid resource endpoint
Get NSD Management Subscriptions with invalid resource endpoint
    Log    Trying to perform a request on a Uri which doesn't exist
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
@@ -652,7 +804,7 @@ Get NS Descriptor Subscriptions with invalid resource endpoint
    Set Suite Variable    ${response}    ${output}    


Send Post Request for NS Descriptor Subscription
Send Post Request for NSD Management Subscription
    [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.1-1 and 5.4.8.3.1-2.
    Log    Trying to create a new subscription
@@ -667,7 +819,7 @@ Send Post Request for NS Descriptor Subscription
    ...    Check Notification Endpoint  


Send Post Request for Duplicated NS Descriptor Subscription
Send Post Request for Duplicated NSD Management Subscription
    Log    Trying to create a subscription with an already created content
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
@@ -681,7 +833,7 @@ Send Post Request for Duplicated NS Descriptor Subscription



Send Put Request for NS Descriptor Subscriptions
Send Put Request for NSD Management Subscriptions
    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}"}
@@ -691,7 +843,7 @@ Send Put Request for NS Descriptor Subscriptions
    Set Suite Variable    ${response}    ${output}
    

Send Patch Request for NS Descriptor Subscriptions
Send Patch Request for NSD Management Subscriptions
    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}"}
@@ -700,7 +852,7 @@ Send Patch Request for NS Descriptor Subscriptions
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete Request for NS Descriptor Subscriptions
Send Delete Request for NSD Management Subscriptions
    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}"}
@@ -709,6 +861,9 @@ Send Delete Request for NS Descriptor Subscriptions
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition NSD Management Subscriptions Exists
    Log    Checking that subscriptions exists
    Get all NSD Management Subscriptions    

Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
@@ -735,14 +890,14 @@ Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filte
    #TODO


Check HTTP Response Body Matches the Subscription
Check HTTP Response Body NsdmSubscription Attributes Values Match the Issued Subscription
    Log    Check Response matches subscription
    ${body}=    Get File    jsons/subscriptions.json
    ${subscription}=    evaluate    json.loads('''${body}''')    json
    Should Be Equal    ${response['body']['callbackUri']}    ${subscription['callbackUri']}


Check Postcondition NS Descriptor Subscription Is Set
Check Postcondition NSD Management Subscription Is Set
    Log    Check Postcondition subscription exist
    Log    Trying to get the subscription
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -753,7 +908,7 @@ Check Postcondition NS Descriptor Subscription Is Set
    Check HTTP Response Status Code Is    200
    
    
Check Postcondition Subscription Resource URI Returned in Location Header Is Valid
Check Postcondition Subscription Resource Returned in Location Header Is Available
    Log    Going to check postcondition
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${response.headers['Location']}
+103 −104
Changes for SOL005/NSDManagement-API/PNFDContent.robot: 103 added lines, 104 removed lines.
Original line number Diff line number Diff line
*** Settings ***
Documentation     This clause defines the content of the individual NS descriptor, i.e. NSD content
Documentation     This clause defines the content of the individual NS descriptor, i.e. PNFD content
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/pnfDescriptors.txt    # Specific nsDescriptors Parameters
Resource          environment/pnfDescriptors.txt    # Specific PNFDescriptors Parameters
Resource          NSDManagementKeywords.robot
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library           OperatingSystem

*** Test Cases ***
GET PNFD Content
    [Documentation]   The GET method fetches the content of the PNFD..
    ...    This method shall follow the provisions specified in the Tables 5.4.7.3.2-1 and 5.4.7.3.2-2 for URI query parameters,
    ...    request and response data structures, and response codes.
    Log    The GET method queries PNFD Content
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_PLAIN}


GET PNFD Content- Negative (Not Found)
    Log    Trying to perform a negative get, using an erroneous package ID
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdId}/pnfd_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 PNFD Content - Negative (onboardingState issue)
    Log    Trying to get a PNFD content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${onboardingStatePnfdId}/pnfd_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 PNFD Content 
    Log    Trying to perform a PUT. This method upload the content of a PNFD
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get Binary File  ${contentFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content    ${body}
    Integer    response status    204
    Log    Received 204 No Content as expected
    ${response}=    Output    response body
    Should Be Empty    ${response}
    ${contentType}=    Output    response headers Content-Type
    Should Be Equal    text/plain    ${contentType}    
    
    
    
PUT a PNFD Content - Negative. Nsd in CREATING state
    Log    Trying to perform a PUT.
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=  Get Binary File  ${contentFile}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${creatingPnfdId}/pnfd_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 PNFD 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}/pnf_descriptors/${pnfdInfoId}/pnfd_content
    Integer    response status    405
    Log    Received 405 Method not implemented as expected



PATCH a NSDContent (Method not implemented)
    Pass Execution If    ${testOptionalMethods} == 0    optional methods are not implemented on the FUT. Skipping test.
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content
    Integer    response status    405
    Log    Received 405 Method not implemented as expected

DELETE a NSDContent (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
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content
    Integer    response status    405
    Log    Received 405 Method not implemented as expected
Get PNFD Content
    [Documentation]    Test ID: 5.3.1.6.1
    ...    Test title: Get PNFD Content
    ...    Test objective: The objective is to test the retrieval of the PNFD Content in plain format and perform a validation that returned content is in plain format
    ...    Pre-conditions: One or more PNFDs are onboarded in the NFVO.
    ...    Reference: section 5.4.7.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get PNFD Content 
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    text/plain

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

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

Upload PNFD Content as plain text file
    [Documentation]    Test ID: 5.3.1.6.4
    ...    Test title: Upload PNFD Content as plain text file
    ...    Test objective: The objective is to test the upload of a PNFD Content in plain text format.
    ...    Pre-conditions: One or more PNFDs are onboarded in the NFVO.
    ...    Reference: section 5.4.7.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The uploaded PNFD content is available in the NFVO
    Send PUT Request to upload PNFD Content as plain text file
    Check HTTP Response Status Code Is    204
    Check Postcondition PNFD Content Exists
 
Upload PNFD Content with conflict due to onboarding state
   [Documentation]    Test ID: 5.3.1.6.5
    ...    Test title: Upload PNFD Content with conflict due to onboarding state
    ...    Test objective: The objective is to test that the upload of the PNFD Content fails due to a conflict when the PNFD 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 PNFD for which the PNFD Content is requested is different from CREATED.
    ...    Reference: section 5.4.7.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
    Send PUT Request to upload PNFD Content with conflict due to onboarding state
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails             

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

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

DELETE PNFD Content - Method not implemented
    [Documentation]    Test ID: 5.3.1.6.8
    ...    Test title: DELETE PNFD Content - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete PNF Descriptor content
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.7.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The PNFD content is not deleted by the failed operation
    Send DELETE Request for PNFD Content
    Check HTTP Response Status Code Is    405
    Check Postcondition PNFD Content Exists
+115 −33
Changes for SOL005/NSDManagement-API/Subscriptions.robot: 115 added lines, 33 removed lines.
Original line number Diff line number Diff line
@@ -11,64 +11,146 @@ Suite Setup Create Sessions
Suite Teardown    Terminate All Processes    kill=true

*** Test Cases ***
Get All NS Descriptor Subscriptions
    Get all NS Descriptor Subscriptions
Get All NSD Management Subscriptions
    [Documentation]    Test ID: 5.3.1.7.1
    ...    Test title: Get All NSD Management Subscriptions
    ...    Test objective: The objective is to test the retrieval of all NSD Management subscriptions and perform a JSON schema validation of the returned subscriptions data structure
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none    
    Get all NSD Management Subscriptions
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    NsdmSubscriptions
    

Get NS Descriptor Subscriptions with attribute-based filter
    Get NS Descriptor Subscriptions with attribute-based filters
Get NSD Management Subscriptions with attribute-based filter
    [Documentation]    Test ID: 5.3.1.7.2
    ...    Test title: Get NSD Management Subscriptions with attribute-based filter
    ...    Test objective: The objective is to test the retrieval of NSD Management subscriptions using attribute-based filter, perform a JSON schema validation of the collected data structure, and verify that the retrieved information matches the issued attribute-based filters 
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD Management Subscriptions with attribute-based filters
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    NsdmSubscription
    Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filter
    

Get NS Descriptor Subscriptions with invalid attribute-based filter
    Get NS Descriptor Subscriptions with invalid attribute-based filters
Get NSD Management Subscriptions with invalid attribute-based filter
    [Documentation]    Test ID: 5.3.1.7.3
    ...    Test title: Get NSD Management Subscriptions with attribute-based filters
    ...    Test objective: The objective is to test that the retrieval of NSD Management subscriptions fails when using invalid attribute-based filters, and perform the JSON schema validation of the failed operation HTTP response. 
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD Management Subscriptions with invalid attribute-based filters
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   ProblemDetails 


GET NS Descriptor Subscription with invalid resource endpoint
    Get NS Descriptor Subscriptions with invalid resource endpoint
GET NSD Management Subscription with invalid resource endpoint
    [Documentation]    Test ID: 5.3.1.7.4
    ...    Test title: GET NSD Management Subscription with invalid resource endpoint
    ...    Test objective: The objective is to test that the retrieval of all NSD Management subscriptions fails when using invalid resource endpoint.
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.2 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none   
    Get NSD Management Subscriptions with invalid resource endpoint
    Check HTTP Response Status Code Is    404
    
    
Create new NS Descriptor subscription
    Send Post Request for NS Descriptor Subscription
Create new NSD Management subscription
    [Documentation]    Test ID: 5.3.1.7.5
    ...    Test title: Create new NSD Management subscription
    ...    Test objective: The objective is to test the creation of a new NSD Management subscription and perform a JSON schema and content validation of the returned subscription data structure
    ...    Pre-conditions: none
    ...    Reference: section 5.4.8.3.1 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NSD Management subscription is successfully set and it matches the issued subscription
    Send Post Request for NSD Management Subscription
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    NsdmSubscription
    Check HTTP Response Body Matches the Subscription
    Check Postcondition NS Descriptor Subscription Is Set 
    

Create duplicated NS Descriptor subscription with duplication handler
    Send Post Request for Duplicated NS Descriptor Subscription
    Check HTTP Response Body NsdmSubscription Attributes Values Match the Issued Subscription
    Check Postcondition NSD Management Subscription Is Set 
    

Create duplicated NSD Management subscription with duplication handler
    [Tags]    no-duplicated-subs
    [Documentation]    Test ID: 5.3.1.7.6
    ...    Test title: Create duplicated NSD Management subscription with NFVO not creating duplicated subscriptions
    ...    Test objective: The objective is to test the attempt of a creation of a duplicated NSD Management subscription and check that no new subscription is created by the NFVO and a link to the original subscription is returned
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference: section 5.4.8.3.1 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO does not support the creation of duplicated subscriptions
    ...    Post-Conditions: The existing NSD Management subscription returned is available in the NFVO
    Send Post Request for Duplicated NSD Management Subscription
    Check HTTP Response Status Code Is    303
    Check HTTP Response Body Is Empty
    Check HTTP Response Header Contains    Location
    Check Postcondition Subscription Resource URI Returned in Location Header Is Valid


Create duplicated NS Descriptor subscription without duplication handler
    Send Post Request for Duplicated NS Descriptor Subscription
    Check Postcondition Subscription Resource Returned in Location Header Is Available


Create duplicated NSD Management subscription without duplication handler
    [Tags]    duplicated-subs
    [Documentation]    Test ID: 5.3.1.7.7
    ...    Test title: Create duplicated NSD Management subscription with NFVO creating duplicated subscriptions
    ...    Test objective: The objective is to test the creation of a duplicated NSD Management subscription and perform a JSON schema and content validation of the returned duplicated subscription data structure
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.1 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports the creation of duplicated subscriptions
    ...    Post-Conditions: The duplicated NSD Management subscription is successfully set and it matches the issued subscription    
    Send Post Request for Duplicated NSD Management Subscription
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    PmSubscription
    Check HTTP Response Body Matches the Subscription
    Check Postcondition NS Descriptor Subscription Is Set 


PUT NS Descriptor Subscriptions - Method not implemented
    Send Put Request for NS Descriptor Subscriptions
    Check HTTP Response Body NsdmSubscription Attributes Values Match the Issued Subscription
    Check Postcondition NSD Management Subscription Is Set 


PUT NSD Management Subscriptions - Method not implemented
    [Documentation]    Test ID: 5.3.1.7.8
    ...    Test title: PUT NSD Management Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify NSD Management subscriptions
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.3 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Put Request for NSD Management Subscriptions
    Check HTTP Response Status Code Is    405
    
    
PATCH NS Descriptor Subscriptions - Method not implemented
    Send Patch Request for NS Descriptor Subscriptions
PATCH NSD Management Subscriptions - Method not implemented
    [Documentation]    Test ID: 5.3.1.7.9
    ...    Test title: PATCH NSD Management Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update NSD Management subscriptions
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.4 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Patch Request for NSD Management Subscriptions
    Check HTTP Response Status Code Is    405
    
        
DELETE NS Descriptor Subscriptions - Method not implemented
    Send Delete Request for NS Descriptor Subscriptions
DELETE NSD Management Subscriptions - Method not implemented
    [Documentation]    Test ID: 5.3.1.7.10
    ...    Test title: DELETE NSD Management Subscriptions - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete NSD Management subscriptions
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference:  section 5.4.8.3.5 - SOL005 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NSD Management subscriptions are not deleted by the failed operation 
    Send Delete Request for NSD Management Subscriptions
    Check HTTP Response Status Code Is    405
    Check Postcondition NSD Management Subscriptions Exists
    
Loading