diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-04 16:57:36 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-04 17:09:58 +0200 |
commit | cd42c5ba41d08ed6d378aa78ccdabbb51569f739 (patch) | |
tree | ecf371f3b7bb51c1e596e3a1a1af6385a1a02cbb /ci/run_tests.py | |
parent | 6790e17eb7c1a3eaaccfe97ac90932e3c15eea6d (diff) |
Refactor, add logger handler to collect all the logs to a file as well
JIRA: FUNCTEST-190
Also:
- remove old code that are not used any more
- improve execute_command function
- fix logger output for run_tempest
Change-Id: Ib268738ada1b9de2a418ef01e684a90e6f4e02ed
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'ci/run_tests.py')
-rw-r--r-- | ci/run_tests.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ci/run_tests.py b/ci/run_tests.py index 5b930982..9a4ce967 100644 --- a/ci/run_tests.py +++ b/ci/run_tests.py @@ -10,12 +10,12 @@ import argparse import os -import subprocess import sys import functest.ci.tier_builder as tb import functest.utils.clean_openstack as clean_os import functest.utils.functest_logger as ft_logger +import functest.utils.functest_utils as ft_utils import functest.utils.openstack_utils as os_utils @@ -77,13 +77,9 @@ def run_test(test): cmd = ("%s%s" % (EXEC_SCRIPT, flags)) logger.debug("Executing command '%s'" % cmd) - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) + result = ft_utils.execute_command(cmd, logger, exit_on_error=False) - while p.poll() is None: - line = p.stdout.readline().rstrip() - logger.debug(line) - - if p.returncode != 0: + if result != 0: logger.error("The test case '%s' failed. Cleaning and exiting." % test_name) if CLEAN_FLAG: |