pytest-testinfra
pytest-testinfra copied to clipboard
passing extra args to ssh backend
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
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
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.
Not working for me as well with pytest-testinfra==8.1.0;
Experiencing the same issue on the latest version as well.
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.