aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests
diff options
context:
space:
mode:
authorMickael JEZEQUEL <mickael.jezequel@orange.com>2018-03-14 17:27:16 +0100
committerMickael JEZEQUEL <mickael.jezequel@orange.com>2018-03-14 17:31:51 +0100
commit7b945575701438fc7d9dfda24e0f80404d176450 (patch)
tree2ae291deb4f0016ffe3daf0189b8bd903106fb04 /test/csit/tests
parentd573946672ae77de0731bda6c05cbb8bdd1ecbbc (diff)
Add csit for vnfsdk/ice
Change-Id: I3206b43d0356b31a92a81fe98378459dfbbe23d9 Issue-ID: VNFSDK-214 Signed-off-by: Mickael JEZEQUEL <mickael.jezequel@orange.com>
Diffstat (limited to 'test/csit/tests')
-rw-r--r--test/csit/tests/vnfsdk-ice/ice-server/validation_test.robot69
1 files changed, 69 insertions, 0 deletions
diff --git a/test/csit/tests/vnfsdk-ice/ice-server/validation_test.robot b/test/csit/tests/vnfsdk-ice/ice-server/validation_test.robot
new file mode 100644
index 000000000..1a134b017
--- /dev/null
+++ b/test/csit/tests/vnfsdk-ice/ice-server/validation_test.robot
@@ -0,0 +1,69 @@
+*** settings ***
+Library OperatingSystem
+Library Process
+Library String
+Library Collections
+Library RequestsLibrary
+Library json
+
+
+*** Variables ***
+${valid_heat_zip} ${SCRIPTS}/../tests/vnfsdk-ice/ice-server/heat_template_ok.zip
+${empty_heat_zip} ${SCRIPTS}/../tests/vnfsdk-ice/ice-server/heat_template_empty.zip
+${ice_uri} /onapapi/ice/v1/
+
+*** Test Cases ***
+
+ICE health Check
+ [Documentation] Validate that ICE is up
+ Create Session ice_session http://${ICE_IP}:5000
+ &{headers}= Create Dictionary Content-Type=application/json
+
+ ${resp}= Get Request ice_session ${ice_uri} headers=${headers}
+
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Check status code for valid HEAT based VNF package
+ [Documentation] Post a valid VNF package and expect 200 Response
+ ${fileData}= Get Binary File ${valid_heat_zip}
+ ${fileDir} ${fileName}= Split Path ${valid_heat_zip}
+ ${partData}= Create List ${fileName} ${fileData} application/octet-stream
+ &{fileParts}= Create Dictionary
+ Set To Dictionary ${fileParts} file=${partData}
+
+ ${resp}= Post Request ice_session ${ice_uri} files=${fileParts}
+
+ Log Receive HTTP Status code ${resp.status_code}
+ Should Be Equal As Strings ${resp.status_code} 200
+ ${json} = Set Variable ${resp.json()}
+ ${message} = Get From Dictionary ${json} message
+ Should Be Equal ${message} OK
+
+Check status code for empty VNF package
+ [Documentation] Post an empty VNF package and expect 422 Response
+ ${fileData}= Get Binary File ${empty_heat_zip}
+ ${fileDir} ${fileName}= Split Path ${empty_heat_zip}
+ ${partData}= Create List ${fileName} ${fileData} application/octet-stream
+ &{fileParts}= Create Dictionary
+ Set To Dictionary ${fileParts} file=${partData}
+
+ ${resp}= Post Request ice_session ${ice_uri} files=${fileParts}
+
+ Log Receive HTTP Status code ${resp.status_code}
+ Should Be Equal As Strings ${resp.status_code} 422
+ ${json} = Set Variable ${resp.json()}
+ ${message} = Get From Dictionary ${json} message
+ Should Be Equal ${message} Tests failed
+
+Check status code for invalid request
+ [Documentation] Post an invalid request and expect 400 Response
+ ${fileData}= Get Binary File ${empty_heat_zip}
+ ${fileDir} ${fileName}= Split Path ${empty_heat_zip}
+ ${partData}= Create List ${fileName} ${fileData} application/octet-stream
+ &{fileParts}= Create Dictionary
+ Set To Dictionary ${fileParts} foo=${partData}
+
+ ${resp}= Post Request ice_session ${ice_uri} files=${fileParts}
+
+ Log Receive HTTP Status code ${resp.status_code}
+ Should Be Equal As Strings ${resp.status_code} 400