summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Koistinen <miikka.koistinen@nokia.com>2018-05-29 14:28:33 +0300
committerGeorg Kunz <georg.kunz@ericsson.com>2018-06-06 10:06:17 +0000
commit57c30b969c57843f6200ef6614d776954c305150 (patch)
tree29fdcc5aff964e5949a97d0a5e1d432cb2978b08
parent92daf3c8721fa64a690fea358c9631b50ebc2205 (diff)
Fix error status when executing CLI run command
This commit fixes CLI run command to exit with non-zero exit status when bad arguments are given for '--testsuite' or '--testarea'. JIRA: DOVETAIL-660 Change-Id: I4539b19978d9e93d8a90be9000f36d0aa1895f71 Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com>
-rw-r--r--dovetail/cli/commands/cli_testcase.py2
-rwxr-xr-xdovetail/run.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/dovetail/cli/commands/cli_testcase.py b/dovetail/cli/commands/cli_testcase.py
index 7529765f..d4d80334 100644
--- a/dovetail/cli/commands/cli_testcase.py
+++ b/dovetail/cli/commands/cli_testcase.py
@@ -84,5 +84,5 @@ class CliTestcase(object):
cmd = ("python %s/run.py"
" %s" % (repo_dir, options))
- dt_utils.exec_cmd(cmd, exit_on_error=False,
+ dt_utils.exec_cmd(cmd, exit_on_error=True,
exec_msg_on=False, info=True)
diff --git a/dovetail/run.py b/dovetail/run.py
index 19d0acb6..348c3915 100755
--- a/dovetail/run.py
+++ b/dovetail/run.py
@@ -33,6 +33,9 @@ import utils.dovetail_logger as dt_logger
import utils.dovetail_utils as dt_utils
+EXIT_RUN_FAILED = 2
+
+
def load_testsuite(testsuite):
Testsuite.load()
return Testsuite.get(testsuite)
@@ -285,6 +288,9 @@ def main(*args, **kwargs):
dt_utils.get_hardware_info(logger)
testcase_list = get_testcase_list(logger, **kwargs)
+ if not testcase_list:
+ raise SystemExit(EXIT_RUN_FAILED)
+
duration = run_test(testcase_list, logger)
if (duration != "stop_on_fail"):
Report.generate(testcase_list, duration)