Matthew Treinish | a970d65 | 2015-03-11 15:39:24 -0400 | [diff] [blame] | 1 | .. _tempest-configuration: |
| 2 | |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 3 | Tempest Configuration Guide |
| 4 | =========================== |
| 5 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 6 | This guide is a starting point for configuring Tempest. It aims to elaborate |
Matthew Treinish | f640f66 | 2015-03-11 15:13:30 -0400 | [diff] [blame] | 7 | on and explain some of the mandatory and common configuration settings and how |
| 8 | they are used in conjunction. The source of truth on each option is the sample |
Matthew Treinish | f45ba2e | 2015-08-24 15:05:01 -0400 | [diff] [blame] | 9 | config file which explains the purpose of each individual option. You can see |
| 10 | the sample config file here: :ref:`tempest-sampleconf` |
Matthew Treinish | f640f66 | 2015-03-11 15:13:30 -0400 | [diff] [blame] | 11 | |
Andrea Frittoli (andreaf) | dd25070 | 2016-04-29 15:01:22 -0500 | [diff] [blame] | 12 | Test Credentials |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 13 | ---------------- |
| 14 | |
Andrea Frittoli (andreaf) | dd25070 | 2016-04-29 15:01:22 -0500 | [diff] [blame] | 15 | Tempest allows for configuring a set of admin credentials in the ``auth`` |
| 16 | section, via the following parameters: |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 17 | |
Andrea Frittoli (andreaf) | dd25070 | 2016-04-29 15:01:22 -0500 | [diff] [blame] | 18 | #. ``admin_username`` |
| 19 | #. ``admin_password`` |
| 20 | #. ``admin_project_name`` |
| 21 | #. ``admin_domain_name`` |
| 22 | |
| 23 | Admin credentials are not mandatory to run Tempest, but when provided they |
| 24 | can be used to: |
| 25 | |
| 26 | - Run tests for admin APIs |
| 27 | - Generate test credentials on the fly (see `Dynamic Credentials`_) |
| 28 | |
| 29 | Tempest allows for configuring pre-provisioned test credentials as well. |
| 30 | This can be done in two different ways. |
| 31 | |
| 32 | One is to provide credentials is using the accounts.yaml file (see |
| 33 | `Pre-Provisioned Credentials`_). This file is used to specify an arbitrary |
| 34 | number of users available to run tests with. |
| 35 | You can specify the location of the file in the ``auth`` section in the |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 36 | tempest.conf file. To see the specific format used in the file please refer to |
Andrea Frittoli (andreaf) | dd25070 | 2016-04-29 15:01:22 -0500 | [diff] [blame] | 37 | the accounts.yaml.sample file included in Tempest. |
| 38 | |
| 39 | A second way - now deprecated - is a set of configuration options in the |
| 40 | tempest.conf file (see `Legacy Credentials`_). These options are clearly |
| 41 | labelled in the ``identity`` section and let you specify a set of credentials |
| 42 | for a regular user and an alternate user, consisting of a username, password, |
| 43 | project and domain name. |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 44 | |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 45 | Keystone Connection Info |
| 46 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 47 | In order for Tempest to be able to talk to your OpenStack deployment you need |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 48 | to provide it with information about how it communicates with keystone. |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 49 | This involves configuring the following options in the ``identity`` section: |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 50 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 51 | #. ``auth_version`` |
| 52 | #. ``uri`` |
| 53 | #. ``uri_v3`` |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 54 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 55 | The ``auth_version`` option is used to tell Tempest whether it should be using |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 56 | keystone's v2 or v3 api for communicating with keystone. (except for the |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 57 | identity api tests which will test a specific version) The two uri options are |
| 58 | used to tell Tempest the url of the keystone endpoint. The ``uri`` option is |
| 59 | used for keystone v2 request and ``uri_v3`` is used for keystone v3. You want to |
| 60 | ensure that which ever version you set for ``auth_version`` has its uri option |
| 61 | defined. |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 62 | |
| 63 | |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 64 | Credential Provider Mechanisms |
| 65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 66 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 67 | Tempest currently also has three different internal methods for providing |
| 68 | authentication to tests: dynamic credentials, locking test accounts, and |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 69 | non-locking test accounts. Depending on which one is in use the configuration |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 70 | of Tempest is slightly different. |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 71 | |
Andrea Frittoli (andreaf) | 17209bb | 2015-05-22 10:16:57 -0700 | [diff] [blame] | 72 | Dynamic Credentials |
| 73 | """"""""""""""""""" |
| 74 | Dynamic Credentials (formerly known as Tenant isolation) was originally created |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 75 | to enable running Tempest in parallel. For each test class it creates a unique |
| 76 | set of user credentials to use for the tests in the class. It can create up to |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 77 | three sets of username, password, and project names for a primary user, |
| 78 | an admin user, and an alternate user. To enable and use dynamic credentials you |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 79 | only need to configure two things: |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 80 | |
| 81 | #. A set of admin credentials with permissions to create users and |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 82 | projects. This is specified in the ``auth`` section with the |
| 83 | ``admin_username``, ``admin_project_name``, ``admin_domain_name`` and |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 84 | ``admin_password`` options |
| 85 | #. To enable dynamic credentials in the ``auth`` section with the |
| 86 | ``use_dynamic_credentials`` option. |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 87 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 88 | This is also currently the default credential provider enabled by Tempest, due |
| 89 | to its common use and ease of configuration. |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 90 | |
Matthew Treinish | 4fae472 | 2015-04-16 21:03:54 -0400 | [diff] [blame] | 91 | It is worth pointing out that depending on your cloud configuration you might |
Andrea Frittoli (andreaf) | 17209bb | 2015-05-22 10:16:57 -0700 | [diff] [blame] | 92 | need to assign a role to each of the users created by Tempest's dynamic |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 93 | credentials. This can be set using the ``tempest_roles`` option. It takes in a |
| 94 | list of role names each of which will be assigned to each of the users created |
| 95 | by dynamic credentials. This option will not have any effect when Tempest is not |
Andrea Frittoli (andreaf) | 17209bb | 2015-05-22 10:16:57 -0700 | [diff] [blame] | 96 | configured to use dynamic credentials. |
Matthew Treinish | 4fae472 | 2015-04-16 21:03:54 -0400 | [diff] [blame] | 97 | |
| 98 | |
Andrea Frittoli (andreaf) | dd25070 | 2016-04-29 15:01:22 -0500 | [diff] [blame] | 99 | Pre-Provisioned Credentials |
| 100 | """"""""""""""""""""""""""" |
| 101 | |
Andrea Frittoli (andreaf) | 17209bb | 2015-05-22 10:16:57 -0700 | [diff] [blame] | 102 | For a long time using dynamic credentials was the only method available if you |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 103 | wanted to enable parallel execution of Tempest tests. However, this was |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 104 | insufficient for certain use cases because of the admin credentials requirement |
| 105 | to create the credential sets on demand. To get around that the accounts.yaml |
| 106 | file was introduced and with that a new internal credential provider to enable |
| 107 | using the list of credentials instead of creating them on demand. With locking |
| 108 | test accounts each test class will reserve a set of credentials from the |
| 109 | accounts.yaml before executing any of its tests so that each class is isolated |
Andrea Frittoli (andreaf) | 17209bb | 2015-05-22 10:16:57 -0700 | [diff] [blame] | 110 | like with dynamic credentials. |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 111 | |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 112 | To enable and use locking test accounts you need do a few things: |
| 113 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 114 | #. Create an accounts.yaml file which contains the set of pre-existing |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 115 | credentials to use for testing. To make sure you don't have a credentials |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 116 | starvation issue when running in parallel make sure you have at least two |
| 117 | times the number of worker processes you are using to execute Tempest |
| 118 | available in the file. (If running serially the worker count is 1.) |
Matthew Treinish | 0fd69e4 | 2015-03-06 00:40:51 -0500 | [diff] [blame] | 119 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 120 | You can check the accounts.yaml.sample file packaged in Tempest for the yaml |
| 121 | format. |
| 122 | #. Provide Tempest with the location of your accounts.yaml file with the |
| 123 | ``test_accounts_file`` option in the ``auth`` section |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 124 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 125 | *NOTE: Be sure to use a full path for the file; otherwise Tempest will |
Matthew Treinish | 84c6d29 | 2015-12-16 17:50:57 -0500 | [diff] [blame] | 126 | likely not find it.* |
| 127 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 128 | #. Set ``use_dynamic_credentials = False`` in the ``auth`` group |
Fei Long Wang | 7fee787 | 2015-05-12 11:36:49 +1200 | [diff] [blame] | 129 | |
Matthew Treinish | 9329985 | 2015-04-24 09:58:18 -0400 | [diff] [blame] | 130 | It is worth pointing out that each set of credentials in the accounts.yaml |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 131 | should have a unique project. This is required to provide proper isolation |
Matthew Treinish | 9329985 | 2015-04-24 09:58:18 -0400 | [diff] [blame] | 132 | to the tests using the credentials, and failure to do this will likely cause |
| 133 | unexpected failures in some tests. |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 134 | |
Andrea Frittoli (andreaf) | dd25070 | 2016-04-29 15:01:22 -0500 | [diff] [blame] | 135 | Pre-Provisioned Credentials are also know as accounts.yaml or accounts file. |
Matthew Treinish | 9329985 | 2015-04-24 09:58:18 -0400 | [diff] [blame] | 136 | |
Andrea Frittoli (andreaf) | dd25070 | 2016-04-29 15:01:22 -0500 | [diff] [blame] | 137 | Legacy Credentials |
| 138 | """""""""""""""""" |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 139 | **Starting in the Liberty release this mechanism was deprecated; it will be |
| 140 | removed in a future release.** |
Matthew Treinish | 16cf1e5 | 2015-08-11 10:39:23 -0400 | [diff] [blame] | 141 | |
Matthew Treinish | 5709213 | 2015-04-21 14:21:35 -0400 | [diff] [blame] | 142 | When Tempest was refactored to allow for locking test accounts, the original |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 143 | non-project isolated case was converted to internally work similarly to the |
Andrea Frittoli (andreaf) | 290b3e1 | 2015-10-08 10:25:02 +0100 | [diff] [blame] | 144 | accounts.yaml file. This mechanism was then called the legacy test accounts |
| 145 | provider. To use the legacy test accounts provider you can specify the sets of |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 146 | credentials in the configuration file as detailed above with following nine |
| 147 | options in the ``identity`` section: |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 148 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 149 | #. ``username`` |
| 150 | #. ``password`` |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 151 | #. ``project_name`` |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 152 | #. ``alt_username`` |
| 153 | #. ``alt_password`` |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 154 | #. ``alt_project_name`` |
Matthew Treinish | bc1b15b | 2015-02-20 15:56:07 -0500 | [diff] [blame] | 155 | |
John Warren | c276478 | 2016-02-26 14:32:09 -0500 | [diff] [blame] | 156 | If using Identity API v3, use the ``domain_name`` option to specify a |
| 157 | domain other than the default domain. The ``auth_version`` setting is |
| 158 | used to switch between v2 (``v2``) or v3 (``v3``) versions of the Identity |
| 159 | API. |
| 160 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 161 | And in the ``auth`` section: |
Fei Long Wang | 7fee787 | 2015-05-12 11:36:49 +1200 | [diff] [blame] | 162 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 163 | #. ``use_dynamic_credentials = False`` |
| 164 | #. Comment out ``test_accounts_file`` or keep it empty. |
| 165 | |
| 166 | It only makes sense to use this if parallel execution isn't needed, since |
| 167 | Tempest won't be able to properly isolate tests using this. Additionally, using |
| 168 | the traditional config options for credentials is not able to provide |
| 169 | credentials to tests requiring specific roles on accounts. This is because the |
| 170 | config options do not give sufficient flexibility to describe the roles assigned |
| 171 | to a user for running the tests. There are additional limitations with regard to |
| 172 | network configuration when using this credential provider mechanism - see the |
Matthew Treinish | 5709213 | 2015-04-21 14:21:35 -0400 | [diff] [blame] | 173 | `Networking`_ section below. |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 174 | |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 175 | Compute |
| 176 | ------- |
| 177 | |
| 178 | Flavors |
| 179 | ^^^^^^^ |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 180 | For Tempest to be able to create servers you need to specify flavors that it |
| 181 | can use to boot the servers with. There are two options in the Tempest config |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 182 | for doing this: |
| 183 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 184 | #. ``flavor_ref`` |
| 185 | #. ``flavor_ref_alt`` |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 186 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 187 | Both of these options are in the ``compute`` section of the config file and take |
| 188 | in the flavor id (not the name) from nova. The ``flavor_ref`` option is what |
| 189 | will be used for booting almost all of the guests; ``flavor_ref_alt`` is only |
| 190 | used in tests where two different-sized servers are required (for example, a |
| 191 | resize test). |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 192 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 193 | Using a smaller flavor is generally recommended. When larger flavors are used, |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 194 | the extra time required to bring up servers will likely affect total run time |
| 195 | and probably require tweaking timeout values to ensure tests have ample time to |
| 196 | finish. |
| 197 | |
| 198 | Images |
| 199 | ^^^^^^ |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 200 | Just like with flavors, Tempest needs to know which images to use for booting |
| 201 | servers. There are two options in the compute section just like with flavors: |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 202 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 203 | #. ``image_ref`` |
| 204 | #. ``image_ref_alt`` |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 205 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 206 | Both options are expecting an image id (not name) from nova. The ``image_ref`` |
| 207 | option is what will be used for booting the majority of servers in Tempest. |
| 208 | ``image_ref_alt`` is used for tests that require two images such as rebuild. If |
| 209 | two images are not available you can set both options to the same image id and |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 210 | those tests will be skipped. |
| 211 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 212 | There are also options in the ``scenario`` section for images: |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 213 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 214 | #. ``img_file`` |
| 215 | #. ``img_dir`` |
| 216 | #. ``aki_img_file`` |
| 217 | #. ``ari_img_file`` |
| 218 | #. ``ami_img_file`` |
| 219 | #. ``img_container_format`` |
| 220 | #. ``img_disk_format`` |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 221 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 222 | However, unlike the other image options, these are used for a very small subset |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 223 | of scenario tests which are uploading an image. These options are used to tell |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 224 | Tempest where an image file is located and describe its metadata for when it is |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 225 | uploaded. |
| 226 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 227 | The behavior of these options is a bit convoluted (which will likely be fixed in |
| 228 | future versions). You first need to specify ``img_dir``, which is the directory |
| 229 | in which Tempest will look for the image files. First it will check if the |
| 230 | filename set for ``img_file`` could be found in ``img_dir``. If it is found then |
| 231 | the ``img_container_format`` and ``img_disk_format`` options are used to upload |
| 232 | that image to glance. However, if it is not found, Tempest will look for the |
| 233 | three uec image file name options as a fallback. If neither is found, the tests |
| 234 | requiring an image to upload will fail. |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 235 | |
| 236 | It is worth pointing out that using `cirros`_ is a very good choice for running |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 237 | Tempest. It's what is used for upstream testing, they boot quickly and have a |
Matthew Treinish | 7909e12 | 2015-04-15 15:43:50 -0400 | [diff] [blame] | 238 | small footprint. |
| 239 | |
| 240 | .. _cirros: https://launchpad.net/cirros |
| 241 | |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 242 | Networking |
| 243 | ---------- |
| 244 | OpenStack has a myriad of different networking configurations possible and |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 245 | depending on which of the two network backends, nova-network or neutron, you are |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 246 | using things can vary drastically. Due to this complexity Tempest has to provide |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 247 | a certain level of flexibility in its configuration to ensure it will work |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 248 | against any cloud. This ends up causing a large number of permutations in |
| 249 | Tempest's config around network configuration. |
| 250 | |
| 251 | |
| 252 | Enabling Remote Access to Created Servers |
| 253 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 254 | When Tempest creates servers for testing, some tests require being able to |
| 255 | connect those servers. Depending on the configuration of the cloud, the methods |
| 256 | for doing this can be different. In certain configurations it is required to |
| 257 | specify a single network with server create calls. Accordingly, Tempest provides |
| 258 | a few different methods for providing this information in configuration to try |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 259 | and ensure that regardless of the cloud's configuration it'll still be able to |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 260 | run. This section covers the different methods of configuring Tempest to provide |
| 261 | a network when creating servers. |
| 262 | |
lanoux | 63bb903 | 2016-03-21 03:16:18 -0700 | [diff] [blame] | 263 | The ``validation`` group gathers all the connection options to remotely access the |
| 264 | created servers. |
| 265 | |
| 266 | To enable remote access to servers, at least the three following options need to be |
| 267 | set: |
| 268 | |
| 269 | * The ``run_validation`` option needs be set to ``true``. |
| 270 | |
| 271 | * The ``connect_method`` option. Two connect methods are available: ``fixed`` and |
| 272 | ``floating``, the later being set by default. |
| 273 | |
| 274 | * The ``auth_method`` option. Currently, only authentication by keypair is |
| 275 | available. |
| 276 | |
| 277 | |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 278 | Fixed Network Name |
| 279 | """""""""""""""""" |
| 280 | This is the simplest method of specifying how networks should be used. You can |
| 281 | just specify a single network name/label to use for all server creations. The |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 282 | limitation with this is that all projects and users must be able to see |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 283 | that network name/label if they are to perform a network list and be able to use |
| 284 | it. |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 285 | |
| 286 | If no network name is assigned in the config file and none of the below |
| 287 | alternatives are used, then Tempest will not specify a network on server |
| 288 | creations, which depending on the cloud configuration might prevent them from |
| 289 | booting. |
| 290 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 291 | To set a fixed network name simply: |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 292 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 293 | #. Set the ``fixed_network_name`` option in the ``compute`` group |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 294 | |
| 295 | In the case that the configured fixed network name can not be found by a user |
| 296 | network list call, it will be treated like one was not provided except that a |
| 297 | warning will be logged stating that it couldn't be found. |
| 298 | |
| 299 | |
| 300 | Accounts File |
| 301 | """"""""""""" |
| 302 | If you are using an accounts file to provide credentials for running Tempest |
| 303 | then you can leverage it to also specify which network should be used with |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 304 | server creations on a per project and user pair basis. This provides |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 305 | the necessary flexibility to work with more intricate networking configurations |
| 306 | by enabling the user to specify exactly which network to use for which |
Sean Dague | ed6e586 | 2016-04-04 10:49:13 -0400 | [diff] [blame] | 307 | projects. You can refer to the accounts.yaml.sample file included in |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 308 | the Tempest repo for the syntax around specifying networks in the file. |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 309 | |
| 310 | However, specifying a network is not required when using an accounts file. If |
| 311 | one is not specified you can use a fixed network name to specify the network to |
| 312 | use when creating servers just as without an accounts file. However, any network |
| 313 | specified in the accounts file will take precedence over the fixed network name |
| 314 | provided. If no network is provided in the accounts file and a fixed network |
| 315 | name is not set then no network will be included in create server requests. |
| 316 | |
| 317 | If a fixed network is provided and the accounts.yaml file also contains networks |
| 318 | this has the benefit of enabling a couple more tests which require a static |
| 319 | network to perform operations like server lists with a network filter. If a |
| 320 | fixed network name is not provided these tests are skipped. Additionally, if a |
| 321 | fixed network name is provided it will serve as a fallback in case of a |
| 322 | misconfiguration or a missing network in the accounts file. |
| 323 | |
| 324 | |
Andrea Frittoli (andreaf) | 17209bb | 2015-05-22 10:16:57 -0700 | [diff] [blame] | 325 | With Dynamic Credentials |
| 326 | """""""""""""""""""""""" |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 327 | With dynamic credentials enabled and using nova-network, your only option for |
lanoux | 63bb903 | 2016-03-21 03:16:18 -0700 | [diff] [blame] | 328 | configuration is to either set a fixed network name or not. However, in most |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 329 | cases it shouldn't matter because nova-network should have no problem booting a |
| 330 | server with multiple networks. If this is not the case for your cloud then using |
| 331 | an accounts file is recommended because it provides the necessary flexibility to |
| 332 | describe your configuration. Dynamic credentials is not able to dynamically |
| 333 | allocate things as necessary if neutron is not enabled. |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 334 | |
Andrea Frittoli (andreaf) | 17209bb | 2015-05-22 10:16:57 -0700 | [diff] [blame] | 335 | With neutron and dynamic credentials enabled there should not be any additional |
Matthew Treinish | 2b7f048 | 2015-04-10 12:49:01 -0400 | [diff] [blame] | 336 | configuration necessary to enable Tempest to create servers with working |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 337 | networking, assuming you have properly configured the ``network`` section to |
| 338 | work for your cloud. Tempest will dynamically create the neutron resources |
| 339 | necessary to enable using servers with that network. Also, just as with the |
| 340 | accounts file, if you specify a fixed network name while using neutron and |
| 341 | dynamic credentials it will enable running tests which require a static network |
| 342 | and it will additionally be used as a fallback for server creation. However, |
| 343 | unlike accounts.yaml this should never be triggered. |
Matthew Treinish | 3220cad | 2015-04-15 16:25:48 -0400 | [diff] [blame] | 344 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 345 | However, there is an option ``create_isolated_networks`` to disable dynamic |
| 346 | credentials's automatic provisioning of network resources. If this option is set |
| 347 | to False you will have to either rely on there only being a single/default |
| 348 | network available for the server creation, or use ``fixed_network_name`` to |
| 349 | inform Tempest which network to use. |
Matthew Treinish | 2219d38 | 2015-04-24 10:33:04 -0400 | [diff] [blame] | 350 | |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 351 | Configuring Available Services |
| 352 | ------------------------------ |
| 353 | OpenStack is really a constellation of several different projects which |
| 354 | are running together to create a cloud. However which projects you're running |
| 355 | is not set in stone, and which services are running is up to the deployer. |
| 356 | Tempest however needs to know which services are available so it can figure |
| 357 | out which tests it is able to run and certain setup steps which differ based |
| 358 | on the available services. |
| 359 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 360 | The ``service_available`` section of the config file is used to set which |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 361 | services are available. It contains a boolean option for each service (except |
| 362 | for keystone which is a hard requirement) set it to True if the service is |
| 363 | available or False if it is not. |
| 364 | |
| 365 | Service Catalog |
| 366 | ^^^^^^^^^^^^^^^ |
| 367 | Each project which has its own REST API contains an entry in the service |
| 368 | catalog. Like most things in OpenStack this is also completely configurable. |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 369 | However, for Tempest to be able to figure out which endpoints should get REST |
| 370 | API calls for each service, it needs to know how that project is defined in the |
| 371 | service catalog. There are three options for each service section to accomplish |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 372 | this: |
| 373 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 374 | #. ``catalog_type`` |
| 375 | #. ``endpoint_type`` |
| 376 | #. ``region`` |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 377 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 378 | Setting ``catalog_type`` and ``endpoint_type`` should normally give Tempest |
| 379 | enough information to determine which endpoint it should pull from the service |
| 380 | catalog to use for talking to that particular service. However, if your cloud |
| 381 | has multiple regions available and you need to specify a particular one to use a |
| 382 | service you can set the ``region`` option in that service's section. |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 383 | |
| 384 | It should also be noted that the default values for these options are set |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 385 | to what devstack uses (which is a de facto standard for service catalog |
| 386 | entries). So often nothing actually needs to be set on these options to enable |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 387 | communication to a particular service. It is only if you are either not using |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 388 | the same ``catalog_type`` as devstack or you want Tempest to talk to a different |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 389 | endpoint type instead of publicURL for a service that these need to be changed. |
| 390 | |
ghanshyam | 571dfac | 2015-10-30 11:21:28 +0900 | [diff] [blame] | 391 | .. note:: |
| 392 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 393 | Tempest does not serve all kinds of fancy URLs in the service catalog. The |
| 394 | service catalog should be in a standard format (which is going to be |
| 395 | standardized at the keystone level). |
| 396 | Tempest expects URLs in the Service catalog in the following format: |
| 397 | * ``http://example.com:1234/<version-info>`` |
ghanshyam | 571dfac | 2015-10-30 11:21:28 +0900 | [diff] [blame] | 398 | Examples: |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 399 | * Good - ``http://example.com:1234/v2.0`` |
| 400 | * Wouldn’t work - ``http://example.com:1234/xyz/v2.0/`` |
ghanshyam | 571dfac | 2015-10-30 11:21:28 +0900 | [diff] [blame] | 401 | (adding prefix/suffix around version etc) |
Matthew Treinish | f96ab3a | 2015-04-15 19:11:31 -0400 | [diff] [blame] | 402 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 403 | Service Feature Configuration |
Matthew Treinish | 3220cad | 2015-04-15 16:25:48 -0400 | [diff] [blame] | 404 | ----------------------------- |
| 405 | |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 406 | OpenStack provides its deployers a myriad of different configuration options to |
| 407 | enable anyone deploying it to create a cloud tailor-made for any individual use |
| 408 | case. It provides options for several different backend types, databases, |
Matthew Treinish | 3220cad | 2015-04-15 16:25:48 -0400 | [diff] [blame] | 409 | message queues, etc. However, the downside to this configurability is that |
| 410 | certain operations and features aren't supported depending on the configuration. |
| 411 | These features may or may not be discoverable from the API so the burden is |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 412 | often on the user to figure out what is supported by the cloud they're talking |
| 413 | to. Besides the obvious interoperability issues with this it also leaves |
| 414 | Tempest in an interesting situation trying to figure out which tests are |
| 415 | expected to work. However, Tempest tests do not rely on dynamic API discovery |
| 416 | for a feature (assuming one exists). Instead Tempest has to be explicitly |
| 417 | configured as to which optional features are enabled. This is in order to |
| 418 | prevent bugs in the discovery mechanisms from masking failures. |
Matthew Treinish | 3220cad | 2015-04-15 16:25:48 -0400 | [diff] [blame] | 419 | |
| 420 | The service feature-enabled config sections are how Tempest addresses the |
| 421 | optional feature question. Each service that has tests for optional features |
| 422 | contains one of these sections. The only options in it are boolean options |
| 423 | with the name of a feature which is used. If it is set to false any test which |
| 424 | depends on that functionality will be skipped. For a complete list of all these |
| 425 | options refer to the sample config file. |
| 426 | |
| 427 | |
| 428 | API Extensions |
| 429 | ^^^^^^^^^^^^^^ |
Eric Fried | e0cfc3e | 2015-12-14 16:10:49 -0600 | [diff] [blame] | 430 | The service feature-enabled sections often contain an ``api-extensions`` option |
| 431 | (or in the case of swift a ``discoverable_apis`` option). This is used to tell |
| 432 | Tempest which api extensions (or configurable middleware) is used in your |
| 433 | deployment. It has two valid config states: either it contains a single value |
| 434 | ``all`` (which is the default) which means that every api extension is assumed |
Matthew Treinish | 3220cad | 2015-04-15 16:25:48 -0400 | [diff] [blame] | 435 | to be enabled, or it is set to a list of each individual extension that is |
| 436 | enabled for that service. |