Allow to override the default shell commands used to start and stop
the machine with custom commands, as in
--be-opts="cmd.request-power-on='/usr/bin/power.sh something'"
Signed-off-by: Jan Lindemann <jan@janware.com>
Add support for options --tag and --time-stamp to MachineCmd, and
store them in Environment.tag and .time_stamp, respectively.
.time_stamp defaults to current time if --time-stamp is not present.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add flag ReadOnlyPrintable and support it in read(). This omits all
characters not in string.printable from read()'s result.
This comes in handy if systemd spits out bouncing start-job-running
asterisks which find their way back to the reader but close the shell
on him.
Signed-off-by: Jan Lindemann <jan@janware.com>
Since all command instances carry config information from
~/.jw-devtestrc, make it available via a dedicated conf_value()
method to all interested test cases.
Signed-off-by: Jan Lindemann <jan@janware.com>
expect now takes a cmd argument, which defaults to None, and which
runs the command over the given connection before it takes to waiting
for a matching regex to be sent.
Signed-off-by: Jan Lindemann <jan@janware.com>
Make the private CmdTestOs.__run_test_cases() method available to
external code interested in running a selection of test cases.
This is useful, e.g. for re-running a failed firmware installation
encapsulated in a test case from inside another test case.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add method addResults(), which allows to merge results of another
TestResults instance into the called instance.
Signed-off-by: Jan Lindemann <jan@janware.com>
test.cmds_exec() takes a list of lists with commands to be sent to a
console, returns None on success and an error message on failure.
The list can consist of up to three entries, 2 + 3 are optional:
[ cmd, expect-regex, timeout]
Signed-off-by: Jan Lindemann <jan@janware.com>
cmd_exec() sometimes returned the command in the output albeit
echo_cmd=False was specified, notably if the command contained a
newline.
Signed-off-by: Jan Lindemann <jan@janware.com>
It's wrong to use line buffering in fdopen(..., ".b"), there's no
such thing as a line in binary data, also see
https://bugs.python.org/issue32236
Signed-off-by: Jan Lindemann <jan@janware.com>