pytest-testinfra
pytest-testinfra copied to clipboard
Custom shell
Hi,
as proposed already in #516 I'd like to be able to provide a custom shell, like for example a login shell which loads a profile.
This would probably also solve #236.
Hi thanks for opening the issue, I was planning to open it :)
First I think maybe we could always run shell with "-l", if there's no drawback with this.
Then use a specific shell (bash, etc), maybe running the command without wrapping it with /bin/sh do the trick, or we can add a shell parameter like you do in #516, or autodetect it from /etc/passwd (maybe have a look at serverspec or goss code if they have specific code to handle this);
First I think maybe we could always run shell with "-l", if there's no drawback with this.
I think that would be a breaking change. The stuff that gets loaded can change the behavior of the shell quite a lot. We need it exactly for this reason (nvm to be specific).
When I came up with the shell parameter, it seemed like the most seamless and backwards compatible way. Can you elaborate what your concerns were?
For our use case, we would like to leverage testinfra for running tests in a windows server container. The hardcoded /bin/sh
is currently blocking us, as we need to invoke powershell inside the container. Any thoughts or updates on when this can be addressed?