Test Configuration

This article describes configuration of USM QE integration tests.

Configuration Scheme

Configuration for the tests is defined in:

  • YAML configuration files which contain most of actual test configuration. File conf/main.yaml should contain list of other configuration files that are used as test configuration. File conf/defaults.yaml should be linked there at first place. After this there can be more configuration files that are specific to testing enviroment (for more see example configuration conf/usm_example.yaml). File conf/defaults.yaml should contain default configuration that is not environment specific.
  • Ansible host inventory file (see an example in conf/usm_example.hosts), which is used both by ansible and by USM QE inventory module to organize machines into groups by it’s role in test cluster. Actual path of this file is configured in one of the YAML configuration files (see conf/main.yaml).

Details for Test Development

To learn how to access configuration values from code of a test case, see Reading Configuration Values for more details.

Configuration before test run

We assume that:

  • QE Server machine has been configured as described in Setup of QE Server
  • You have host inventory file for the test cluster, which has been already deployed (our deployment automation should generate the inventory file in the end of the process).
  • You are logged as usmqe user on the QE Server

Now, you need to:

  • Check that usmqe user can ssh to all nodes with his ssh key stored in ~/.ssh. This can be configured in ~/.ssh/config. Public ssh key is deployed on all machines of test cluster.

  • Store host inventory file in conf/clustername.hosts and specify this path in inventory_file option of conf/main.yaml.

  • Verify that ssh and ansible are configured so that one can reach all machines from test cluster:

    [usmqe@qeserver ~]$ ansible -i conf/clustername.hosts -m ping -u root all
    
  • Provide all mandatory options in usm config file. This includes: username, password, web_url, api_url and cluster_member. The actual list depends on the test suite you are going to run (eg. api tests don’t care about web_url while LDAP integration tests would need to know address of the LDAP server).

Configuration options

  • log_level - Log level. It can be one of [DEBUG, INFO, WARNING, ERROR, CRITICAL, FATAL]
  • username - API and UI login
  • password - API and UI password
  • web_url - web UI url
  • api_url - API url
  • etcd_api_url - Etcd API url
  • ca_cert - path to CA cert
  • cluster_member - one of nodes from cluster which identifies cluster for re-use testing, see section Structure of Functional Tests.