From 57c30b969c57843f6200ef6614d776954c305150 Mon Sep 17 00:00:00 2001 From: Miikka Koistinen Date: Tue, 29 May 2018 14:28:33 +0300 Subject: 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 --- dovetail/cli/commands/cli_testcase.py | 2 +- dovetail/run.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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) -- cgit 1.2.3-korg