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

[test-new][SOL005][VNF-PCKG-MGMT][v5.3.1][5.3.5.4.14-15...

[test-new][SOL005][VNF-PCKG-MGMT][v5.3.1][5.3.5.4.14-15 Test-IDs][NFVSOL(26)0000093] Implemented new test cases for 401/404 HTTP Response in VNFPackageContent.
parent b3de3558
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -172,3 +172,28 @@ Upload VNF Package Content with not permitted authorization scope
    ...    Post-Conditions: none
    Send PUT Request to upload VNF Package Content with not permitted authorization scope
    Check HTTP Response Status Code Is    401

GET Individual VNF Package Content with not permitted authorization scope
    [Documentation]    Test ID: 5.3.5.4.14
    ...    Test title: GET Individual VNF Package Content with not permitted authorization scope
    ...    Test objective: he objective is to test the retrieval of a VNF Package Content in Zip format fails when using not permitted authorization scope.
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO.
    ...    Reference: Clause 9.4.5.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 Content with not permitted authorization scope
    Check HTTP Response Status Code Is    401

Upload VNF Package Content with invalid resource identifier
    [Documentation]    Test ID: 5.3.5.4.15
    ...    Test title: Upload VNF Package Content with invalid resource identifier
    ...    Test objective: The objective is to test that the upload a VNF package content fails when using an invalid resource identifier
    ...    Pre-conditions: none
    ...    Reference: Clause 9.4.5.3.4 - ETSI GS NFV-SOL 005 [3] v5.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send PUT Request to upload VNF Package Content with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails
+25 −5
Original line number Diff line number Diff line
@@ -712,6 +712,14 @@ GET Individual VNF Package Content with invalid resource identifier
    REST.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${erroneousVnfPkgId}/package_content
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
Send PUT Request to upload VNF Package Content with invalid resource identifier
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_ZIP}", "Content-Type": "application/zip", "${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}      verify=False
    ${body}=  Get Binary File     ${contentZipVnfPackage}
    ${response}=    Put On Session     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${erroneousVnfPkgId}/package_content    data=${body}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable      ${response}     ${response}

GET Content for VNF Package in onboarding state different from ONBOARDED
    Log    Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
@@ -741,7 +749,7 @@ Send PUT Request to upload VNF Package Content
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_ZIP}", "Content-Type": "application/zip", "${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}      verify=False
    ${body}=  Get Binary File     ${contentZipVnfPackage}
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${newVnfPackageId}/package_content    data=${body}
    ${response}=    Put On Session     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${newVnfPackageId}/package_content    data=${body}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable      ${response}     ${response}
@@ -750,11 +758,23 @@ Send PUT Request to upload VNF Package Content with not permitted authorization
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_ZIP}", "Content-Type": "application/zip", "${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}      verify=False
    ${body}=  Get Binary File     ${contentZipVnfPackage}
    ${scopeValue}=    Create Dictionary    scope=${CONTENT_PERMITTED_SCOPE} 
    ${scopeValue}=    Create Dictionary    scope=${CONTENT_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}
    ${response}=    Put On Session     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${newVnfPackageId}/package_content    data=${body}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable      ${response}     ${response}

GET Individual VNF Package Content with not permitted authorization scope
    Log    Trying to perform a GET. This method upload the content of a NSD
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_ZIP}", "Content-Type": "application/zip", "${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}      verify=False
    ${scopeValue}=    Create Dictionary    scope=${CONTENT_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}
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${newVnfPackageId}/package_content    data=${body}
    ${response}=    Get On Session     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${newVnfPackageId}/package_content
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable      ${response}     ${response}
@@ -767,7 +787,7 @@ Send PUT Request to upload VNF Package Content with permitted authorization scop
    ${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}
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${newVnfPackageId}/package_content    data=${body}
    ${response}=    Put On Session     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${newVnfPackageId}/package_content    data=${body}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable      ${response}     ${response}
@@ -784,7 +804,7 @@ Send PUT Request to upload VNF Package Content with conflict due to onboarding s
    Log    Trying to perform a PUT. This method upload the content of a NSD
    Create Session      nbi     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}  headers={"Accept": "${ACCEPT_ZIP}", "Content-Type": "application/zip", "${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}      verify=False
    ${body}=  Get Binary File     ${contentZipVnfPackage}
    ${response}=    Put Request     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${creatingVnfPackageId}/package_content    data=${body}
    ${response}=    Put On Session     nbi     ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${creatingVnfPackageId}/package_content    data=${body}
    Should Be Empty     ${response.text}
    ${response}=    Create Dictionary   status=${response.status_code}
    Set Suite Variable      ${response}     ${response}