labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

sshdriver not returning stdout output

Open TheMeaningfulEngineer opened this issue 5 years ago • 3 comments

The code which provoked was a command to read a file on a target. i.e. cat /etc/file.json.

I have traced down the issue in the driver and the cause is in this particular line.

The return from the executed command happens correctly but is than just discarded. Would be great to know the reasoning behind the stdout.pop()

TheMeaningfulEngineer avatar Jun 04 '20 08:06 TheMeaningfulEngineer

Probably to be compatible to the ShellDriver, which also doesn't have an empty final line. SSHDriver should only remove the last line if it is empty.

jluebbe avatar Jun 04 '20 08:06 jluebbe

@jluebbe Thanks, between the lines of your comment I have read this:

This is a bug. It should be addressed by ensuring the compatibility with the ShellDriver happens in a smarted way.

Correct?

TheMeaningfulEngineer avatar Jun 04 '20 08:06 TheMeaningfulEngineer

Yes. Although the run methods are already doing some processing of the output, so it's not really intended to cover all corner cases of "downloading" files. In the medium term, we should split off a way to run commands and get the raw, unprocessed output.

jluebbe avatar Jun 04 '20 08:06 jluebbe

Should be solved by #654.

Bastian-Krause avatar Jul 23 '23 10:07 Bastian-Krause