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

[test-new][SOL005][VNF-PCKG-MGMT][v5.3.1][5.3.5.2.14-17...

[test-new][SOL005][VNF-PCKG-MGMT][v5.3.1][5.3.5.2.14-17 Test-IDs][NFVSOL(26)0000093] Implemented new test cases for 401/404 HTTP Response in IndividualVNFPackage.
parent 16c97d39
Loading
Loading
Loading
Loading
+53 −1
Original line number Diff line number Diff line
@@ -178,3 +178,55 @@ Disable Individual VNF Package with not permitted authorization scope
    ...    Post-Conditions: none
    Send PATCH to disable Individual VNF Package with not permitted authorization scope
    Check HTTP Response Status Code Is    401

GET Individual VNF Package with not permitted authorization scope
    [Documentation]    Test ID: 5.3.5.2.14
    ...    Test title: GET Individual VNF Package with not permitted authorization scope
    ...    Test objective: The objective is to test that the the retrieval of an individual VNF package information fails when using not permitted authorization scope
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO.
    ...    Reference: Clause 9.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Package with not permitted authorization scope
    Check HTTP Response Status Code Is    401

DELETE Individual VNF Package with not permitted authorization scope
    [Documentation]    Test ID: 5.3.5.2.15
    ...    Test title: DELETE Individual VNF Package with not permitted authorization scope
    ...    Test objective: The objective is to test that the the deletion of an individual VNF package information fails when using not permitted authorization scope
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO in DISABLED operational state.
    ...    Reference: Clause 9.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send DELETE Request for individual VNF Package with not permitted authorization scope
    Check HTTP Response Status Code Is    401

Disable Individual VNF Package with invalid resource identifier
    [Documentation]    Test ID: 5.3.5.2.16
    ...    Test title: Disable Individual VNF Package with invalid resource identifier
    ...    Test objective: The objective is to test that the disable of an individual VNF package fails when using an invalid resource identifier
    ...    Pre-conditions: One or more VNF Packages are onboarded in the NFVO in ENABLED operational state.
    ...    Reference: Clause 9.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none    
    Send PATCH to disable Individual VNF Package with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails

DELETE Individual VNF Package with invalid resource identifier
    [Documentation]    Test ID: 5.3.5.2.17
    ...    Test title: DELETE Individual VNF Package with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual VNF package fails when using an invalid resource identifier
    ...    Pre-conditions: One or more VNF Packages are onboarded in the NFVO in DISABLED operational state.
    ...    Reference: Clause 9.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none    
    Send DELETE Request for individual VNF Package with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails

+40 −0
Original line number Diff line number Diff line
@@ -407,6 +407,24 @@ GET Individual VNF Package with invalid resource identifier
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PATCH to disable Individual VNF Package with invalid resource identifier
    Log    Trying to perform a negative patch, using invalid indentifier
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${body}=    Get File    jsons/VnfPkgInfoModificationsDisabled.json
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    REST.PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${erroneousVnfPackageId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send DELETE Request for individual VNF Package with invalid resource identifier
    Log    Trying to perform a negative delete, using invalid indentifier
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    REST.DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${erroneousVnfPackageId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send POST Request for individual VNF Package
    Log    Trying to perform a POST (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -459,6 +477,28 @@ Send PATCH to disable Individual VNF Package with not permitted authorization sc
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual VNF Package with not permitted authorization scope
    Log    Trying to perform a GET. 
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${INFO_NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    REST.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send DELETE Request for individual VNF Package with not permitted authorization scope
    Log    Trying to perform a DELETE
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${INFO_NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    REST.DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition VNF Package is in operational state
    [Arguments]    ${status}
    Log    Checking postcondition op status