Commit 63247381 authored by Najam UI Hassan's avatar Najam UI Hassan
Browse files

New Resource NSD added

parent 43547b7b
Loading
Loading
Loading
Loading
+141 −1
Original line number Original line Diff line number Diff line
@@ -8,3 +8,143 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_veri
Library           OperatingSystem
Library           OperatingSystem


*** Test Cases ***
*** Test Cases ***
*** Test Cases ***
Get single file NSD Content in Plain Format
    [Documentation]    Test ID: 5.3.1.10.1
    ...    Test title: Get single file NSD in Plain Format
    ...    Test objective: The objective is to test the retrieval of the NSD in plain format within a NSD archive and perform a validation that returned content is in plain format
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.4a.3.2 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD is implemented as a single file
    ...    Post-Conditions: none
    Get single file NSD in Plain Format
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    text/plain

Get NSD in Zip Format
    [Documentation]    Test ID: 5.3.1.10.2
    ...    Test title: Get NSD in Zip Format
    ...    Test objective: The objective is to test the retrieval of the NSD in zip format within a NSD archive and perform a validation that returned content is in zip format
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.4a.3.2 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD in Zip Format
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    application/zip

Get single file NSD in Plain or Zip Format 
    [Documentation]    Test ID: 5.3.1.10.3
    ...    Test title: Get single file NSDin Plain or Zip Format
    ...    Test objective: The objective is to test the retrieval of the single file NSD within a NSD archive when requesting Plain or Zip format to NFVO by including both formats in the request, and perform a validation that response is in Plain or Zip format
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.4a.3.2 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD is implemented as a single file
    ...    Post-Conditions: none
    Get single file NSD 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 in Plain or Zip Format
    [Documentation]    Test ID: 5.3.1.10.4
    ...    Test title: Get multi file NSD in Plain or Zip Format
    ...    Test objective: The objective is to test the retrieval of the multi file NSD within a NSD archive 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: Clause 5.4.4a.3.2 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD is implemented as a multi file
    ...    Post-Conditions: none
    Get multi file NSD 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 in Plain Format
    [Documentation]    Test ID: 5.3.1.10.5
    ...    Test title: Get multi file NSD in Plain Format
    ...    Test objective: The objective is to test that the retrieval of the multi file NSD within a NSD archive 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: Clause 5.4.4a.3.2 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NSD is implemented as a multi file
    ...    Post-Conditions: none
    Get multi file NSD 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.10.6
    ...    Test title: Get NSD Content with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of the NSD within a NSD archive fails when using an invalid resource identifier
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.4a.3.2 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

Get NSD with conflict due to onboarding state
    [Documentation]    Test ID: 5.3.1.10.7
    ...    Test title: Get NSD with conflict due to onboarding state
    ...    Test objective: The objective is to test that the retrieval of the NSD within a NSD archive 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 is different from ONBOARDED.
    ...    Reference: Clause 5.4.4a.3.2 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
    Get NSD with conflict due to onboarding state
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails              

POST NSD - Method not implemented
    [Documentation]    Test ID: 5.3.1.10.8
    ...    Test title: POST NSD - 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: Clause 5.4.4a.3.1 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send POST Request for NSD
    Check HTTP Response Status Code Is    405
    
PUT NSD - Method not implemented
    [Documentation]    Test ID: 5.3.1.10.9
    ...    Test title: PUT NSD - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update Network Service Descriptor
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.4a.3.3 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PUT Request for NSD
    Check HTTP Response Status Code Is    405

PATCH NSD Content - Method not implemented
    [Documentation]    Test ID: 5.3.1.10.10
    ...    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
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.4a.3.4 - ETSI GS NFV-SOL 005 [3] v2.6.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.10.11
    ...    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: Clause 5.4.4a.3.5 - ETSI GS NFV-SOL 005 [3] v2.6.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
 No newline at end of file
+93 −2
Original line number Original line Diff line number Diff line
@@ -850,7 +850,6 @@ Check HTTP Response Status Code Is
    Should Be Equal As Strings     ${response['status']}    ${expected_status}
    Should Be Equal As Strings     ${response['status']}    ${expected_status}
    Log    Status code validated 
    Log    Status code validated 
        
        
    
Check HTTP Response Body Json Schema Is
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    [Arguments]    ${input}
    Should Contain    ${response['headers']['Content-Type']}    application/json
    Should Contain    ${response['headers']['Content-Type']}    application/json
@@ -1020,3 +1019,95 @@ Check PostCondition GET Individual Network Service Descriptor Information
    
    
Wait for individual grant successful notification
Wait for individual grant successful notification
    Wait Until Keyword Succeeds    ${retry}   ${interval}    Get PNFD Content
    Wait Until Keyword Succeeds    ${retry}   ${interval}    Get PNFD Content

Get single file NSD 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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get NSD 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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get single file NSD 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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get multi file NSD in Plain or Zip Format
    Log    Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get multi file NSD 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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get NSD with invalid resource identifier
    Log    Trying to perform a negative get, using an erroneous package ID
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}/nsd
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get NSD with conflict due to onboarding state
    Log    Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${notOnboardedNsdInfoId}/nsd
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    
Send POST Request for NSD
    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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PUT Request for NSD
    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}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send PATCH Request for NSD
    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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 

Send DELETE Request for NSD
    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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}