diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-09-05 17:24:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-05 17:24:28 +0000 |
commit | e51891b6827f33390d4e81ac34222d862ad24880 (patch) | |
tree | 3606170d892a1f25ba5a3f4c4d7742209d606c8f /test/csit/tests | |
parent | 3fe68e0ad138da337d1b4055c76b115b9b3300f0 (diff) | |
parent | a279ba36fb0a92d5986190d059db1fcf04afa8c2 (diff) |
Merge "Add csit test cases for VNF Repository"
Diffstat (limited to 'test/csit/tests')
-rw-r--r-- | test/csit/tests/vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/test/csit/tests/vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot b/test/csit/tests/vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot index 473415eab..b06d5b544 100644 --- a/test/csit/tests/vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot +++ b/test/csit/tests/vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot @@ -1,17 +1,40 @@ *** settings *** Library OperatingSystem Library Process +Library String +Library Collections +Library RequestsLibrary +Library json *** Variables *** -${csarpath} ${SCRIPTS}/../tests/vnfsdk-marketplace/provision/enterprise2DC.csar -${upload} ${SCRIPTS}/../tests/vnfsdk-marketplace/provision/uploadCSAR.sh - +${csarpath} ${SCRIPTS}/../tests/vnfsdk-marketplace/provision/enterprise2DC.csar +${csarId} 0 *** Test Cases *** - -E2E Test case for VNF SDK + +Upload VNF Package to VNF Repository [Documentation] Upload the VNF Package - ${status}= Run Process bash ${upload} ${REPO_IP} ${csarpath} > log.txt shell=yes - Log Status is ${status} + ${resp}= Run curl -s -X POST -H "Content-Type: multipart/form-data" -F "file=@${csarpath}" http://${REPO_IP}:8702/openoapi/vnfsdk-marketplace/v1/PackageResource/csars + Should Contain ${resp} csarId + ${csarjson}= Evaluate ${resp} + ${csarId}= Set Variable ${csarjson["csarId"]} + Set Global Variable ${csarId} + +Get VNF Package Information from Repository + Create Session refrepo http://${REPO_IP}:8702 + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Get Request refrepo /openoapi/vnfsdk-marketplace/v1/PackageResource/csars/${csarId} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Download VNF Package from Repository + Create Session refrepo http://${REPO_IP}:8702 + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Get Request refrepo /openoapi/vnfsdk-marketplace/v1/PackageResource/csars/${csarId}/files headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 +Delete VNF Package from Repository + Create Session refrepo http://${REPO_IP}:8702 + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Delete Request refrepo /openoapi/vnfsdk-marketplace/v1/PackageResource/csars/${csarId} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 |