blob: dad235cae5e0cdec4cb72420a80b9d588f572536 [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
43Credential Provider Mechanisms
44^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45
46Tempest currently also has 3 different internal methods for providing
47authentication to tests. Tenant isolation, locking test accounts, and
48non-locking test accounts. Depending on which one is in use the configuration
49of tempest is slightly different.
50
51Tenant Isolation
52""""""""""""""""
53Tenant isolation was originally create to enable running tempest in parallel.
54For each test class it creates a unique set of user credentials to use for the
55tests in the class. It can create up to 3 sets of username, password, and
56tenant/project names for a primary user, an admin user, and an alternate user.
57To enable and use tenant isolation you only need to configure 2 things:
58
59 #. A set of admin credentials with permissions to create users and
60 tenants/projects. This is specified in the identity section with the
61 admin_username, admin_tenant_name, and admin_password options
62 #. To enable tenant_isolation in the auth section with the
63 allow_tenant_isolation option.
64
Matthew Treinish0fd69e42015-03-06 00:40:51 -050065This is also the currently the default credential provider enabled by tempest,
66due to it's common use and ease of configuration.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050067
68Locking Test Accounts
69"""""""""""""""""""""
70For a long time using tenant isolation was the only method available if you
71wanted to enable parallel execution of tempest tests. However this was
72insufficient for certain use cases because of the admin credentials requirement
73to create the credential sets on demand. To get around that the accounts.yaml
74file was introduced and with that a new internal credential provider to enable
75using the list of credentials instead of creating them on demand. With locking
76test accounts each test class will reserve a set of credentials from the
77accounts.yaml before executing any of its tests so that each class is isolated
78like in tenant isolation.
79
Matthew Treinish0fd69e42015-03-06 00:40:51 -050080Currently, this mechanism has some limitations, mostly around networking. The
81locking test accounts provider will only work with a single flat network as
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050082the default for each tenant/project. If another network configuration is used
83in your cloud you might face unexpected failures.
84
85To enable and use locking test accounts you need do a few things:
86
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050087 #. Create a accounts.yaml file which contains the set of pre-existing
88 credentials to use for testing. To make sure you don't have a credentials
89 starvation issue when running in parallel make sure you have at least 2
Matthew Treinishfc7cd8f2015-03-30 11:51:55 -040090 times the number of worker processes you are using to execute tempest
91 available in the file. (if running serially the worker count is 1)
Matthew Treinish0fd69e42015-03-06 00:40:51 -050092
93 You can check the sample file packaged in tempest for the yaml format
Matthew Treinishbc1b15b2015-02-20 15:56:07 -050094 #. Provide tempest with the location of you accounts.yaml file with the
95 test_accounts_file option in the auth section
96
97
98Non-locking test accounts
99"""""""""""""""""""""""""
100When tempest was refactored to allow for locking test accounts, the original
101non-tenant isolated case was converted to support the new accounts.yaml file.
102This mechanism is the non-locking test accounts provider. It only makes sense
103to use it if parallel execution isn't needed. If the role restrictions were too
104limiting with the locking accounts provider and tenant isolation is not wanted
105then you can use the non-locking test accounts credential provider without the
Matthew Treinish0fd69e42015-03-06 00:40:51 -0500106accounts.yaml file.
Matthew Treinishbc1b15b2015-02-20 15:56:07 -0500107
108To use the non-locking test accounts provider you have 2 ways to configure it.
109First you can specify the sets of credentials in the configuration file like
110detailed above with following 9 options in the identity section:
111
112 #. username
113 #. password
114 #. tenant_name
115 #. admin_username
116 #. admin_password
117 #. admin_tenant_name
118 #. alt_username
119 #. alt_password
120 #. alt_tenant_name
121
Matthew Treinish0fd69e42015-03-06 00:40:51 -0500122The only restriction with using the traditional config options for credentials
123is that if a test requires specific roles on accounts these tests can not be
124run. This is because the config options do not give sufficient flexibility to
125describe the roles assigned to a user for running the tests.
Matthew Treinish2b7f0482015-04-10 12:49:01 -0400126
127Networking
128----------
129OpenStack has a myriad of different networking configurations possible and
130depending on which of the 2 network backends, nova-network or neutron, you are
131using things can vary drastically. Due to this complexity Tempest has to provide
132a certain level of flexibility in it's configuration to ensure it will work
133against any cloud. This ends up causing a large number of permutations in
134Tempest's config around network configuration.
135
136
137Enabling Remote Access to Created Servers
138^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139When Tempest creates servers for testing, some tests require being able to
140connect those servers. Depending on the configuration of the cloud, the methods
141for doing this can be different. In certain configurations it is required to
142specify a single network with server create calls. Accordingly, Tempest provides
143a few different methods for providing this information in configuration to try
144and ensure that regardless of the clouds configuration it'll still be able to
145run. This section covers the different methods of configuring Tempest to provide
146a network when creating servers.
147
148Fixed Network Name
149""""""""""""""""""
150This is the simplest method of specifying how networks should be used. You can
151just specify a single network name/label to use for all server creations. The
152limitation with this is that all tenants/projects and users must be able to see
153that network name/label if they were to perform a network list and be able to
154use it.
155
156If no network name is assigned in the config file and none of the below
157alternatives are used, then Tempest will not specify a network on server
158creations, which depending on the cloud configuration might prevent them from
159booting.
160
161To set a fixed network name simply do:
162
163 #. Set the fixed_network_name option in the compute group
164
165In the case that the configured fixed network name can not be found by a user
166network list call, it will be treated like one was not provided except that a
167warning will be logged stating that it couldn't be found.
168
169
170Accounts File
171"""""""""""""
172If you are using an accounts file to provide credentials for running Tempest
173then you can leverage it to also specify which network should be used with
174server creations on a per tenant/project and user pair basis. This provides
175the necessary flexibility to work with more intricate networking configurations
176by enabling the user to specify exactly which network to use for which
177tenants/projects. You can refer to the accounts.yaml sample file included in
178the tempest repo for the syntax around specifying networks in the file.
179
180However, specifying a network is not required when using an accounts file. If
181one is not specified you can use a fixed network name to specify the network to
182use when creating servers just as without an accounts file. However, any network
183specified in the accounts file will take precedence over the fixed network name
184provided. If no network is provided in the accounts file and a fixed network
185name is not set then no network will be included in create server requests.
186
187If a fixed network is provided and the accounts.yaml file also contains networks
188this has the benefit of enabling a couple more tests which require a static
189network to perform operations like server lists with a network filter. If a
190fixed network name is not provided these tests are skipped. Additionally, if a
191fixed network name is provided it will serve as a fallback in case of a
192misconfiguration or a missing network in the accounts file.
193
194
195With Tenant Isolation
196"""""""""""""""""""""
197With tenant isolation enabled and using nova-network then nothing changes. Your
198only option for configuration is to either set a fixed network name or not.
199However, in most cases it shouldn't matter because nova-network should have no
200problem booting a server with multiple networks. If this is not the case for
201your cloud then using an accounts file is recommended because it provides the
202necessary flexibility to describe your configuration. Tenant isolation is not
203able to dynamically allocate things as necessary if neutron is not enabled.
204
205With neutron and tenant isolation enabled there should not be any additional
206configuration necessary to enable Tempest to create servers with working
207networking, assuming you have properly configured the network section to work
208for your cloud. Tempest will dynamically create the neutron resources necessary
209to enable using servers with that network. Also, just as with the accounts
210file, if you specify a fixed network name while using neutron and tenant
211isolation it will enable running tests which require a static network and it
212will additionally be used as a fallback for server creation. However, unlike
213accounts.yaml this should never be triggered.