aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests
diff options
context:
space:
mode:
authorBin Sun <bins@vmware.com>2018-03-29 15:40:18 +0800
committerBin Sun <bins@vmware.com>2018-03-29 16:58:16 +0800
commit5e87b88e9d8b34caed0a82464dbbfa5d64930096 (patch)
tree179a6944ff9f422e1f4edd845f3bb1e447220ecf /test/csit/tests
parent3facc2cec88b2dc16b128a29f51c3b7fb6a05f1d (diff)
CSIT for new feature in multicloud
Change-Id: I3f3808b7be5395cc40465c3d3977fc59b547c766 Issue-ID: MULTICLOUD-155 Signed-off-by: Bin Sun <bins@vmware.com>
Diffstat (limited to 'test/csit/tests')
-rw-r--r--test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json7
-rw-r--r--test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot34
2 files changed, 40 insertions, 1 deletions
diff --git a/test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json b/test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json
new file mode 100644
index 000000000..1e3cac6f5
--- /dev/null
+++ b/test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json
@@ -0,0 +1,7 @@
+{
+ "name": "cirros-0.3.2-x86_64-disk",
+ "container_format": "bare",
+ "disk_format": "qcow2",
+ "visibility": "public",
+ "schema": "/v2/schemas/image"
+} \ No newline at end of file
diff --git a/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot b/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot
index 0a6f2f5e8..e8e36dc14 100644
--- a/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot
+++ b/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot
@@ -13,10 +13,13 @@ Library HttpLibrary.HTTP
${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens
${get_image_url} /api/multicloud-vio/v0/vmware_fake/glance/v2/images
${get_image_schema_url} /api/multicloud-vio/v0/vmware_fake/glance/v2/schemas/image
+${image_service} /api/multicloud-vio/v0/vmware_fake/glance/v2/image/file
+
#json files
${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json
+${image_file} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/image_file.json
#global vars
${TOKEN}
@@ -42,7 +45,7 @@ GetAuthToken
-TestCaseShoeImageSchema
+TestCaseShowImageSchema
[Documentation] Sanity test - Show Image Schema
${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN}
Create Session web_session http://${VIO_IP}:9004 headers=${headers}
@@ -76,3 +79,32 @@ TestCaseShowImage
List Should Contain Value ${return_ok_list} ${responese_code}
${response_json} json.loads ${resp.content}
Should Be Equal ${response_json['status']} active
+
+
+
+
+TestCaseUploadImage
+ [Documentation] Sanity test - Upload Image
+ ${json_value}= json_from_file ${image_file}
+ ${json_string}= string_from_json ${json_value}
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN}
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= POST Request web_session ${image_service} ${json_string}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
+ ${response_json} json.loads ${resp.content}
+ ${IMAGEID}= Convert To String ${response_json['id']}
+ Set Global Variable ${IMAGEID}
+
+
+
+
+TestCaseDownloadImage
+ [Documentation] Sanity test - Download Image
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN}
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= Get Request web_session ${image_service}/${IMAGEID}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
+ ${response_json} json.loads ${resp.content}
+ Should Be Equal ${response_json['status']} active \ No newline at end of file