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/run.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dovetail/run.py') 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