diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-07-27 10:11:59 +0200 |
---|---|---|
committer | Jose Lausuch <jose.lausuch@ericsson.com> | 2016-07-27 09:27:14 +0000 |
commit | 1c3a04fd4779c828ac6f6b5806bdf68cb4fff04f (patch) | |
tree | 84b8cd1cb25cb08c2fbfd39491caecf7115f5ce0 | |
parent | ab079c029b9a970e1cbc12b903da3d9e62d82212 (diff) |
Return -1 if copper test fails
Change-Id: Ib66d1b69c73603bab33950ca2c0fca3f07eb3d22
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
-rwxr-xr-x | ci/run_tests.py | 1 | ||||
-rwxr-xr-x | testcases/features/copper.py | 13 |
2 files changed, 9 insertions, 5 deletions
diff --git a/ci/run_tests.py b/ci/run_tests.py index f172eecc..a024dd72 100755 --- a/ci/run_tests.py +++ b/ci/run_tests.py @@ -104,7 +104,6 @@ def run_test(test, tier_name): duration_str = ("%02d:%02d" % divmod(duration, 60)) logger.info("Test execution time: %s" % duration_str) - result = 0 if result != 0: logger.error("The test case '%s' failed. " % test_name) OVERALL_RESULT = -1 diff --git a/testcases/features/copper.py b/testcases/features/copper.py index 7ab4e78a..9efcbd7f 100755 --- a/testcases/features/copper.py +++ b/testcases/features/copper.py @@ -16,11 +16,12 @@ #
import os
+import sys
import time
-import yaml
-
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
+import yaml
+
with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
functest_yaml = yaml.safe_load(f)
@@ -38,11 +39,11 @@ def main(): start_time = time.time()
- ret = functest_utils.execute_command(cmd, logger, exit_on_error=False)
+ ret_val = functest_utils.execute_command(cmd, logger, exit_on_error=False)
stop_time = time.time()
duration = round(stop_time - start_time, 1)
- if ret == 0:
+ if ret_val == 0:
logger.info("COPPER PASSED")
test_status = 'PASS'
else:
@@ -76,6 +77,10 @@ def main(): stop_time,
details['status'],
details)
+ if ret_val != 0:
+ sys.exit(-1)
+
+ sys.exit(0)
if __name__ == '__main__':
main()
|