RFC: Log pexpect input in to a input logs instead of mixing it with output logs
Right now any input is logged 3 times.
- LAVA as pseudo input lines.
- By pexpect as input but it is marked as output.
- Pseudo TTY that pexpect uses will echo back inputs.
This MR changes it to:
- Log as DEBUG because this is what LAVA will call pexpect with. So it will become
Sending line: "setenv initrd_high 0xffffffff"
- Log as input because this is exactly what pexpect received as input. I believe the
U-Boot>
will be put to a separate line. - Echo can be addressed at a later date.
DEBUG: Sending line: "setenv initrd_high 0xffffffff"
INPUT: setenv initrd_high 0xffffffff
OUTPUT: U-Boot> setenv initrd_high 0xffffffff
By default pexpect logs all input and output in to a single passed
logfile
. However, this results that both input and output are
mixed in to a single log which makes it difficult to distinguish
between them.
Instead use the logfile_read
and logfile_send
attributes to
separate the input and output logs. The pexpect inputs will now be
logged as inputs. The previous input logs that were made by ShellCommand
class will be logged as DEBUG and with repr() to log exactly how
it was called by other LAVA code.
Edited by Igor Ponomarev