aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/config_functest.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2015-12-22 17:09:06 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-12-22 17:09:06 +0000
commit768b803ca6cbf20d448e360fad3b50bed6bcf76d (patch)
treefb4b4ce6a803d3a17cfec0c3be3a5c856fb6ec5d /testcases/config_functest.py
parentf1a15b02f20c91a617e7475d8ca506db6db10005 (diff)
parent9627bf480703002f91464fc959903e294473aa8e (diff)
Merge "Use repos_dir env variable in all Functest scripts"
Diffstat (limited to 'testcases/config_functest.py')
-rwxr-xr-xtestcases/config_functest.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/testcases/config_functest.py b/testcases/config_functest.py
index 1d834bb37..d0788d30f 100755
--- a/testcases/config_functest.py
+++ b/testcases/config_functest.py
@@ -17,7 +17,6 @@ from neutronclient.v2_0 import client as neutronclient
actions = ['start', 'check', 'clean']
parser = argparse.ArgumentParser()
-parser.add_argument("repo_path", help="Path to the repository")
parser.add_argument("action", help="Possible actions are: '{d[0]}|{d[1]}|{d[2]}' ".format(d=actions))
parser.add_argument("-d", "--debug", help="Debug mode", action="store_true")
parser.add_argument("-f", "--force", help="Force", action="store_true")
@@ -38,18 +37,19 @@ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(messag
ch.setFormatter(formatter)
logger.addHandler(ch)
-if not os.path.exists(args.repo_path):
- logger.error("Repo directory not found '%s'" % args.repo_path)
+REPO_PATH=os.environ['repos_dir']+'/functest/'
+if not os.path.exists(REPO_PATH):
+ logger.error("Functest repository directory not found '%s'" % REPO_PATH)
exit(-1)
+sys.path.append(REPO_PATH + "testcases/")
-with open(args.repo_path+"testcases/config_functest.yaml") as f:
+with open(REPO_PATH+"testcases/config_functest.yaml") as f:
functest_yaml = yaml.safe_load(f)
f.close()
""" global variables """
# Directories
-REPO_PATH = args.repo_path
RALLY_DIR = REPO_PATH + functest_yaml.get("general").get("directories").get("dir_rally")
RALLY_REPO_DIR = functest_yaml.get("general").get("directories").get("dir_repo_rally")
RALLY_INSTALLATION_DIR = functest_yaml.get("general").get("directories").get("dir_rally_inst")
@@ -194,9 +194,8 @@ def action_clean():
shutil.rmtree(RALLY_RESULT_DIR,ignore_errors=True)
logger.debug("Cleaning up the OpenStack deployment...")
- cmd='python ' + args.repo_path + \
- '/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py -d ' \
- +args.repo_path
+ cmd='python ' + REPO_PATH + \
+ '/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py -d '
functest_utils.execute_command(cmd,logger)
logger.info("Functest environment clean!")