Blame tests/README.md

Packit Service 0a38ef
# Running the tests
Packit Service 0a38ef
Packit Service 0a38ef
## Before starting
Packit Service 0a38ef
Packit Service 0a38ef
In order to run ansible-freeipa tests you will need to have `ansible` and `pytest` installed on your machine. We'll call this local machine `controller`.
Packit Service 0a38ef
Packit Service 0a38ef
You will also need to have a remote host with freeipa server installed and configured. We'll call this remote host `ipaserver`.
Packit Service 0a38ef
Packit Service 0a38ef
Some other requirements:
Packit Service 0a38ef
Packit Service 0a38ef
 * The `controller` must be able to connect to `ipaserver` through ssh using keys.
Packit Service 0a38ef
 * `ipaserver` must be configured with DNS support. See [ipaserver role](../roles/ipaserver/README.md).
Packit Service 0a38ef
 * IPA admin password must be `SomeADMINpassword`.
Packit Service 0a38ef
 * Directory Server admin password must be `SomeDMpassword`.
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
## Running the tests
Packit Service 0a38ef
Packit Service 0a38ef
To run the tests run:
Packit Service 0a38ef
Packit Service 0a38ef
```
Packit Service 0a38ef
IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
If you need to run using a different user you can use `ANSIBLE_REMOTE_USER`
Packit Service 0a38ef
environment variable. For example:
Packit Service 0a38ef
Packit Service 0a38ef
```
Packit Service 0a38ef
ANSIBLE_REMOTE_USER=root IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
To select which tests to run use the option `-k`. For example:
Packit Service 0a38ef
Packit Service 0a38ef
```
Packit Service 0a38ef
IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest -k dnszone
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
To see the ansible output use the option `--capture=sys`. For example:
Packit Service 0a38ef
Packit Service 0a38ef
```
Packit Service 0a38ef
IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest --capture=sys
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
To see why tests were skipped use `-rs`. For example:
Packit Service 0a38ef
Packit Service 0a38ef
```
Packit Service 0a38ef
IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest -rs
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
For a complete list of options check `pytest --help`.
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
## Upcoming/desired improvements:
Packit Service 0a38ef
Packit Service 0a38ef
* A script to pre-config the complete test environment using virsh.
Packit Service 0a38ef
* A test matrix to run tests against different distros in parallel (probably using tox).
Packit Service 0a38ef
* Allow to connect to `ipaserver` using ssh and password.
Packit Service 0a38ef