blob: 5b4bec4a46de6534a3b50c20c2953cf2c0dfca24 [file] [log] [blame]
Matthew Treinisha970d652015-03-11 15:39:24 -04001.. _tempest-configuration:
2
Matthew Treinishbc1b15b2015-02-20 15:56:07 -05003Tempest Configuration Guide
4===========================
5
Matthew Treinishf640f662015-03-11 15:13:30 -04006This guide is a starting point for configuring tempest. It aims to elaborate
7on and explain some of the mandatory and common configuration settings and how
8they are used in conjunction. The source of truth on each option is the sample
Matthew Treinishf45ba2e2015-08-24 15:05:01 -04009config file which explains the purpose of each individual option. You can see
10the sample config file here: :ref:`tempest-sampleconf`
Matthew Treinishf640f662015-03-11 15:13:30 -040011
12Lock Path
13---------
14
15There are some tests and operations inside of tempest that need to be
16externally locked when running in parallel to prevent them from running at
17the same time. This is a mandatory step for configuring tempest and is still
18needed even when running serially. All that is needed to do this is:
19
20 #. Set the lock_path option in the oslo_concurrency group
21
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050022Auth/Credentials
23----------------
24
25Tempest currently has 2 different ways in configuration to provide credentials
26to use when running tempest. One is a traditional set of configuration options
27in the tempest.conf file. These options are in the identity section and let you
Toru Tanami32f45182015-08-20 05:24:50 +000028specify a regular user, a global admin user, and an alternate user set of
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050029credentials. (which consist of a username, password, and project/tenant name)
30These options should be clearly labelled in the sample config file in the
31identity section.
32
33The other method to provide credentials is using the accounts.yaml file. This
34file is used to specify an arbitrary number of users available to run tests
35with. You can specify the location of the file in the
36auth section in the tempest.conf file. To see the specific format used in
37the file please refer to the accounts.yaml.sample file included in tempest.
38Currently users that are specified in the accounts.yaml file are assumed to
39have the same set of roles which can be used for executing all the tests you
40are running. This will be addressed in the future, but is a current limitation.
41Eventually the config options for providing credentials to tempest will be
42deprecated and removed in favor of the accounts.yaml file.
43
Matthew Treinish7909e122015-04-15 15:43:50 -040044Keystone Connection Info
45^^^^^^^^^^^^^^^^^^^^^^^^
46In order for tempest to be able to talk to your OpenStack deployment you need
47to provide it with information about how it communicates with keystone.
48This involves configuring the following options in the identity section:
49
50 #. auth_version
51 #. uri
52 #. uri_v3
53
54The *auth_version* option is used to tell tempest whether it should be using
55keystone's v2 or v3 api for communicating with keystone. (except for the
56identity api tests which will test a specific version) The 2 uri options are
57used to tell tempest the url of the keystone endpoint. The *uri* option is used
58for keystone v2 request and *uri_v3* is used for keystone v3. You want to ensure
59that which ever version you set for *auth_version* has its uri option defined.
60
61
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050062Credential Provider Mechanisms
63^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64
65Tempest currently also has 3 different internal methods for providing
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -070066authentication to tests. Dynamic credentials, locking test accounts, and
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050067non-locking test accounts. Depending on which one is in use the configuration
68of tempest is slightly different.
69
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -070070Dynamic Credentials
71"""""""""""""""""""
72Dynamic Credentials (formerly known as Tenant isolation) was originally created
73to enable running tempest in parallel.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050074For each test class it creates a unique set of user credentials to use for the
75tests in the class. It can create up to 3 sets of username, password, and
76tenant/project names for a primary user, an admin user, and an alternate user.
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -070077To enable and use dynamic credentials you only need to configure 2 things:
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050078
79 #. A set of admin credentials with permissions to create users and
Matthew Treinish16cf1e52015-08-11 10:39:23 -040080 tenants/projects. This is specified in the auth section with the
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -070081 admin_username, admin_tenant_name, admin_domain_name and admin_password
Matthew Treinish16cf1e52015-08-11 10:39:23 -040082 options
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -070083 #. To enable dynamic_creds in the auth section with the
84 use_dynamic_credentials option.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050085
Matthew Treinish0fd69e42015-03-06 00:40:51 -050086This is also the currently the default credential provider enabled by tempest,
87due to it's common use and ease of configuration.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050088
Matthew Treinish4fae4722015-04-16 21:03:54 -040089It is worth pointing out that depending on your cloud configuration you might
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -070090need to assign a role to each of the users created by Tempest's dynamic
91credentials.
Matthew Treinish4fae4722015-04-16 21:03:54 -040092This can be set using the *tempest_roles* option. It takes in a list of role
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -070093names each of which will be assigned to each of the users created by dynamic
94credentials. This option will not have any effect when set and tempest is not
95configured to use dynamic credentials.
Matthew Treinish4fae4722015-04-16 21:03:54 -040096
97
Matthew Treinish93299852015-04-24 09:58:18 -040098Locking Test Accounts (aka accounts.yaml or accounts file)
99""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700100For a long time using dynamic credentials was the only method available if you
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500101wanted to enable parallel execution of tempest tests. However this was
102insufficient for certain use cases because of the admin credentials requirement
103to create the credential sets on demand. To get around that the accounts.yaml
104file was introduced and with that a new internal credential provider to enable
105using the list of credentials instead of creating them on demand. With locking
106test accounts each test class will reserve a set of credentials from the
107accounts.yaml before executing any of its tests so that each class is isolated
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700108like with dynamic credentials.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500109
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500110To enable and use locking test accounts you need do a few things:
111
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500112 #. Create a accounts.yaml file which contains the set of pre-existing
113 credentials to use for testing. To make sure you don't have a credentials
114 starvation issue when running in parallel make sure you have at least 2
Matthew Treinishfc7cd8f2015-03-30 11:51:55 -0400115 times the number of worker processes you are using to execute tempest
116 available in the file. (if running serially the worker count is 1)
Matthew Treinish0fd69e42015-03-06 00:40:51 -0500117
118 You can check the sample file packaged in tempest for the yaml format
liuchenhongaa4aa692015-06-10 12:18:42 +0800119 #. Provide tempest with the location of your accounts.yaml file with the
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500120 test_accounts_file option in the auth section
121
Matthew Treinish84c6d292015-12-16 17:50:57 -0500122 *NOTE: Be sure to use a full path for the file otherwise Tempest will
123 likely not find it.*
124
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700125 #. Set use_dynamic_credentials = False in the auth group
Fei Long Wang7fee7872015-05-12 11:36:49 +1200126
Matthew Treinish93299852015-04-24 09:58:18 -0400127It is worth pointing out that each set of credentials in the accounts.yaml
128should have a unique tenant. This is required to provide proper isolation
129to the tests using the credentials, and failure to do this will likely cause
130unexpected failures in some tests.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500131
Matthew Treinish93299852015-04-24 09:58:18 -0400132
Andrea Frittoli (andreaf)290b3e12015-10-08 10:25:02 +0100133Legacy test accounts (aka credentials config options)
134"""""""""""""""""""""""""""""""""""""""""""""""""""""
Matthew Treinish16cf1e52015-08-11 10:39:23 -0400135**Starting in the Liberty release this mechanism was deprecated and will be
136removed in a future release**
137
Matthew Treinish57092132015-04-21 14:21:35 -0400138When Tempest was refactored to allow for locking test accounts, the original
139non-tenant isolated case was converted to internally work similarly to the
Andrea Frittoli (andreaf)290b3e12015-10-08 10:25:02 +0100140accounts.yaml file. This mechanism was then called the legacy test accounts
141provider. To use the legacy test accounts provider you can specify the sets of
142credentials in the configuration file like detailed above with following 9
Matthew Treinish57092132015-04-21 14:21:35 -0400143options in the identity section:
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500144
145 #. username
146 #. password
147 #. tenant_name
148 #. admin_username
149 #. admin_password
150 #. admin_tenant_name
151 #. alt_username
152 #. alt_password
153 #. alt_tenant_name
154
Atsushi SAKAI0a183b82015-07-28 21:52:17 +0900155And in the auth section:
Fei Long Wang7fee7872015-05-12 11:36:49 +1200156
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700157 #. use_dynamic_credentials = False
Fei Long Wang7fee7872015-05-12 11:36:49 +1200158 #. comment out 'test_accounts_file' or keep it as empty
159
Matthew Treinish57092132015-04-21 14:21:35 -0400160It only makes sense to use it if parallel execution isn't needed, since tempest
161won't be able to properly isolate tests using this. Additionally, using the
162traditional config options for credentials is not able to provide credentials to
163tests which requires specific roles on accounts. This is because the config
164options do not give sufficient flexibility to describe the roles assigned to a
165user for running the tests. There are additional limitations with regard to
166network configuration when using this credential provider mechanism, see the
167`Networking`_ section below.
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400168
Matthew Treinish7909e122015-04-15 15:43:50 -0400169Compute
170-------
171
172Flavors
173^^^^^^^
174For tempest to be able to create servers you need to specify flavors that it
175can use to boot the servers with. There are 2 options in the tempest config
176for doing this:
177
178 #. flavor_ref
179 #. flavor_ref_alt
180
181Both of these options are in the compute section of the config file and take
182in the flavor id (not the name) from nova. The *flavor_ref* option is what will
183be used for booting almost all of the guests, *flavor_ref_alt* is only used in
184tests where 2 different sized servers are required. (for example a resize test)
185
186Using a smaller flavor is generally recommended, when larger flavors are used
187the extra time required to bring up servers will likely affect total run time
188and probably require tweaking timeout values to ensure tests have ample time to
189finish.
190
191Images
192^^^^^^
193Just like with flavors, tempest needs to know which images to use for booting
194servers. There are 2 options in the compute section just like with flavors:
195
196 #. image_ref
197 #. image_ref_alt
198
199Both options are expecting an image id (not name) from nova. The *image_ref*
Brandon Palm304bfdd2015-08-18 10:57:21 -0500200option is what will be used for booting the majority of servers in tempest.
Matthew Treinish7909e122015-04-15 15:43:50 -0400201*image_ref_alt* is used for tests that require 2 images such as rebuild. If 2
202images are not available you can set both options to the same image_ref and
203those tests will be skipped.
204
205There are also options in the scenario section for images:
206
207 #. img_file
208 #. img_dir
209 #. aki_img_file
210 #. ari_img_file
211 #. ami_img_file
212 #. img_container_format
213 #. img_disk_format
214
215however unlike the other image options these are used for a very small subset
216of scenario tests which are uploading an image. These options are used to tell
217tempest where an image file is located and describe it's metadata for when it's
218uploaded.
219
220The behavior of these options is a bit convoluted (which will likely be fixed
221in future versions). You first need to specify *img_dir*, which is the directory
222tempest will look for the image files in. First it will check if the filename
223set for *img_file* could be found in *img_dir*. If it is found then the
224*img_container_format* and *img_disk_format* options are used to upload that
225image to glance. However if it's not found tempest will look for the 3 uec image
226file name options as a fallback. If neither is found the tests requiring an
227image to upload will fail.
228
229It is worth pointing out that using `cirros`_ is a very good choice for running
230tempest. It's what is used for upstream testing, they boot quickly and have a
231small footprint.
232
233.. _cirros: https://launchpad.net/cirros
234
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400235Networking
236----------
237OpenStack has a myriad of different networking configurations possible and
238depending on which of the 2 network backends, nova-network or neutron, you are
239using things can vary drastically. Due to this complexity Tempest has to provide
240a certain level of flexibility in it's configuration to ensure it will work
241against any cloud. This ends up causing a large number of permutations in
242Tempest's config around network configuration.
243
244
245Enabling Remote Access to Created Servers
246^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
247When Tempest creates servers for testing, some tests require being able to
248connect those servers. Depending on the configuration of the cloud, the methods
249for doing this can be different. In certain configurations it is required to
250specify a single network with server create calls. Accordingly, Tempest provides
251a few different methods for providing this information in configuration to try
252and ensure that regardless of the clouds configuration it'll still be able to
253run. This section covers the different methods of configuring Tempest to provide
254a network when creating servers.
255
256Fixed Network Name
257""""""""""""""""""
258This is the simplest method of specifying how networks should be used. You can
259just specify a single network name/label to use for all server creations. The
260limitation with this is that all tenants/projects and users must be able to see
261that network name/label if they were to perform a network list and be able to
262use it.
263
264If no network name is assigned in the config file and none of the below
265alternatives are used, then Tempest will not specify a network on server
266creations, which depending on the cloud configuration might prevent them from
267booting.
268
269To set a fixed network name simply do:
270
271 #. Set the fixed_network_name option in the compute group
272
273In the case that the configured fixed network name can not be found by a user
274network list call, it will be treated like one was not provided except that a
275warning will be logged stating that it couldn't be found.
276
277
278Accounts File
279"""""""""""""
280If you are using an accounts file to provide credentials for running Tempest
281then you can leverage it to also specify which network should be used with
282server creations on a per tenant/project and user pair basis. This provides
283the necessary flexibility to work with more intricate networking configurations
284by enabling the user to specify exactly which network to use for which
285tenants/projects. You can refer to the accounts.yaml sample file included in
286the tempest repo for the syntax around specifying networks in the file.
287
288However, specifying a network is not required when using an accounts file. If
289one is not specified you can use a fixed network name to specify the network to
290use when creating servers just as without an accounts file. However, any network
291specified in the accounts file will take precedence over the fixed network name
292provided. If no network is provided in the accounts file and a fixed network
293name is not set then no network will be included in create server requests.
294
295If a fixed network is provided and the accounts.yaml file also contains networks
296this has the benefit of enabling a couple more tests which require a static
297network to perform operations like server lists with a network filter. If a
298fixed network name is not provided these tests are skipped. Additionally, if a
299fixed network name is provided it will serve as a fallback in case of a
300misconfiguration or a missing network in the accounts file.
301
302
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700303With Dynamic Credentials
304""""""""""""""""""""""""
305With dynamic credentials enabled and using nova-network then nothing changes.
306Your only option for configuration is to either set a fixed network name or not.
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400307However, in most cases it shouldn't matter because nova-network should have no
308problem booting a server with multiple networks. If this is not the case for
309your cloud then using an accounts file is recommended because it provides the
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700310necessary flexibility to describe your configuration. Dynamic credentials is not
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400311able to dynamically allocate things as necessary if neutron is not enabled.
312
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700313With neutron and dynamic credentials enabled there should not be any additional
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400314configuration necessary to enable Tempest to create servers with working
315networking, assuming you have properly configured the network section to work
316for your cloud. Tempest will dynamically create the neutron resources necessary
317to enable using servers with that network. Also, just as with the accounts
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700318file, if you specify a fixed network name while using neutron and dynamic
319credentials it will enable running tests which require a static network and it
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400320will additionally be used as a fallback for server creation. However, unlike
321accounts.yaml this should never be triggered.
Matthew Treinish3220cad2015-04-15 16:25:48 -0400322
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700323However, there is an option *create_isolated_networks* to disable dynamic
324credentials's automatic provisioning of network resources. If this option is
Matthew Treinish2219d382015-04-24 10:33:04 -0400325used you will have to either rely on there only being a single/default network
326available for the server creation, or use *fixed_network_name* to inform
327Tempest which network to use.
328
Matthew Treinishf96ab3a2015-04-15 19:11:31 -0400329Configuring Available Services
330------------------------------
331OpenStack is really a constellation of several different projects which
332are running together to create a cloud. However which projects you're running
333is not set in stone, and which services are running is up to the deployer.
334Tempest however needs to know which services are available so it can figure
335out which tests it is able to run and certain setup steps which differ based
336on the available services.
337
338The *service_available* section of the config file is used to set which
339services are available. It contains a boolean option for each service (except
340for keystone which is a hard requirement) set it to True if the service is
341available or False if it is not.
342
343Service Catalog
344^^^^^^^^^^^^^^^
345Each project which has its own REST API contains an entry in the service
346catalog. Like most things in OpenStack this is also completely configurable.
347However, for tempest to be able to figure out the endpoints to send REST API
348calls for each service to it needs to know how that project is defined in the
349service catalog. There are 3 options for each service section to accomplish
350this:
351
352 #. catalog_type
353 #. endpoint_type
354 #. region
355
356Setting *catalog_type* and *endpoint_type* should normally give Tempest enough
357information to determine which endpoint it should pull from the service
358catalog to use for talking to that particular service. However, if you're cloud
359has multiple regions available and you need to specify a particular one to use
360a service you can set the *region* option in that service's section.
361
362It should also be noted that the default values for these options are set
363to what devstack uses. (which is a de facto standard for service catalog
364entries) So often nothing actually needs to be set on these options to enable
365communication to a particular service. It is only if you are either not using
366the same *catalog_type* as devstack or you want Tempest to talk to a different
367endpoint type instead of publicURL for a service that these need to be changed.
368
ghanshyam571dfac2015-10-30 11:21:28 +0900369.. note::
370
371 Tempest does not serve all kind of fancy URLs in the service catalog.
372 Service catalog should be in a standard format (which is going to be
373 standardized at keystone level).
374 Tempest expects URLs in the Service catalog in below format:
375 * http://example.com:1234/<version-info>
376 Examples:
377 * Good - http://example.com:1234/v2.0
378 * Wouldn’t work - http://example.com:1234/xyz/v2.0/
379 (adding prefix/suffix around version etc)
Matthew Treinishf96ab3a2015-04-15 19:11:31 -0400380
Matthew Treinish3220cad2015-04-15 16:25:48 -0400381Service feature configuration
382-----------------------------
383
384OpenStack provides its deployers a myriad of different configuration options
385to enable anyone deploying it to create a cloud tailor-made for any individual
386use case. It provides options for several different backend type, databases,
387message queues, etc. However, the downside to this configurability is that
388certain operations and features aren't supported depending on the configuration.
389These features may or may not be discoverable from the API so the burden is
390often on the user to figure out what the cloud they're talking to supports.
391Besides the obvious interoperability issues with this it also leaves Tempest
392in an interesting situation trying to figure out which tests are expected to
393work. However, Tempest tests do not rely on dynamic api discovery for a feature
394(assuming one exists). Instead Tempest has to be explicitly configured as to
395which optional features are enabled. This is in order to prevent bugs in the
396discovery mechanisms from masking failures.
397
398The service feature-enabled config sections are how Tempest addresses the
399optional feature question. Each service that has tests for optional features
400contains one of these sections. The only options in it are boolean options
401with the name of a feature which is used. If it is set to false any test which
402depends on that functionality will be skipped. For a complete list of all these
403options refer to the sample config file.
404
405
406API Extensions
407^^^^^^^^^^^^^^
408The service feature-enabled sections often contain an *api-extensions* option
409(or in the case of swift a *discoverable_apis* option) this is used to tell
410tempest which api extensions (or configurable middleware) is used in your
411deployment. It has 2 valid config states, either it contains a single value
412"all" (which is the default) which means that every api extension is assumed
413to be enabled, or it is set to a list of each individual extension that is
414enabled for that service.