From fd9979ed8948962b501c00e4078d21fae3f257d6 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Mon, 15 Jun 2015 11:12:55 +0200 Subject: modify functest config to prepare result folder JIRA: FUNCTEST-9 Change-Id: I7ff1452da27dc904f349bcbefbc43a480a3e8843 Signed-off-by: Morgan Richomme --- testcases/config_functest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testcases/config_functest.py b/testcases/config_functest.py index 48eb279be..a106f07bc 100644 --- a/testcases/config_functest.py +++ b/testcases/config_functest.py @@ -53,6 +53,7 @@ REPO_PATH = args.repo_path RALLY_DIR = REPO_PATH + functest_yaml.get("general").get("directories").get("dir_rally") RALLY_REPO_DIR = HOME + functest_yaml.get("general").get("directories").get("dir_rally_repo") RALLY_INSTALLATION_DIR = HOME + functest_yaml.get("general").get("directories").get("dir_rally_inst") +RALLY_RESULT_DIR = HOME + functest_yaml.get("general").get("directories").get("dir_rally_res") VPING_DIR = REPO_PATH + functest_yaml.get("general").get("directories").get("dir_vping") ODL_DIR = REPO_PATH + functest_yaml.get("general").get("directories").get("dir_odl") @@ -96,6 +97,9 @@ def action_start(): action_clean() exit(-1) + # Create result folder under functest if necessary + if not os.path.exists(RALLY_RESULT_DIR): + os.makedirs(RALLY_RESULT_DIR) logger.info("Downloading image...") if not functest_utils.download_url(IMAGE_URL, IMAGE_DIR): @@ -206,6 +210,11 @@ def action_clean(): 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) + + logger.info("Functest environment clean!") -- cgit 1.2.3-korg