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>