#9 Complete fix for OpenSSH transport and freeze fix for Paramiko
Closed by slaykovsky. Opened by slaykovsky.
slaykovsky/python-pytest-multihost freeze_fix  into  master

Download 9.patch

This patch fixes OpenSSH transport. Also, it happened it should
fix tests execution freezes when stdin doesn't get closed
while using Paramiko transport.

This will break if stdin contains a single-quote character.

Would you mind also writing a test for the behavior this is fixing?

rebased onto f215a3e30984778d70fb786187333f052b31b9a8

rebased onto 91a1881d36014e858a261f5bba40d7385ffe9e44

Yes, sure.

Oh, now I see what you are trying to do!
If you specify the process to run with a Popen-style list, metacharacters like > are not processed. That's a feature: the arguments are passed directly to the process; characters like > or $ don't need to be escaped according to obscure Bash rules.

If you really need shell syntax, then instead of run_command(["echo", "bla", ">", "/tmp/testfile.in"]), you can use run_command("echo bla > /tmp/testfile.in"). Or, run Bash explicitly with ["bash", "-c", "echo bla > /tmp/testfile.in"].

Okay, thanks! :)

I updated the patch.

rebased onto 7ebad663481cafceaefe405578fac4816aef54b5

Why are you setting the password to None?

Why are you relaxing the stdout checks?

This isn't related. Could you do it as a separate commit, so it's easy to port to the other pytest plugins?

This needs to use tmpdir, rather than hardcoding the temporary file's path. See tmpdir above, for example.

This does not escape $ correctly.

Why is this needed? It looks unrelated.

I'm sorry for the delay I took in reviewing this. I should have more time the coming weeks.

I can address the comments myself, and let you to review the changes. Let me know if that would help you!

@pviktori thank you for your review! It will be lovely if you can do it. I will help me so much :)

This turned out to be quite a rabbit hole, but I believe the result is quite an improvement.

See here: https://pagure.io/python-pytest-multihost/pull-request/11

Pull-Request has been closed by slaykovsky

Metadata