Multihost configuration

The multihost configuration file contains definition of the domains, hosts and their roles that are available to run the tests. It uses the YAML language.

Basic definition

domains:
- id: <domain id>
  hosts:
  - hostname: <dns host name>
    role: <host role>
    ssh:
      host: <ssh host> (optional, defaults to host name)
      port: <ssh port> (optional, defaults to 22)
      username: <ssh username> (optional, defaults to "root")
      password: <ssh password> (optional, defaults to "Secret123")
    config: <additional configuration> (optional, defaults to {})
    artifacts: <list of produced artifacts> (optional, defaults to {})

The top level element of the configuration is list of domains. Each domain has id attribute and defines the list of available hosts.

  • id: domain identifier which is used in the path inside mh fixture, see Using the mh fixture

  • hosts: list of available hosts and their roles

    • hostname: DNS host name, it may not necessarily be resolvable from the machine that runs pytest

    • role: host role

    • ssh.host: ssh host to connect to (it may be a resolvable host name or an IP address), defaults to the value of hostname

    • ssh.port: ssh port, defaults to 22

    • ssh.username: ssh username, defaults to root

    • ssh.password: ssh password for the user, defaults to Secret123

    • config: additional configuration, place for custom options, see Customize configuration

    • artifacts: list of artifacts that are automatically downloaded, see Gathering artifacts

Available roles

Currently available roles are:

  • client: SSSD client enrolled into desired providers

  • ldap: 389ds directory server

  • ipa: FreeIPA server

  • ad: Active Directory server

  • samba: Samba DC

  • nfs: NFS server

  • kdc: KDC server

client

SSSD client enrolled into the provider that you want to run the tests against. If a keytab is required by the provider it must be present somewhere on the host. The keytab is then specified in the additional configuration of the provider host.

Client role example
- hostname: client.test
  role: client
  config:
    artifacts:
    - /etc/sssd/*
    - /var/log/sssd/*
    - /var/lib/sss/db/*

Additional configuration (host/config section)

ldap

Fresh installation of 389ds directory server with TLS/SSL enabled and no data present (i.e. no object is present under the default naming context).

LDAP role example
- hostname: master.ldap.test
  role: ldap
  config:
    binddn: cn=Directory Manager
    bindpw: Secret123
    client:
      ldap_tls_reqcert: demand
      ldap_tls_cacert: /data/certs/ca.crt
      dns_discovery_domain: ldap.test

Additional configuration (host/config section)

ipa

Fresh installation of FreeIPA server with no additional data. Trust to single Active Directory and Samba domain is created.

IPA role example
- hostname: master.ipa.test
  role: ipa
  config:
    client:
      ipa_domain: ipa.test
      krb5_keytab: /enrollment/ipa.keytab
      ldap_krb5_keytab: /enrollment/ipa.keytab

Additional configuration (host/config section)

samba

Fresh installation of Samba DC with no additional data.

The following extra schema must be installed:

Samba role example
- hostname: dc.samba.test
  role: samba
  config:
    binddn: CN=Administrator,CN=Users,DC=samba,DC=test
    bindpw: Secret123
    client:
      ad_domain: samba.test
      krb5_keytab: /enrollment/samba.keytab
      ldap_krb5_keytab: /enrollment/samba.keytab

Additional configuration (host/config section)

nfs

Fresh installation of NFS server, with the server running and no exported directories.

NFS role example
- hostname: nfs.test
  role: nfs
  config:
    exports_dir: /dev/shm/exports

Additional configuration (host/config section)

  • exports_dir: Path to the directory that will be used as a parent for all directories that will be created and exported on the NFS server. On containers, this should be /dev/shm/exports or other writable location that runs on tmpfs file system.

  • Gathering artifacts

kdc

Fresh installation of Kerberos KDC server, with the server running and no additional principals.

KDC role example
- hostname: kdc.test
  role: kdc

Additional configuration (host/config section)

Additional configuration (host/config section)

Gathering artifacts

The config section of the host definition can be also used to specify which artifacts should be automatically collected from the host when a test is finished using the artifacts keyword which contains a list of artifacts. The values are path to the artifacts with a possible wildcard character. For example:

- hostname: client.test
  role: client
  config:
    artifacts:
    - /etc/sssd/*
    - /var/log/sssd/*
    - /var/lib/sss/db/*

LDAP configuration

This additional configuration can be used on roles with direct LDAP access.

  • binddn: Bind DN to authentication with.

  • bindpw: Bind password of the user.

- hostname: master.ldap.test
  role: ldap
  config:
    binddn: cn=Directory Manager
    bindpw: Secret123

Provider specific client configuration

client section of the additional configuration can specify SSSD options required for the client to successfully connect to the provider. It is a list of key-value pairs that represent options from sssd.conf. These options are automatically put into the client’s sssd.conf when a domain is imported from the role using sssd_test_framework.utils.sssd.HostSSSD.import_domain().

Client config example
- hostname: master.ipa.test
  role: ipa
  config:
    client:
      ipa_domain: ipa.test
      krb5_keytab: /enrollment/ipa.keytab
      ldap_krb5_keytab: /enrollment/ipa.keytab

The example above will add the given options to sssd.conf, these are required by the client to successfully connect to the IPA server. The keytab paths are local paths on the client host.