未验证 提交 f0fa2969 编写于 作者: A Amador Pahim

Merge branch 'clebergnu-output_record_combined'

Signed-off-by: NAmador Pahim <apahim@redhat.com>
......@@ -213,6 +213,7 @@ class Test(unittest.TestCase):
self._stdout_file = os.path.join(self.logdir, 'stdout')
self._stderr_file = os.path.join(self.logdir, 'stderr')
self._output_file = os.path.join(self.logdir, 'output')
self._logging_handlers = {}
self.__outputdir = utils_path.init_dir(self.logdir, 'data')
......@@ -526,6 +527,14 @@ class Test(unittest.TestCase):
formatter,
self._ssh_logfile)
# combined output logging
self._register_log_file_handler(log_test_stdout,
stream_formatter,
self._output_file)
self._register_log_file_handler(log_test_stderr,
stream_formatter,
self._output_file)
if isinstance(sys.stdout, output.LoggingFile):
sys.stdout.add_logger(log_test_stdout)
if isinstance(sys.stderr, output.LoggingFile):
......
......@@ -150,6 +150,9 @@ class OutputTest(unittest.TestCase):
open(os.path.join(testdir, "stdout")).read())
self.assertEqual("test_stderr\n",
open(os.path.join(testdir, "stderr")).read())
self.assertEqual("test_print\ntest_stdout\ntest_stderr\n"
"test_process\n",
open(os.path.join(testdir, "output")).read())
def tearDown(self):
shutil.rmtree(self.tmpdir)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册