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

Custom shell

Open dAnjou opened this issue 5 years ago • 3 comments

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.

dAnjou avatar Dec 02 '19 13:12 dAnjou

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);

philpep avatar Dec 02 '19 15:12 philpep

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?

dAnjou avatar Dec 02 '19 17:12 dAnjou

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?

rhockenbury avatar Feb 10 '20 22:02 rhockenbury