summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-05-04 16:57:36 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-05-04 17:09:58 +0200
commitcd42c5ba41d08ed6d378aa78ccdabbb51569f739 (patch)
treeecf371f3b7bb51c1e596e3a1a1af6385a1a02cbb /ci
parent6790e17eb7c1a3eaaccfe97ac90932e3c15eea6d (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')
-rw-r--r--ci/run_tests.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/ci/run_tests.py b/ci/run_tests.py
index 5b9309828..9a4ce967c 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: