labgrid
labgrid copied to clipboard
Various client sub commands return 0 on command error
The return code of the executed commands scp
, rsync
, telnet
, gst-launch-1.0
is lost:
bst@erbse$ labgrid-client -c conf.yaml scp foo :bar
Selected role main from configuration file
INFO: Connected to 192.168.23.39
INFO: Running command: ['scp', '-o', 'ControlPath=/tmp/labgrid-ssh-tmp-ag484isf/control-192.168.23.39', 'foo', '_:bar']
foo: No such file or directory
bst@erbse$ echo $?
0
bst@erbse$ labgrid-client -c conf.yaml rsync foo :bar
Selected role main from configuration file
INFO: Connected to 192.168.23.39
INFO: Running command: ['rsync', '-v', '--rsh=ssh -o ControlPath=/tmp/labgrid-ssh-tmp-2vhi3t7a/control-192.168.23.39', '-rlpt', '--one-file-system', '--progress', 'foo', '_:bar']
sh: rsync: not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(235) [sender=3.1.3]
bst@erbse$ echo $?
0
bst@erbse$ labgrid-client -c conf.yaml telnet
Selected role main from configuration file
Trying 192.168.23.39...
telnet: Unable to connect to remote host: Connection refused
connection lost
bst@erbse$ echo $?
0
bst@erbse$ labgrid-client video
WARNING: erroneous pipeline: no element "vaapipostproc"
bst@erbse$ echo $?
0
bst@erbse$ labgrid-client audio
WARNING: erroneous pipeline: no element "alsasrc"
bst@erbse$ echo $?
0
Please try #662.
Every subcommand method that does not raise an exception on error is affected by this. Other than scp/rsync, at least console.
Tested pretty much all sub commands that call external tools except flashscript
and tmc
. Issue updated accordingly.
Added ssh remote execution case from #1063.
See discussion in #662 for a way forward to fix this.