aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/vPing
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/vPing
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/vPing')
-rw-r--r--testcases/vPing/CI/libraries/vPing.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/testcases/vPing/CI/libraries/vPing.py b/testcases/vPing/CI/libraries/vPing.py
index 1ae6593df..cc52f5ab6 100644
--- a/testcases/vPing/CI/libraries/vPing.py
+++ b/testcases/vPing/CI/libraries/vPing.py
@@ -31,7 +31,6 @@ pp = pprint.PrettyPrinter(indent=4)
parser = argparse.ArgumentParser()
-parser.add_argument("repo_path", help="Path to the repository")
parser.add_argument("-d", "--debug", help="Debug mode", action="store_true")
parser.add_argument("-r", "--report",
help="Create json result file",
@@ -39,10 +38,6 @@ parser.add_argument("-r", "--report",
args = parser.parse_args()
-sys.path.append(args.repo_path + "testcases/")
-
-import functest_utils
-
""" logging configuration """
logger = logging.getLogger('vPing')
@@ -61,12 +56,18 @@ formatter = logging.Formatter('%(asctime)s - %(name)s'
ch.setFormatter(formatter)
logger.addHandler(ch)
-HOME = os.environ['HOME'] + "/"
+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/")
+import functest_utils
-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()
+HOME = os.environ['HOME'] + "/"
# vPing parameters
VM_BOOT_TIMEOUT = 180
VM_DELETE_TIMEOUT = 100
@@ -458,7 +459,7 @@ def main():
if args.report:
logger.debug("Push result into DB")
# TODO check path result for the file
- git_version = functest_utils.get_git_branch(args.repo_path)
+ git_version = functest_utils.get_git_branch(REPO_PATH)
pod_name = functest_utils.get_pod_name(logger)
functest_utils.push_results_to_db(TEST_DB,
"vPing",