summaryrefslogtreecommitdiffstats
path: root/testcases/config_functest.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2015-12-22 16:14:00 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2015-12-22 16:23:33 +0100
commit9627bf480703002f91464fc959903e294473aa8e (patch)
tree0fcb6b4437a9ed7b36523119885d279999610364 /testcases/config_functest.py
parent13c0c2d15d2af4dd1a8b4f82e481a8d1574c274d (diff)
Use repos_dir env variable in all Functest scripts
JIRA: FUNCTEST-90 This way, we remove the 'functest repo' input parameter on the python scripts call and we make it simpler using the available repos_dir env variable which points to /home/opnfv/repos Change-Id: I7d74bf1bc8d89f8f14397fcb9dafc22ee1482f84 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
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!")