diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-08-04 11:25:15 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-08-04 15:06:18 +0800 |
commit | 86195b92c29c2925529771d7a8014392e815f38c (patch) | |
tree | b91d1adb50831959d02a15d1501decd40a9f17cf /testcases/vnf | |
parent | 8f3ad08c40bd8977651794f6720eda5df61b0c26 (diff) |
unify test result check for feature project and apply to parser
add check_test_result() method to unify test result process
JIRA: FUNCTEST-405
Change-Id: Iee4d2876cbbf372f8c3e3bf94448036669bc7f7e
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testcases/vnf')
-rw-r--r-- | testcases/vnf/RNC/parser.py | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/testcases/vnf/RNC/parser.py b/testcases/vnf/RNC/parser.py index 485af0e1..91d5bb06 100644 --- a/testcases/vnf/RNC/parser.py +++ b/testcases/vnf/RNC/parser.py @@ -32,33 +32,18 @@ logger = ft_logger.Logger("parser").getLogger() def main(): - EXIT_CODE = -1 project = 'parser' case_name = 'parser-basics' cmd = 'cd %s/tests && ./functest_run.sh' % PARSER_REPO - start_time = time.time() + start_time = time.time() ret = functest_utils.execute_command(cmd, logger, exit_on_error=False) - stop_time = time.time() - duration = round(stop_time - start_time, 1) - if ret == 0: - EXIT_CODE = 0 - logger.info("parser OK") - test_status = 'OK' - else: - logger.info("parser FAILED") - test_status = 'NOK' - - details = { - 'timestart': start_time, - 'duration': duration, - 'status': test_status, - } - status = "FAIL" - if details['status'] == "OK": - status = "PASS" + status, details = functest_utils.check_test_result(case_name, + ret, + start_time, + stop_time) functest_utils.logger_test_results(logger, project, @@ -73,7 +58,7 @@ def main(): stop_time, status, details) - exit(EXIT_CODE) + exit(ret) if __name__ == '__main__': main() |