@@ -77,7 +77,7 @@ This is the default backend when no hosts are provided (either via
7777``--hosts `` or in modules). Commands are run locally in a subprocess under
7878the current user::
7979
80- $ py.test --sudo test_myinfra.py
80+ $ pytest --sudo test_myinfra.py
8181
8282
8383paramiko
@@ -91,7 +91,7 @@ able to connect without password (using passwordless keys or using
9191
9292You can provide an alternate ssh-config::
9393
94- $ py.test --ssh-config=/path/to/ssh_config --hosts=server
94+ $ pytest --ssh-config=/path/to/ssh_config --hosts=server
9595
9696
9797docker
@@ -100,7 +100,7 @@ docker
100100The Docker backend can be used to test *running * Docker containers. It uses the
101101`docker exec <https://docs.docker.com/reference/commandline/exec/ >`_ command::
102102
103- $ py.test --hosts='docker://[user@]container_id_or_name'
103+ $ pytest --hosts='docker://[user@]container_id_or_name'
104104
105105See also the :ref: `Test docker images ` example.
106106
@@ -111,19 +111,19 @@ podman
111111The Podman backend can be used to test *running * Podman containers. It uses the
112112`podman exec <https://github.com/containers/libpod/blob/master/docs/source/markdown/podman.1.md >`_ command::
113113
114- $ py.test --hosts='podman://[user@]container_id_or_name'
114+ $ pytest --hosts='podman://[user@]container_id_or_name'
115115
116116
117117ssh
118118~~~
119119
120120This is a pure SSH backend using the ``ssh `` command. Example::
121121
122- $ py.test --hosts='ssh://server'
123- $ py.test --ssh-config=/path/to/ssh_config --hosts='ssh://server'
124- $ py.test --ssh-identity-file=/path/to/key --hosts='ssh://server'
125- $ py.test --hosts='ssh://server?timeout=60&controlpersist=120'
126- $ py.test --hosts='ssh://server' --ssh-extra-args='-o StrictHostKeyChecking=no'
122+ $ pytest --hosts='ssh://server'
123+ $ pytest --ssh-config=/path/to/ssh_config --hosts='ssh://server'
124+ $ pytest --ssh-identity-file=/path/to/key --hosts='ssh://server'
125+ $ pytest --hosts='ssh://server?timeout=60&controlpersist=120'
126+ $ pytest --hosts='ssh://server' --ssh-extra-args='-o StrictHostKeyChecking=no'
127127
128128By default timeout is set to 10 seconds and ControlPersist is set to 60 seconds.
129129You can disable persistent connection by passing `controlpersist=0 ` to the options.
@@ -135,10 +135,10 @@ salt
135135The salt backend uses the `salt Python client API
136136<https://docs.saltstack.com/en/latest/ref/clients/> `_ and can be used from the salt-master server::
137137
138- $ py.test --hosts='salt://*'
139- $ py.test --hosts='salt://minion1,salt://minion2'
140- $ py.test --hosts='salt://web *'
141- $ py.test --hosts='salt://G@os:Debian'
138+ $ pytest --hosts='salt://*'
139+ $ pytest --hosts='salt://minion1,salt://minion2'
140+ $ pytest --hosts='salt://web *'
141+ $ pytest --hosts='salt://G@os:Debian'
142142
143143Testinfra will use the salt connection channel to run commands.
144144
@@ -156,9 +156,9 @@ and how to connect them, using Testinfra's Ansible backend.
156156
157157To use the Ansible backend, prefix the ``--hosts `` option with ``ansible:// `` e.g::
158158
159- $ py.test --hosts='ansible://all' # tests all inventory hosts
160- $ py.test --hosts='ansible://host1,ansible://host2'
161- $ py.test --hosts='ansible://web*'
159+ $ pytest --hosts='ansible://all' # tests all inventory hosts
160+ $ pytest --hosts='ansible://host1,ansible://host2'
161+ $ pytest --hosts='ansible://web*'
162162
163163An inventory may be specified with the ``--ansible-inventory `` option, otherwise
164164the default (``/etc/ansible/hosts ``) is used.
@@ -169,8 +169,8 @@ are supported values. Other connections (or if you are using the ``--force-ansib
169169option) will result in testinfra running all commands via Ansible itself,
170170which is substantially slower than the other backends::
171171
172- $ py.test --force-ansible --hosts='ansible://all'
173- $ py.test --hosts='ansible://host?force_ansible=True'
172+ $ pytest --force-ansible --hosts='ansible://all'
173+ $ pytest --hosts='ansible://host?force_ansible=True'
174174
175175By default, the Ansible connection backend will first try to use
176176``ansible_ssh_private_key_file `` and ``ansible_private_key_file `` to authenticate,
@@ -203,14 +203,14 @@ support connecting to a given container name within a pod and using a given
203203namespace::
204204
205205 # will use the default namespace and default container
206- $ py.test --hosts='kubectl://mypod-a1b2c3'
206+ $ pytest --hosts='kubectl://mypod-a1b2c3'
207207 # specify container name and namespace
208- $ py.test --hosts='kubectl://somepod-2536ab?container=nginx&namespace=web'
208+ $ pytest --hosts='kubectl://somepod-2536ab?container=nginx&namespace=web'
209209 # specify the kubeconfig context to use
210- $ py.test --hosts='kubectl://somepod-2536ab?context=k8s-cluster-a&container=nginx'
210+ $ pytest --hosts='kubectl://somepod-2536ab?context=k8s-cluster-a&container=nginx'
211211 # you can specify kubeconfig either from KUBECONFIG environment variable
212212 # or when working with multiple configuration with the "kubeconfig" option
213- $ py.test --hosts='kubectl://somepod-123?kubeconfig=/path/kubeconfig,kubectl://otherpod-123?kubeconfig=/other/kubeconfig'
213+ $ pytest --hosts='kubectl://somepod-123?kubeconfig=/path/kubeconfig,kubectl://otherpod-123?kubeconfig=/other/kubeconfig'
214214
215215openshift
216216~~~~~~~~~
@@ -221,30 +221,30 @@ support connecting to a given container name within a pod and using a given
221221namespace::
222222
223223 # will use the default namespace and default container
224- $ py.test --hosts='openshift://mypod-a1b2c3'
224+ $ pytest --hosts='openshift://mypod-a1b2c3'
225225 # specify container name and namespace
226- $ py.test --hosts='openshift://somepod-2536ab?container=nginx&namespace=web'
226+ $ pytest --hosts='openshift://somepod-2536ab?container=nginx&namespace=web'
227227 # you can specify kubeconfig either from KUBECONFIG environment variable
228228 # or when working with multiple configuration with the "kubeconfig" option
229- $ py.test --hosts='openshift://somepod-123?kubeconfig=/path/kubeconfig,openshift://otherpod-123?kubeconfig=/other/kubeconfig'
229+ $ pytest --hosts='openshift://somepod-123?kubeconfig=/path/kubeconfig,openshift://otherpod-123?kubeconfig=/other/kubeconfig'
230230
231231winrm
232232~~~~~
233233
234234The winrm backend uses `pywinrm <https://pypi.python.org/pypi/pywinrm >`_::
235235
236- $ py.test --hosts='winrm://Administrator:[email protected] ' 237- $ py.test --hosts='winrm://[email protected] :2200?no_ssl=true&no_verify_ssl=true' 236+ $ pytest --hosts='winrm://Administrator:[email protected] ' 237+ $ pytest --hosts='winrm://[email protected] :2200?no_ssl=true&no_verify_ssl=true' 238238
239239pywinrm's default read and operation timeout can be overridden using query
240240arguments ``read_timeout_sec `` and ``operation_timeout_sec ``::
241241
242- $ py.test --hosts='winrm://[email protected] :2200?read_timeout_sec=120&operation_timeout_sec=100' 242+ $ pytest --hosts='winrm://[email protected] :2200?read_timeout_sec=120&operation_timeout_sec=100' 243243
244244LXC/LXD
245245~~~~~~~
246246
247247The LXC backend can be used to test *running * LXC or LXD containers. It uses the
248248`lxc exec <https://linuxcontainers.org/lxd/getting-started-cli/ >`_ command::
249249
250- $ py.test --hosts='lxc://container_name'
250+ $ pytest --hosts='lxc://container_name'
0 commit comments