Configuration File
The configuration file (usually named mhc.yaml) contains the definition of
which multihost domains and hosts are at the moment available to use for
testing. If all tests can be run with given set of hosts then all tests are
run, but it is perfectly possible to omit some host in order to run only a
subset of available tests – the tests that require more or different hosts
are silently skipped.
The configuration file uses the YAML format.
config: <custom global configuration>
domains:
- id: <domain id>
config: <custom domain configuration>
hosts:
- hostname: <dns hostname, should resolvable within the hosts>
role: <host role>
os:
family: <host operating system family>
conn:
type: <connection type>
config: <custom host configuration>
artifacts:
- <list of collected artifacts>
Field |
Required |
Default value |
Description |
|---|---|---|---|
|
No |
|
Custom global configuration |
|
Yes |
N/A |
List of multihost domains |
|
Yes |
N/A |
Domain identifier |
|
No |
|
Custom domain configuration |
|
Yes |
N/A |
List of domain’s host |
|
Yes |
N/A |
DNS hostname, should be resolvable within the hosts |
|
Yes |
N/A |
Multihost role that this host fulfils |
|
No |
|
OS family: |
|
No |
See below |
How to connect to the host |
|
No |
|
Connection type:
ssh, podman, dockerAdditional properties are define by each type
|
|
No |
|
Custom host configuration |
|
No |
|
List of artifacts to collect from the host |
Minimal configuration
Minimal configuration example
domains:
- id: example
hosts:
- hostname: hostname.example
role: client
config:
domains:
- id: example
config:
hosts:
- hostname: hostname.example
role: client
os:
family: linux
conn:
type: ssh
host: $host.hostname
user: root
password: Secret123
config:
artifacts:
Connection type
The conn field declares how does pytest-mh connect to each hosts. Pytest-mh
has built-in connectors for ssh, podman and docker. Each connection
has additional properties. If the conn field is omitted, the default is
type=ssh, user=root, password=Secret123, host=host.hostname.
See more information about each connection type at Configuring the Main Connection.