labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

Various client sub commands return 0 on command error

Open Bastian-Krause opened this issue 3 years ago • 3 comments

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

Bastian-Krause avatar Nov 04 '20 10:11 Bastian-Krause

Please try #662.

Emantor avatar Nov 04 '20 11:11 Emantor

Every subcommand method that does not raise an exception on error is affected by this. Other than scp/rsync, at least console.

Bastian-Krause avatar Nov 04 '20 13:11 Bastian-Krause

Tested pretty much all sub commands that call external tools except flashscript and tmc. Issue updated accordingly.

Bastian-Krause avatar Oct 18 '21 13:10 Bastian-Krause

Added ssh remote execution case from #1063.

Bastian-Krause avatar Jan 13 '23 09:01 Bastian-Krause

See discussion in #662 for a way forward to fix this.

Bastian-Krause avatar Jan 13 '23 09:01 Bastian-Krause