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
#\r
\r
import os\r
+import sys\r
import time\r
-import yaml\r
-\r
import functest.utils.functest_logger as ft_logger\r
import functest.utils.functest_utils as functest_utils\r
+import yaml\r
+\r
\r
with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:\r
functest_yaml = yaml.safe_load(f)\r
\r
start_time = time.time()\r
\r
- ret = functest_utils.execute_command(cmd, logger, exit_on_error=False)\r
+ ret_val = functest_utils.execute_command(cmd, logger, exit_on_error=False)\r
\r
stop_time = time.time()\r
duration = round(stop_time - start_time, 1)\r
- if ret == 0:\r
+ if ret_val == 0:\r
logger.info("COPPER PASSED")\r
test_status = 'PASS'\r
else:\r
stop_time,\r
details['status'],\r
details)\r
+ if ret_val != 0:\r
+ sys.exit(-1)\r
+\r
+ sys.exit(0)\r
\r
if __name__ == '__main__':\r
main()\r