summaryrefslogtreecommitdiffstats
path: root/utils/functest_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/functest_utils.py')
-rw-r--r--utils/functest_utils.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index 717e4b2ce..41b6485d9 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -289,7 +289,7 @@ def get_ci_envvars():
return ci_env_var
-def execute_command(cmd, exit_on_error=True, info=False, error_msg="",
+def execute_command(cmd, info=False, error_msg="",
verbose=True, output_file=None):
if not error_msg:
error_msg = ("The command '%s' failed." % cmd)
@@ -317,8 +317,6 @@ def execute_command(cmd, exit_on_error=True, info=False, error_msg="",
if returncode != 0:
if verbose:
logger.error(error_msg)
- if exit_on_error:
- sys.exit(1)
return returncode
@@ -343,19 +341,26 @@ def get_deployment_dir():
return deployment_dir
-def get_criteria_by_test(testname):
+def get_dict_by_test(testname):
with open(get_testcases_file()) as f:
testcases_yaml = yaml.safe_load(f)
for dic_tier in testcases_yaml.get("tiers"):
for dic_testcase in dic_tier['testcases']:
if dic_testcase['name'] == testname:
- return dic_testcase['criteria']
+ return dic_testcase
logger.error('Project %s is not defined in testcases.yaml' % testname)
return None
+def get_criteria_by_test(testname):
+ dict = get_dict_by_test(testname)
+ if dict:
+ return dict['criteria']
+ return None
+
+
# ----------------------------------------------------------
#
# YAML UTILS