pytest-testinfra
pytest-testinfra copied to clipboard
docker-image backend
I wonder if that would be useful to add a "docker-image" backend.
This backend would test images instead of containers.
For example:
testinfra_hosts = ['docker-image://python:2.7']
def test_version(host):
asser host.check_output('python -V') == '2.7.16'
Under the hood, testinfra will execute all its command with docker run --rm -it <image> -- <cmd>
There will be not persistent state which might be non sense for some modules like "process" of "socket".
EDIT: The ":" separator for docker image tags will have to be urlencoded to be a valid testinfra host "url", unless we can make an exception here ?
+1 any news ? :-)
+1, any news?