Skip to content

RFC: Log pexpect input in to a input logs instead of mixing it with output logs

Igor Ponomarev requested to merge pexpect-input-logger into master

Right now any input is logged 3 times.

image

  1. LAVA as pseudo input lines.
  2. By pexpect as input but it is marked as output.
  3. Pseudo TTY that pexpect uses will echo back inputs.

This MR changes it to:

  1. Log as DEBUG because this is what LAVA will call pexpect with. So it will become Sending line: "setenv initrd_high 0xffffffff"
  2. Log as input because this is exactly what pexpect received as input. I believe the U-Boot> will be put to a separate line.
  3. 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

Merge request reports