summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/framework.py9
-rw-r--r--test/log.py2
-rw-r--r--test/run_tests.py2
3 files changed, 6 insertions, 7 deletions
diff --git a/test/framework.py b/test/framework.py
index 27fcdb5a7f6..3201e632348 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -25,7 +25,7 @@ from vpp_lo_interface import VppLoInterface
from vpp_papi_provider import VppPapiProvider
from vpp_papi.vpp_stats import VPPStats
from log import RED, GREEN, YELLOW, double_line_delim, single_line_delim, \
- getLogger, colorize
+ get_logger, colorize
from vpp_object import VppObjectRegistry
from util import ppp, is_core_present
from scapy.layers.inet import IPerror, TCPerror, UDPerror, ICMPerror
@@ -369,10 +369,9 @@ class VppTestCase(unittest.TestCase):
gc.collect() # run garbage collection first
random.seed()
cls.print_header(cls)
- if not hasattr(cls, 'logger'):
- cls.logger = getLogger(cls.__name__)
- else:
- cls.logger.name = cls.__name__
+ cls.logger = get_logger(cls.__name__)
+ if hasattr(cls, 'parallel_handler'):
+ cls.logger.addHandler(cls.parallel_handler)
cls.tempdir = tempfile.mkdtemp(
prefix='vpp-unittest-%s-' % cls.__name__)
cls.stats_sock = "%s/stats.sock" % cls.tempdir
diff --git a/test/log.py b/test/log.py
index 9720cbcc41d..de127fefb27 100644
--- a/test/log.py
+++ b/test/log.py
@@ -50,7 +50,7 @@ scapy_logger = logging.getLogger("scapy.runtime")
scapy_logger.setLevel(logging.ERROR)
-def getLogger(name):
+def get_logger(name):
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
return logger
diff --git a/test/run_tests.py b/test/run_tests.py
index c42c6a820dc..b2de2e702fb 100644
--- a/test/run_tests.py
+++ b/test/run_tests.py
@@ -120,7 +120,7 @@ def test_runner_wrapper(suite, keep_alive_pipe, stdouterr_queue,
finished_pipe, result_pipe, logger):
sys.stdout = stdouterr_queue
sys.stderr = stdouterr_queue
- VppTestCase.logger = logger
+ VppTestCase.parallel_handler = logger.handlers[0]
result = VppTestRunner(keep_alive_pipe=keep_alive_pipe,
descriptions=descriptions,
verbosity=verbose,