diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2015-10-29 00:13:00 +0100 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2015-10-29 00:21:18 +0100 |
commit | a7d86e93dae2c6e2cac0f6e6dd90613b9dc0acc5 (patch) | |
tree | ac2ac4e26100988506325f9a141523e906a7ec68 /testcases/config_functest.py | |
parent | 1a145e36361420713f1497291e79ff3f65d80cc5 (diff) |
Move creation of glance image to vPing
Since we only need the glance image in Vping test case,
we create it in the vping script, and not in
config_functest.py
JIRA: FUNCTEST-74
Change-Id: I906ba94344d836bc7835a3dcf478933ff622bd54
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/config_functest.py')
-rwxr-xr-x | testcases/config_functest.py | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/testcases/config_functest.py b/testcases/config_functest.py index 8523a77f..e66240ee 100755 --- a/testcases/config_functest.py +++ b/testcases/config_functest.py @@ -64,10 +64,8 @@ DATA_DIR = functest_yaml.get("general").get("directories").get("dir_functest_dat DEPLOYMENT_MAME = "opnfv-rally" RALLY_COMMIT = functest_yaml.get("general").get("openstack").get("rally_stable_commit") -#GLANCE image parameters +#Image (cirros) IMAGE_FILE_NAME = functest_yaml.get("general").get("openstack").get("image_file_name") -IMAGE_DISK_FORMAT = functest_yaml.get("general").get("openstack").get("image_disk_format") -IMAGE_NAME = functest_yaml.get("general").get("openstack").get("image_name") IMAGE_PATH = DATA_DIR + "/" + IMAGE_FILE_NAME @@ -105,12 +103,6 @@ def action_start(): if not os.path.exists(RALLY_RESULT_DIR): os.makedirs(RALLY_RESULT_DIR) - logger.info("Creating Glance image: %s ..." %IMAGE_NAME) - if not create_glance_image(IMAGE_PATH,IMAGE_NAME,IMAGE_DISK_FORMAT): - logger.error("There has been a problem while creating the Glance image.") - action_clean() - exit(-1) - exit(0) @@ -155,18 +147,6 @@ def action_check(): else: logger.debug(" Image file found in %s" % IMAGE_PATH) - cmd="glance image-list | grep " + IMAGE_NAME - FNULL = open(os.devnull, 'w'); - logger.debug(' Executing command : {}'.format(cmd)) - p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=FNULL); - #if the command does not exist or there is no glance image - line = p.stdout.readline() - if line == "": - logger.debug(" Glance image NOT found.") - errors = True - errors_all = True - else: - logger.debug(" Glance image found.") if not errors: logger.debug("...OK") @@ -187,14 +167,6 @@ def action_clean(): logger.debug("Removing Rally installation directory %s" % RALLY_INSTALLATION_DIR) shutil.rmtree(RALLY_INSTALLATION_DIR,ignore_errors=True) - cmd = "glance image-list | grep "+IMAGE_NAME+" | cut -c3-38" - p = os.popen(cmd,"r") - - #while image_id = p.readline() - for image_id in p.readlines(): - cmd = "glance image-delete " + image_id - functest_utils.execute_command(cmd,logger) - if os.path.exists(RALLY_RESULT_DIR): logger.debug("Removing Result directory") shutil.rmtree(RALLY_RESULT_DIR,ignore_errors=True) @@ -290,19 +262,6 @@ def check_rally(): return False - -def create_glance_image(path,name,disk_format): - """ - Create a glance image given the absolute path of the image, its name and the disk format - """ - cmd = ("glance image-create --name "+name+" --visibility public " - "--disk-format "+disk_format+" --container-format bare --file "+path) - functest_utils.execute_command(cmd,logger) - return True - - - - def main(): if not (args.action in actions): logger.error('argument not valid') |