log the raw output on stdout/stderr
Avocado process module has a routine to drain the std* buffer with a per-line basis loop. This loop makes the new-line character to be dropped. On the other hand, the Python logging system is hard-coded to add a new-line character at the end of the msg string. The problem takes place when `process` writes a line which originally had new-line character at the end but the logging system still adds the new-line character to that line. In this patch: - avocado.utils.process to include the new-line character in the lines that originally had one. - avocado.core.test to use for raw outputs a custom logging FileHandler that does not add a new-line character at the end of each line. Verified with (checking `.../test-results/1-.../[stdout|stderr|output]`): $ avocado run --external-runner '/bin/echo' 'foo' $ avocado run --external-runner '/bin/echo -n' 'foo' $ avocado run --external-runner '/bin/ls' '.' $ avocado run --external-runner '/bin/ls' 'nonexistingfile Reference: https://trello.com/c/dH7FLT75Signed-off-by: NAmador Pahim <apahim@redhat.com>
Showing
想要评论请 注册 或 登录