blob: b6e00ce7d46ff3c81add5e170b9b0e17c67d9ac4 [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
9config file which explains the purpose of each individual option.
10
11Lock Path
12---------
13
14There are some tests and operations inside of tempest that need to be
15externally locked when running in parallel to prevent them from running at
16the same time. This is a mandatory step for configuring tempest and is still
17needed even when running serially. All that is needed to do this is:
18
19 #. Set the lock_path option in the oslo_concurrency group
20
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050021Auth/Credentials
22----------------
23
24Tempest currently has 2 different ways in configuration to provide credentials
25to use when running tempest. One is a traditional set of configuration options
26in the tempest.conf file. These options are in the identity section and let you
27specify a regular user, a global admin user, and a alternate user set of
28credentials. (which consist of a username, password, and project/tenant name)
29These options should be clearly labelled in the sample config file in the
30identity section.
31
32The other method to provide credentials is using the accounts.yaml file. This
33file is used to specify an arbitrary number of users available to run tests
34with. You can specify the location of the file in the
35auth section in the tempest.conf file. To see the specific format used in
36the file please refer to the accounts.yaml.sample file included in tempest.
37Currently users that are specified in the accounts.yaml file are assumed to
38have the same set of roles which can be used for executing all the tests you
39are running. This will be addressed in the future, but is a current limitation.
40Eventually the config options for providing credentials to tempest will be
41deprecated and removed in favor of the accounts.yaml file.
42
Matthew Treinish7909e122015-04-15 15:43:50 -040043Keystone Connection Info
44^^^^^^^^^^^^^^^^^^^^^^^^
45In order for tempest to be able to talk to your OpenStack deployment you need
46to provide it with information about how it communicates with keystone.
47This involves configuring the following options in the identity section:
48
49 #. auth_version
50 #. uri
51 #. uri_v3
52
53The *auth_version* option is used to tell tempest whether it should be using
54keystone's v2 or v3 api for communicating with keystone. (except for the
55identity api tests which will test a specific version) The 2 uri options are
56used to tell tempest the url of the keystone endpoint. The *uri* option is used
57for keystone v2 request and *uri_v3* is used for keystone v3. You want to ensure
58that which ever version you set for *auth_version* has its uri option defined.
59
60
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050061Credential Provider Mechanisms
62^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63
64Tempest currently also has 3 different internal methods for providing
65authentication to tests. Tenant isolation, locking test accounts, and
66non-locking test accounts. Depending on which one is in use the configuration
67of tempest is slightly different.
68
69Tenant Isolation
70""""""""""""""""
71Tenant isolation was originally create to enable running tempest in parallel.
72For each test class it creates a unique set of user credentials to use for the
73tests in the class. It can create up to 3 sets of username, password, and
74tenant/project names for a primary user, an admin user, and an alternate user.
75To enable and use tenant isolation you only need to configure 2 things:
76
77 #. A set of admin credentials with permissions to create users and
78 tenants/projects. This is specified in the identity section with the
79 admin_username, admin_tenant_name, and admin_password options
80 #. To enable tenant_isolation in the auth section with the
81 allow_tenant_isolation option.
82
Matthew Treinish0fd69e42015-03-06 00:40:51 -050083This is also the currently the default credential provider enabled by tempest,
84due to it's common use and ease of configuration.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050085
Matthew Treinish4fae4722015-04-16 21:03:54 -040086It is worth pointing out that depending on your cloud configuration you might
87need to assign a role to each of the users created Tempest's tenant isolation.
88This can be set using the *tempest_roles* option. It takes in a list of role
89names each of which will be assigned to each of the users created by tenant
90isolation. This option will not have any effect when set and tempest is not
91configured to use tenant isolation.
92
93
Matthew Treinish93299852015-04-24 09:58:18 -040094Locking Test Accounts (aka accounts.yaml or accounts file)
95""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050096For a long time using tenant isolation was the only method available if you
97wanted to enable parallel execution of tempest tests. However this was
98insufficient for certain use cases because of the admin credentials requirement
99to create the credential sets on demand. To get around that the accounts.yaml
100file was introduced and with that a new internal credential provider to enable
101using the list of credentials instead of creating them on demand. With locking
102test accounts each test class will reserve a set of credentials from the
103accounts.yaml before executing any of its tests so that each class is isolated
104like in tenant isolation.
105
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500106To enable and use locking test accounts you need do a few things:
107
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500108 #. Create a accounts.yaml file which contains the set of pre-existing
109 credentials to use for testing. To make sure you don't have a credentials
110 starvation issue when running in parallel make sure you have at least 2
Matthew Treinishfc7cd8f2015-03-30 11:51:55 -0400111 times the number of worker processes you are using to execute tempest
112 available in the file. (if running serially the worker count is 1)
Matthew Treinish0fd69e42015-03-06 00:40:51 -0500113
114 You can check the sample file packaged in tempest for the yaml format
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500115 #. Provide tempest with the location of you accounts.yaml file with the
116 test_accounts_file option in the auth section
117
Matthew Treinish93299852015-04-24 09:58:18 -0400118It is worth pointing out that each set of credentials in the accounts.yaml
119should have a unique tenant. This is required to provide proper isolation
120to the tests using the credentials, and failure to do this will likely cause
121unexpected failures in some tests.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500122
Matthew Treinish93299852015-04-24 09:58:18 -0400123
124Non-locking test accounts (aka credentials config options)
125""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Matthew Treinish57092132015-04-21 14:21:35 -0400126When Tempest was refactored to allow for locking test accounts, the original
127non-tenant isolated case was converted to internally work similarly to the
128accounts.yaml file. This mechanism was then called the non-locking test accounts
129provider. To use the non-locking test accounts provider you can specify the sets
130of credentials in the configuration file like detailed above with following 9
131options in the identity section:
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500132
133 #. username
134 #. password
135 #. tenant_name
136 #. admin_username
137 #. admin_password
138 #. admin_tenant_name
139 #. alt_username
140 #. alt_password
141 #. alt_tenant_name
142
Matthew Treinish57092132015-04-21 14:21:35 -0400143It only makes sense to use it if parallel execution isn't needed, since tempest
144won't be able to properly isolate tests using this. Additionally, using the
145traditional config options for credentials is not able to provide credentials to
146tests which requires specific roles on accounts. This is because the config
147options do not give sufficient flexibility to describe the roles assigned to a
148user for running the tests. There are additional limitations with regard to
149network configuration when using this credential provider mechanism, see the
150`Networking`_ section below.
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400151
Matthew Treinish7909e122015-04-15 15:43:50 -0400152Compute
153-------
154
155Flavors
156^^^^^^^
157For tempest to be able to create servers you need to specify flavors that it
158can use to boot the servers with. There are 2 options in the tempest config
159for doing this:
160
161 #. flavor_ref
162 #. flavor_ref_alt
163
164Both of these options are in the compute section of the config file and take
165in the flavor id (not the name) from nova. The *flavor_ref* option is what will
166be used for booting almost all of the guests, *flavor_ref_alt* is only used in
167tests where 2 different sized servers are required. (for example a resize test)
168
169Using a smaller flavor is generally recommended, when larger flavors are used
170the extra time required to bring up servers will likely affect total run time
171and probably require tweaking timeout values to ensure tests have ample time to
172finish.
173
174Images
175^^^^^^
176Just like with flavors, tempest needs to know which images to use for booting
177servers. There are 2 options in the compute section just like with flavors:
178
179 #. image_ref
180 #. image_ref_alt
181
182Both options are expecting an image id (not name) from nova. The *image_ref*
183option is what what will be used for booting the majority of servers in tempest.
184*image_ref_alt* is used for tests that require 2 images such as rebuild. If 2
185images are not available you can set both options to the same image_ref and
186those tests will be skipped.
187
188There are also options in the scenario section for images:
189
190 #. img_file
191 #. img_dir
192 #. aki_img_file
193 #. ari_img_file
194 #. ami_img_file
195 #. img_container_format
196 #. img_disk_format
197
198however unlike the other image options these are used for a very small subset
199of scenario tests which are uploading an image. These options are used to tell
200tempest where an image file is located and describe it's metadata for when it's
201uploaded.
202
203The behavior of these options is a bit convoluted (which will likely be fixed
204in future versions). You first need to specify *img_dir*, which is the directory
205tempest will look for the image files in. First it will check if the filename
206set for *img_file* could be found in *img_dir*. If it is found then the
207*img_container_format* and *img_disk_format* options are used to upload that
208image to glance. However if it's not found tempest will look for the 3 uec image
209file name options as a fallback. If neither is found the tests requiring an
210image to upload will fail.
211
212It is worth pointing out that using `cirros`_ is a very good choice for running
213tempest. It's what is used for upstream testing, they boot quickly and have a
214small footprint.
215
216.. _cirros: https://launchpad.net/cirros
217
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400218Networking
219----------
220OpenStack has a myriad of different networking configurations possible and
221depending on which of the 2 network backends, nova-network or neutron, you are
222using things can vary drastically. Due to this complexity Tempest has to provide
223a certain level of flexibility in it's configuration to ensure it will work
224against any cloud. This ends up causing a large number of permutations in
225Tempest's config around network configuration.
226
227
228Enabling Remote Access to Created Servers
229^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
230When Tempest creates servers for testing, some tests require being able to
231connect those servers. Depending on the configuration of the cloud, the methods
232for doing this can be different. In certain configurations it is required to
233specify a single network with server create calls. Accordingly, Tempest provides
234a few different methods for providing this information in configuration to try
235and ensure that regardless of the clouds configuration it'll still be able to
236run. This section covers the different methods of configuring Tempest to provide
237a network when creating servers.
238
239Fixed Network Name
240""""""""""""""""""
241This is the simplest method of specifying how networks should be used. You can
242just specify a single network name/label to use for all server creations. The
243limitation with this is that all tenants/projects and users must be able to see
244that network name/label if they were to perform a network list and be able to
245use it.
246
247If no network name is assigned in the config file and none of the below
248alternatives are used, then Tempest will not specify a network on server
249creations, which depending on the cloud configuration might prevent them from
250booting.
251
252To set a fixed network name simply do:
253
254 #. Set the fixed_network_name option in the compute group
255
256In the case that the configured fixed network name can not be found by a user
257network list call, it will be treated like one was not provided except that a
258warning will be logged stating that it couldn't be found.
259
260
261Accounts File
262"""""""""""""
263If you are using an accounts file to provide credentials for running Tempest
264then you can leverage it to also specify which network should be used with
265server creations on a per tenant/project and user pair basis. This provides
266the necessary flexibility to work with more intricate networking configurations
267by enabling the user to specify exactly which network to use for which
268tenants/projects. You can refer to the accounts.yaml sample file included in
269the tempest repo for the syntax around specifying networks in the file.
270
271However, specifying a network is not required when using an accounts file. If
272one is not specified you can use a fixed network name to specify the network to
273use when creating servers just as without an accounts file. However, any network
274specified in the accounts file will take precedence over the fixed network name
275provided. If no network is provided in the accounts file and a fixed network
276name is not set then no network will be included in create server requests.
277
278If a fixed network is provided and the accounts.yaml file also contains networks
279this has the benefit of enabling a couple more tests which require a static
280network to perform operations like server lists with a network filter. If a
281fixed network name is not provided these tests are skipped. Additionally, if a
282fixed network name is provided it will serve as a fallback in case of a
283misconfiguration or a missing network in the accounts file.
284
285
286With Tenant Isolation
287"""""""""""""""""""""
288With tenant isolation enabled and using nova-network then nothing changes. Your
289only option for configuration is to either set a fixed network name or not.
290However, in most cases it shouldn't matter because nova-network should have no
291problem booting a server with multiple networks. If this is not the case for
292your cloud then using an accounts file is recommended because it provides the
293necessary flexibility to describe your configuration. Tenant isolation is not
294able to dynamically allocate things as necessary if neutron is not enabled.
295
296With neutron and tenant isolation enabled there should not be any additional
297configuration necessary to enable Tempest to create servers with working
298networking, assuming you have properly configured the network section to work
299for your cloud. Tempest will dynamically create the neutron resources necessary
300to enable using servers with that network. Also, just as with the accounts
301file, if you specify a fixed network name while using neutron and tenant
302isolation it will enable running tests which require a static network and it
303will additionally be used as a fallback for server creation. However, unlike
304accounts.yaml this should never be triggered.
Matthew Treinish3220cad2015-04-15 16:25:48 -0400305
Matthew Treinishf96ab3a2015-04-15 19:11:31 -0400306Configuring Available Services
307------------------------------
308OpenStack is really a constellation of several different projects which
309are running together to create a cloud. However which projects you're running
310is not set in stone, and which services are running is up to the deployer.
311Tempest however needs to know which services are available so it can figure
312out which tests it is able to run and certain setup steps which differ based
313on the available services.
314
315The *service_available* section of the config file is used to set which
316services are available. It contains a boolean option for each service (except
317for keystone which is a hard requirement) set it to True if the service is
318available or False if it is not.
319
320Service Catalog
321^^^^^^^^^^^^^^^
322Each project which has its own REST API contains an entry in the service
323catalog. Like most things in OpenStack this is also completely configurable.
324However, for tempest to be able to figure out the endpoints to send REST API
325calls for each service to it needs to know how that project is defined in the
326service catalog. There are 3 options for each service section to accomplish
327this:
328
329 #. catalog_type
330 #. endpoint_type
331 #. region
332
333Setting *catalog_type* and *endpoint_type* should normally give Tempest enough
334information to determine which endpoint it should pull from the service
335catalog to use for talking to that particular service. However, if you're cloud
336has multiple regions available and you need to specify a particular one to use
337a service you can set the *region* option in that service's section.
338
339It should also be noted that the default values for these options are set
340to what devstack uses. (which is a de facto standard for service catalog
341entries) So often nothing actually needs to be set on these options to enable
342communication to a particular service. It is only if you are either not using
343the same *catalog_type* as devstack or you want Tempest to talk to a different
344endpoint type instead of publicURL for a service that these need to be changed.
345
346
Matthew Treinish3220cad2015-04-15 16:25:48 -0400347Service feature configuration
348-----------------------------
349
350OpenStack provides its deployers a myriad of different configuration options
351to enable anyone deploying it to create a cloud tailor-made for any individual
352use case. It provides options for several different backend type, databases,
353message queues, etc. However, the downside to this configurability is that
354certain operations and features aren't supported depending on the configuration.
355These features may or may not be discoverable from the API so the burden is
356often on the user to figure out what the cloud they're talking to supports.
357Besides the obvious interoperability issues with this it also leaves Tempest
358in an interesting situation trying to figure out which tests are expected to
359work. However, Tempest tests do not rely on dynamic api discovery for a feature
360(assuming one exists). Instead Tempest has to be explicitly configured as to
361which optional features are enabled. This is in order to prevent bugs in the
362discovery mechanisms from masking failures.
363
364The service feature-enabled config sections are how Tempest addresses the
365optional feature question. Each service that has tests for optional features
366contains one of these sections. The only options in it are boolean options
367with the name of a feature which is used. If it is set to false any test which
368depends on that functionality will be skipped. For a complete list of all these
369options refer to the sample config file.
370
371
372API Extensions
373^^^^^^^^^^^^^^
374The service feature-enabled sections often contain an *api-extensions* option
375(or in the case of swift a *discoverable_apis* option) this is used to tell
376tempest which api extensions (or configurable middleware) is used in your
377deployment. It has 2 valid config states, either it contains a single value
378"all" (which is the default) which means that every api extension is assumed
379to be enabled, or it is set to a list of each individual extension that is
380enabled for that service.