summaryrefslogtreecommitdiffstats
path: root/testsuites/rubbos/run_rubbos.py
diff options
context:
space:
mode:
authorMatthewLi <matthew.lijun@huawei.com>2016-06-01 05:52:51 -0400
committerMatthewLi <matthew.lijun@huawei.com>2016-06-01 05:53:48 -0400
commitf670ac5d8572ed93811ad01a9d27142cba77de5d (patch)
treed07bc29cd2d32ee9de45725d19b33fd9de349efa /testsuites/rubbos/run_rubbos.py
parent3e8bf0c0b273324d52970c7127d2be5e294e3aff (diff)
file download separated from image creation progress
JIRA: BOTTLENECK-86 Change-Id: I1603d8121d58ea36d6bd2aa241590fddd70c2e6f Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
Diffstat (limited to 'testsuites/rubbos/run_rubbos.py')
-rwxr-xr-xtestsuites/rubbos/run_rubbos.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/testsuites/rubbos/run_rubbos.py b/testsuites/rubbos/run_rubbos.py
index 42f8d509..18aeab6f 100755
--- a/testsuites/rubbos/run_rubbos.py
+++ b/testsuites/rubbos/run_rubbos.py
@@ -129,16 +129,14 @@ def rubbos_env_cleanup():
else:
return True
-def rubbos_create_images(src_url=None, image_name="bottlenecks_rubbos_image"):
+def rubbos_create_images(imagefile=None, image_name="bottlenecks_rubbos_image"):
print "========== Create rubbos image in OS =========="
- dest_dir = '/tmp'
- file_name = _download_url(src_url, dest_dir)
- #file_name = "bottlenecks-trusty-server.img"
- if file_name == None:
+
+ if imagefile == None:
+ print "imagefile not set/found"
return False
glance = _get_glance_client()
- imagefile = dest_dir + "/" + file_name
image = glance.images.create(name=image_name, disk_format="qcow2", container_format="bare")
with open(imagefile) as fimage:
glance.images.upload(image.id, fimage)
@@ -360,7 +358,13 @@ def main():
rubbos_env_prepare(Heat_template)
rubbos_env_cleanup()
- image_created = rubbos_create_images(image_url)
+ dest_dir = "/tmp"
+ image_file = _download_url(image_url, dest_dir)
+ if image_file == None:
+ print "error with downloading image(s)"
+ exit(-1)
+
+ image_created = rubbos_create_images(imagefile=image_file)
keyPath = Bottlenecks_repo_dir + "/utils/infra_setup/bottlenecks_key/bottlenecks_key.pub"
rubbos_create_keypairs(key_path=keyPath)
rubbos_create_flavors()
@@ -371,7 +375,7 @@ def main():
print "Cannot create instances, as Failed to create image(s)."
exit (-1)
- print "Wait 300 seconds after stack creation........."
+ print "Wait 300 seconds after stack creation..."
time.sleep(300)
#reboot_instances()