Commit 5ab1a5c7 authored by Elian Kraja's avatar Elian Kraja
Browse files

Fix issue #158

parent 5e5b54bf
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -262,7 +262,7 @@ GET Individual VNF Package Content with Range Request
    Log    Trying to get a VNF Package Content using RANGE using an NFVO that can handle it
    Log    Trying to get a VNF Package 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.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -271,7 +271,7 @@ GET Individual VNF Package Content with Range Request
GET Individual VNF Package Content with explicit Range Request
GET Individual VNF Package Content with explicit Range Request
    Log    Trying to get a VNF Package Content using RANGE using an NFVO that can handle it
    Log    Trying to get a VNF Package Content using RANGE using an NFVO that can handle it
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -280,7 +280,7 @@ GET Individual VNF Package Content with explicit Range Request
Check HTTP Response Header Content-Range Is Present and Matches the requested range
Check HTTP Response Header Content-Range Is Present and Matches the requested range
    Log    Check Content-Range HTTP Header
    Log    Check Content-Range HTTP Header
    Should Contain    ${response['headers']}    Content-Range
    Should Contain    ${response['headers']}    Content-Range
    Should Be Equal As Strings    ${response['headers']['Content-Range']}    ${range}/${full_length}
    Should Be Equal As Strings    ${response['headers']['Content-Range']}    bytes ${range}/${full_length}
    Log    Header Content-Range is present
    Log    Header Content-Range is present
    
    
Check HTTP Response Header Content-Length Is Present and Matches the requested range length
Check HTTP Response Header Content-Length Is Present and Matches the requested range length
@@ -293,7 +293,7 @@ GET Individual VNF Package Content with invalid Range Request
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Set Headers    {"Range": "bytes=${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -574,7 +574,7 @@ GET Individual VNF Package Artifact in octet stream format
GET Individual VNF Package Artifact with Range Request
GET Individual VNF Package Artifact with Range Request
    Log    Trying to get an Artifact using RANGE Header and using an NFVO that can handle it
    Log    Trying to get an Artifact using RANGE Header and 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.
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    ${output}=    Output    response
    ${output}=    Output    response
@@ -584,7 +584,7 @@ GET Individual VNF Package Artifact with invalid Range Request
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Set Headers    {"Range": "bytes=${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    ${output}=    Output    response
    ${output}=    Output    response
@@ -1059,7 +1059,7 @@ GET Individual OnBoarded VNF Package Content with Range Request
    Log    Trying to get a VNF Package Content using RANGE using an NFVO that can handle it
    Log    Trying to get a VNF Package 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.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -1069,7 +1069,7 @@ GET Individual OnBoarded VNF Package Content with invalid Range Request
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Set Headers    {"Range": "bytes=${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -1108,7 +1108,7 @@ GET Individual OnBoarded VNF Package Artifact in octet stream format
GET Individual OnBoarded VNF Package Artifact with Range Request
GET Individual OnBoarded VNF Package Artifact with Range Request
    Log    Trying to get an Artifact using RANGE Header and using an NFVO that can handle it
    Log    Trying to get an Artifact using RANGE Header and 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.
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/artifacts/${artifactPath}
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/artifacts/${artifactPath}
    ${output}=    Output    response
    ${output}=    Output    response
@@ -1118,7 +1118,7 @@ GET Individual OnBoarded VNF Package Artifact with invalid Range Request
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Set Headers    {"Range": "bytes=${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/artifacts/${artifactPath}
    GET    ${apiRoot}/${apiName}/${apiVersion}/onboarded_vnf_packages/${vndId}/artifacts/${artifactPath}
    ${output}=    Output    response
    ${output}=    Output    response
+2 −2
Original line number Original line Diff line number Diff line
@@ -2,9 +2,9 @@
${artifactPath}    artifactPath
${artifactPath}    artifactPath
${CONTENT_TYPE_OCTET}    application/octet-stream
${CONTENT_TYPE_OCTET}    application/octet-stream
${NFVO_RANGE_OK}    1    # If 1 means that Range is supported by the NFVO
${NFVO_RANGE_OK}    1    # If 1 means that Range is supported by the NFVO
${range}          bytes 0-1023
${range}          0-1023
${full_length}        2000        # Full size of the artifact to be downloaded using partial download
${full_length}        2000        # Full size of the artifact to be downloaded using partial download
${erroneousRange}    bytes 10000000-1000000000    # Requesting a out of range number of bytes
${erroneousRange}    10000000-1000000000    # Requesting a out of range number of bytes
${erroneousVnfPkgId}    erroneousPkgId
${erroneousVnfPkgId}    erroneousPkgId
${vnfPackageOctetStreamId}    octetStreamPkgId
${vnfPackageOctetStreamId}    octetStreamPkgId
${vnfdOctetStreamId}    octetStreamVnfdId
${vnfdOctetStreamId}    octetStreamVnfdId
+6 −6
Original line number Original line Diff line number Diff line
@@ -441,7 +441,7 @@ GET Individual VNF Package Content with Range Request
    Log    Trying to get a VNF Package Content using RANGE using an NFVO that can handle it
    Log    Trying to get a VNF Package 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.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -450,7 +450,7 @@ GET Individual VNF Package Content with Range Request
GET Individual VNF Package Content with explicit Range Request
GET Individual VNF Package Content with explicit Range Request
    Log    Trying to get a VNF Package Content using RANGE using an NFVO that can handle it
    Log    Trying to get a VNF Package Content using RANGE using an NFVO that can handle it
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -459,7 +459,7 @@ GET Individual VNF Package Content with explicit Range Request
Check HTTP Response Header Content-Range Is Present and Matches the requested range
Check HTTP Response Header Content-Range Is Present and Matches the requested range
    Log    Check Content-Range HTTP Header
    Log    Check Content-Range HTTP Header
    Should Contain    ${response['headers']}    Content-Range
    Should Contain    ${response['headers']}    Content-Range
    Should Be Equal As Strings    ${response['headers']['Content-Range']}    ${range}/${full_length}
    Should Be Equal As Strings    ${response['headers']['Content-Range']}    bytes ${range}/${full_length}
    Log    Header Content-Range is present
    Log    Header Content-Range is present
    
    
Check HTTP Response Header Content-Length Is Present and Matches the requested range length
Check HTTP Response Header Content-Length Is Present and Matches the requested range length
@@ -472,7 +472,7 @@ GET Individual VNF Package Content with invalid Range Request
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Set Headers    {"Range": "bytes=${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content
    ${output}=    Output    response
    ${output}=    Output    response
@@ -577,7 +577,7 @@ GET Individual VNF Package Artifact in octet stream format
GET Individual VNF Package Artifact with Range Request
GET Individual VNF Package Artifact with Range Request
    Log    Trying to get an Artifact using RANGE Header and using an NFVO that can handle it
    Log    Trying to get an Artifact using RANGE Header and 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.
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    Set Headers    {"Range": "${range}"}
    Set Headers    {"Range": "bytes=${range}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    ${output}=    Output    response
    ${output}=    Output    response
@@ -587,7 +587,7 @@ GET Individual VNF Package Artifact with invalid Range Request
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Log    Trying to get a range of bytes of the limit of the VNF Package
    Pass Execution If    ${NFVO_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    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    {"Accept": "${ACCEPT_ZIP}"}
    Set Headers    {"Range": "${erroneousRange}"}
    Set Headers    {"Range": "bytes=${erroneousRange}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    ${output}=    Output    response
    ${output}=    Output    response
+0 −3
Original line number Original line Diff line number Diff line
*** Variables ***
*** Variables ***
${ACCEPT_ZIP}     application/zip
${ACCEPT_ZIP}     application/zip
${CONTENT_TYPE_ZIP}    application/zip
${CONTENT_TYPE_ZIP}    application/zip
${NFVO_RANGE_OK}    1    # If 1 means that Range is supported by the NFVO
${erroneousVnfPkgId}    erroneousPkgId
${erroneousVnfPkgId}    erroneousPkgId
${vnfPkgId}       788106a2-d692-44f3-a86d-384f0ce35e42
${vnfPkgId}       788106a2-d692-44f3-a86d-384f0ce35e42
${erroneousRange}    bytes 100000-1000000    # Requesting a out of range number of bytes
${range}          bytes 0-1023
${creatingVnfPackageId}    d246ccdd-71aa-402f-b256-6a80ee54be3d
${creatingVnfPackageId}    d246ccdd-71aa-402f-b256-6a80ee54be3d
${newVnfPackageId}    d246ccdd-71aa-402f-b256-6a80ee54be3d
${newVnfPackageId}    d246ccdd-71aa-402f-b256-6a80ee54be3d