Ce contenu n'est pas disponible dans la langue sélectionnée.
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 Copier lienLien copié sur presse-papiers!
- An OpenStack environment that contains the Integration Test Suite packages. For more information, see Installing the Integration Test Suite with director.
3.2. Creating a workspace Copier lienLien copié sur presse-papiers!
Create a workspace for your Integration Test Suite (tempest) configuration and output.
Procedure
Source the credentials for the target deployment:
If the target is in the undercloud, source the credentials for the undercloud:
# source stackrcIf the target is in the overcloud, source the credentials for the overcloud:
# source overcloudrc
Initialize
tempest:# tempest init mytempest # cd mytempestThis command creates a tempest workspace named
mytempest.Optional: Enter the following command to view a list of existing workspaces:
# tempest workspace listGenerate the
etc/tempest.conffile:# discover-tempest-config --deployer-input ~/tempest-deployer-input.conf \ --debug --create --network-id <UUID>Replace
UUIDwith the UUID of the external network.discover-tempest-configwas formerly calledconfig_tempest.pyand uses the same parameters.python-tempestconfis as a dependency ofopenstack-tempestand provides thediscover-tempest-config.NoteTo generate the
etc/tempest.conffile for the undercloud, ensure that the region name in thetempest-deployer-input.conffile is the same as the name in the undercloud deployment. If these names do not match, update the region name in thetempest-deployer-input.conffile to match the region name of your undercloud.To inspect the region name of your undercloud, enter the following commands:
$ source stackrc $ openstack region listTo 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 Copier lienLien copié sur presse-papiers!
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 Copier lienLien copié sur presse-papiers!
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 Copier lienLien copié sur presse-papiers!
You can configure heat_plugin manually in the tempest.conf file.
Procedure
Use the following example to configure
heat_pluginaccording 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.
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 Copier lienLien copié sur presse-papiers!
You can change the default location for log files in the logs directory within your tempest workspace.
Procedure
In
tempest.conf, under the[DEFAULT]section, setlog_dirto the desired directory:[DEFAULT] log_dir = <directory>If you have your own logging configuration file, in
tempest.conf, under the[DEFAULT]section, setlog_config_appendto 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 Copier lienLien copié sur presse-papiers!
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
-
Configure options in the
tempest.confconfiguration file to specify the target microversions. Configure these options to ensure that the supported microversions correspond to the microversions in the OpenStack cloud. 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
computeservice, in the[compute]section of your configuration file, assign values to themin_microversionandmax_microversionparameters:[compute] min_microversion = 2.14 max_microversion = latest