X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=testsuites%2Frubbos%2Frun_rubbos.py;h=afe653fe375c50681d8532a8336dc1839cecd69e;hb=7fa6864522dec3924cd5e8006964d18e934b35bf;hp=fc177ccbb6f6a843d9685831372201bd18fc3b9e;hpb=7b44e003d34c0214cc909953a978c359337a4744;p=bottlenecks.git diff --git a/testsuites/rubbos/run_rubbos.py b/testsuites/rubbos/run_rubbos.py index fc177ccb..afe653fe 100755 --- a/testsuites/rubbos/run_rubbos.py +++ b/testsuites/rubbos/run_rubbos.py @@ -73,7 +73,7 @@ def _download_url(src_url, dest_dir): with open(dest, 'wb') as f: shutil.copyfileobj(response, f) - return file_name + return dest def rubbos_stack_satisfy(name="bottlenecks_rubbos_stack", status="CREATE_COMPLETE"): @@ -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,11 +375,11 @@ def main(): print "Cannot create instances, as Failed to create image(s)." exit (-1) - print "Wait 150 seconds after stack creation........." - time.sleep(150) + print "Wait 300 seconds after stack creation..." + time.sleep(300) - reboot_instances() - time.sleep(180) + #reboot_instances() + #time.sleep(180) rubbos_run() time.sleep(30)