Chapter 3. Configuring the Integration Test Suite (tempest)

Before you begin validating your environment with the Integration Test Suite, you must create a workspace and generate the /etc/tempest.conf configuration file.

3.1. Prerequisites

3.2. Creating a workspace

Create a workspace for your Integration Test Suite (tempest) configuration and output.

Procedure

  1. Source the credentials for the target deployment:

    • If the target is in the undercloud, source the credentials for the undercloud:

      # source stackrc
    • If the target is in the overcloud, source the credentials for the overcloud:

      # source overcloudrc
  2. Initialize tempest:

    # tempest init mytempest
    # cd mytempest

    This command creates a tempest workspace named mytempest.

  3. Optional: Enter the following command to view a list of existing workspaces:

    # tempest workspace list
  4. Generate the etc/tempest.conf file:

    # discover-tempest-config --deployer-input ~/tempest-deployer-input.conf \
    --debug --create --network-id <UUID>

    Replace UUID with the UUID of the external network.

    discover-tempest-config was formerly called config_tempest.py and uses the same parameters. python-tempestconf is as a dependency of openstack-tempest and provides the discover-tempest-config.

    Note

    To generate the etc/tempest.conf file for the undercloud, ensure that the region name in the tempest-deployer-input.conf file is the same as the name in the undercloud deployment. If these names do not match, update the region name in the tempest-deployer-input.conf file to match the region name of your undercloud.

  5. To inspect the region name of your undercloud, enter the following commands:

    $ source stackrc
    $ openstack region list
  6. To inspect the region name of your overcloud, enter the following commands:

    $ source overcloudrc
    $ openstack region list

You might need to modify the default tempest.conf file to suit your environment. For more information, see Configuring extension lists and Configuring heat_plugin.

Verification

  • Verify your current tempest configuration:

    # tempest verify-config -o <output>

The value of output is the output file where Integration Test Suite writes your updated configuration. This is different from your original configuration file.

3.3. Configuring the Integration Test Suite manually

The discover-tempest-config command generates the tempest.conf file automatically. However, you must ensure that the tempest.conf file corresponds to the configuration of your environment.

3.3.1. Configuring Integration Test Suite extension lists manually

The default tempest.conf file contains lists of extensions for each component. Inspect the api_extensions attribute for each component in the tempest.conf file and verify that the lists of extensions correspond to your deployment.

If the extensions that are available in your deployment do not correspond to the list of extensions in the api_extensions attribute of the tempest.conf file, the component fails tempest tests. To prevent this failure, you must identify the extensions that are available in your deployment and include them in the api_extensions parameter. To get a list of Network, Compute, Volume, or Identity extensions in your deployment, run the following command:

Procedure

  • To retrieve a list of Network, Compute, Volume, or Identity extensions in your deployment, enter the following command:

    $ openstack extension list [--network] [--compute] [--volume] [--identity]

3.3.2. Configuring heat_plugin manually

You can configure heat_plugin manually in the tempest.conf file.

Procedure

  • Use the following example to configure heat_plugin according to your deployment:

    [service_available]
    heat = True
    
    [heat_plugin]
    username = demo
    password = ***
    project_name = demo
    admin_username = admin
    admin_password = ****
    admin_project_name = admin
    auth_url = http://10.0.0.110:5000//v3
    auth_version = 3
    user_domain_id = default
    project_domain_id = default
    user_domain_name = Default
    project_domain_name = Default
    region = regionOne
    fixed_network_name = demo_project_network
    network_for_ssh = public
    floating_network_name = nova
    instance_type = m1.nano
    minimal_instance_type = m1.micro
    image_ref = 7faed41e-a56c-4971-bf48-24e4e23e69a5
    minimal_image_ref = 7faed41e-a56c-4971-bf48-24e4e23e69a5

Use the openstack network list command to identify networks for the fixed_network_name, network_for_ssh, and floating_network_name parameters.

Note

You must set heat to True in the [service_available] section of the tempest.conf file, and the user in the username attribute of the [heat_plugin] section must have the role member. For example, enter the following command to add the member role to the demo user:

$ openstack role add --user demo --project demo member

3.4. Configuring Integration Test Suite logging

You can change the default location for log files in the logs directory within your tempest workspace.

Procedure

  1. In tempest.conf, under the [DEFAULT] section, set log_dir to the desired directory:

    [DEFAULT]
    log_dir = <directory>
  2. If you have your own logging configuration file, in tempest.conf, under the [DEFAULT] section, set log_config_append to your file:

    [DEFAULT]
    log_config_append = <file>

If you set the log_config_append attribute, the Integration Test Suite ignores all other logging configuration in tempest.conf, including the log_dir attribute.

3.5. Configuring Integration Test Suite microversion tests

The Integration Test Suite (tempest) provides stable interfaces to test the API microversions. To implement microversion tests by using these interfaces, complete the following steps.

Procedure

  1. Configure options in the tempest.conf configuration file to specify the target microversions. Configure these options to ensure that the supported microversions correspond to the microversions in the OpenStack cloud.
  2. You can specify a range of target microversions to run multiple microversion tests in a single Integration Test Suite operation.

    For example, to limit the range of microversions for the compute service, in the [compute] section of your configuration file, assign values to the min_microversion and max_microversion parameters:

    [compute]
    min_microversion = 2.14
    max_microversion = latest