pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

passing extra args to ssh backend

Open vandlol opened this issue 4 years ago • 6 comments

Hey there, I would like to pass --ssh-extra-args="-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null" but, that's ignored. What is the intended way of passing extra args to the ssh backend via cli?

Cheers

vandlol avatar Jul 08 '21 09:07 vandlol

I think the problem is that ssh_extra_args is not forwarded here:

https://github.com/pytest-dev/pytest-testinfra/blob/94744858812d6337d03c4309707f1d4c7091d566/testinfra/plugin.py#L111-L120

cc @dalvizu @philpep

kconley-sq avatar May 19 '22 17:05 kconley-sq

This isn't working for me either. pytest-testinfra==6.8.0

You can see this wasn't added to line 111: https://github.com/pytest-dev/pytest-testinfra/commit/3744c3e1aab41b89c5f62c47ce986bf1ef72cac2

I'm going to try to get around this using --ssh-config instead.

Edit: Confirmed this workaround works.

I'm passing an ssh config via --ssh-config and I translated all my -o options to that file.

JohnAtOlo avatar Dec 01 '22 18:12 JohnAtOlo

Not working for me as well with pytest-testinfra==8.1.0;

mvgijssel avatar Jun 06 '23 08:06 mvgijssel

Experiencing the same issue on the latest version as well.

sanieldalib avatar Jun 08 '23 00:06 sanieldalib

I linked to the code bug when I reported it above. I haven't checked if it's fixed yet but could open an MR to fix it.

JohnAtOlo avatar Jun 08 '23 16:06 JohnAtOlo