Flavio Percoco | 3d2dac7 | 2016-11-24 13:06:32 +0100 | [diff] [blame] | 1 | ======================== |
| 2 | Team and repository tags |
| 3 | ======================== |
| 4 | |
davyyy | ac670dc | 2017-11-16 21:27:03 +0800 | [diff] [blame] | 5 | .. image:: https://governance.openstack.org/badges/tempest.svg |
junboli | 477fd02 | 2017-09-06 17:25:11 +0800 | [diff] [blame] | 6 | :target: https://governance.openstack.org/tc/reference/tags/index.html |
Flavio Percoco | 3d2dac7 | 2016-11-24 13:06:32 +0100 | [diff] [blame] | 7 | |
| 8 | .. Change things from this point on |
| 9 | |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 10 | Tempest - The OpenStack Integration Test Suite |
| 11 | ============================================== |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 12 | |
Matthew Treinish | dced423 | 2016-07-05 11:20:12 -0400 | [diff] [blame] | 13 | The documentation for Tempest is officially hosted at: |
chenxing | e98720a | 2017-07-19 03:42:23 +0000 | [diff] [blame] | 14 | https://docs.openstack.org/tempest/latest/ |
Masayuki Igawa | b5d3293 | 2016-03-25 12:46:43 +0900 | [diff] [blame] | 15 | |
Sean Dague | b56052b | 2013-05-21 17:57:41 -0400 | [diff] [blame] | 16 | This is a set of integration tests to be run against a live OpenStack |
| 17 | cluster. Tempest has batteries of tests for OpenStack API validation, |
| 18 | Scenarios, and other specific tests useful in validating an OpenStack |
| 19 | deployment. |
| 20 | |
Sean Dague | a26454d | 2013-11-01 18:09:55 -0400 | [diff] [blame] | 21 | Design Principles |
Matthew Treinish | 077a563 | 2014-06-04 11:43:10 -0400 | [diff] [blame] | 22 | ----------------- |
Sean Dague | a26454d | 2013-11-01 18:09:55 -0400 | [diff] [blame] | 23 | Tempest Design Principles that we strive to live by. |
| 24 | |
| 25 | - Tempest should be able to run against any OpenStack cloud, be it a |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 26 | one node DevStack install, a 20 node LXC cloud, or a 1000 node KVM |
Sean Dague | a26454d | 2013-11-01 18:09:55 -0400 | [diff] [blame] | 27 | cloud. |
| 28 | - Tempest should be explicit in testing features. It is easy to auto |
| 29 | discover features of a cloud incorrectly, and give people an |
| 30 | incorrect assessment of their cloud. Explicit is always better. |
| 31 | - Tempest uses OpenStack public interfaces. Tests in Tempest should |
Ken'ichi Ohmichi | b824990 | 2016-06-01 17:11:04 -0700 | [diff] [blame] | 32 | only touch public OpenStack APIs. |
Sean Dague | a26454d | 2013-11-01 18:09:55 -0400 | [diff] [blame] | 33 | - Tempest should not touch private or implementation specific |
| 34 | interfaces. This means not directly going to the database, not |
| 35 | directly hitting the hypervisors, not testing extensions not |
OctopusZhang | 03b8900 | 2015-11-05 11:24:14 +0800 | [diff] [blame] | 36 | included in the OpenStack base. If there are some features of |
| 37 | OpenStack that are not verifiable through standard interfaces, this |
Sean Dague | a26454d | 2013-11-01 18:09:55 -0400 | [diff] [blame] | 38 | should be considered a possible enhancement. |
| 39 | - Tempest strives for complete coverage of the OpenStack API and |
| 40 | common scenarios that demonstrate a working cloud. |
| 41 | - Tempest drives load in an OpenStack cloud. By including a broad |
| 42 | array of API and scenario tests Tempest can be reused in whole or in |
| 43 | parts as load generation for an OpenStack cloud. |
| 44 | - Tempest should attempt to clean up after itself, whenever possible |
| 45 | we should tear down resources when done. |
zhangfeng | c53e4e1 | 2015-08-21 04:09:08 +0000 | [diff] [blame] | 46 | - Tempest should be self-testing. |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 47 | |
| 48 | Quickstart |
| 49 | ---------- |
| 50 | |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 51 | To run Tempest, you first need to create a configuration file that will tell |
| 52 | Tempest where to find the various OpenStack services and other testing behavior |
| 53 | switches. Where the configuration file lives and how you interact with it |
| 54 | depends on how you'll be running Tempest. There are 2 methods of using Tempest. |
| 55 | The first, which is a newer and recommended workflow treats Tempest as a system |
| 56 | installed program. The second older method is to run Tempest assuming your |
| 57 | working dir is the actually Tempest source repo, and there are a number of |
| 58 | assumptions related to that. For this section we'll only cover the newer method |
| 59 | as it is simpler, and quicker to work with. |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 60 | |
OctopusZhang | 03b8900 | 2015-11-05 11:24:14 +0800 | [diff] [blame] | 61 | #. You first need to install Tempest. This is done with pip after you check out |
| 62 | the Tempest repo:: |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 63 | |
davyyy | ac670dc | 2017-11-16 21:27:03 +0800 | [diff] [blame] | 64 | $ git clone https://git.openstack.org/openstack/tempest |
OctopusZhang | 03b8900 | 2015-11-05 11:24:14 +0800 | [diff] [blame] | 65 | $ pip install tempest/ |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 66 | |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 67 | This can be done within a venv, but the assumption for this guide is that |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 68 | the Tempest CLI entry point will be in your shell's PATH. |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 69 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 70 | #. Installing Tempest may create a ``/etc/tempest dir``, however if one isn't |
| 71 | created you can create one or use ``~/.tempest/etc`` or ``~/.config/tempest`` in |
| 72 | place of ``/etc/tempest``. If none of these dirs are created Tempest will create |
| 73 | ``~/.tempest/etc`` when it's needed. The contents of this dir will always |
| 74 | automatically be copied to all ``etc/`` dirs in local workspaces as an initial |
Matthew Treinish | 531b01c | 2016-07-05 10:22:52 -0400 | [diff] [blame] | 75 | setup step. So if there is any common configuration you'd like to be shared |
| 76 | between local Tempest workspaces it's recommended that you pre-populate it |
| 77 | before running ``tempest init``. |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 78 | |
Matthew Treinish | ab77cbf | 2016-07-01 13:55:05 -0400 | [diff] [blame] | 79 | #. Setup a local Tempest workspace. This is done by using the tempest init |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 80 | command:: |
Jay Pipes | 7f75763 | 2011-12-02 15:53:32 -0500 | [diff] [blame] | 81 | |
Ken'ichi Ohmichi | 9883ff2 | 2016-04-22 18:24:15 -0700 | [diff] [blame] | 82 | $ tempest init cloud-01 |
Matthew Treinish | a970d65 | 2015-03-11 15:39:24 -0400 | [diff] [blame] | 83 | |
Matthew Treinish | ab77cbf | 2016-07-01 13:55:05 -0400 | [diff] [blame] | 84 | which also works the same as:: |
Attila Fazekas | 58d2330 | 2013-07-24 10:25:02 +0200 | [diff] [blame] | 85 | |
Ken'ichi Ohmichi | 9883ff2 | 2016-04-22 18:24:15 -0700 | [diff] [blame] | 86 | $ mkdir cloud-01 && cd cloud-01 && tempest init |
Daryl Walleck | e36f623 | 2012-03-06 00:21:45 -0600 | [diff] [blame] | 87 | |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 88 | This will create a new directory for running a single Tempest configuration. |
| 89 | If you'd like to run Tempest against multiple OpenStack deployments the idea |
| 90 | is that you'll create a new working directory for each to maintain separate |
| 91 | configuration files and local artifact storage for each. |
Attila Fazekas | 58d2330 | 2013-07-24 10:25:02 +0200 | [diff] [blame] | 92 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 93 | #. Then ``cd`` into the newly created working dir and also modify the local |
| 94 | config files located in the ``etc/`` subdir created by the ``tempest init`` |
| 95 | command. Tempest is expecting a ``tempest.conf`` file in etc/ so if only a |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 96 | sample exists you must rename or copy it to tempest.conf before making |
Matthew Treinish | dced423 | 2016-07-05 11:20:12 -0400 | [diff] [blame] | 97 | any changes to it otherwise Tempest will not know how to load it. For |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 98 | details on configuring Tempest refer to the :ref:`tempest-configuration`. |
Matthew Treinish | a970d65 | 2015-03-11 15:39:24 -0400 | [diff] [blame] | 99 | |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 100 | #. Once the configuration is done you're now ready to run Tempest. This can |
Matthew Treinish | 85c8e3e | 2016-06-30 19:28:04 -0400 | [diff] [blame] | 101 | be done using the :ref:`tempest_run` command. This can be done by either |
Matthew Treinish | ab77cbf | 2016-07-01 13:55:05 -0400 | [diff] [blame] | 102 | running:: |
Matthew Treinish | 85c8e3e | 2016-06-30 19:28:04 -0400 | [diff] [blame] | 103 | |
Yushiro FURUKAWA | e4b18ad | 2016-09-27 16:52:47 +0900 | [diff] [blame] | 104 | $ tempest run |
Matthew Treinish | 85c8e3e | 2016-06-30 19:28:04 -0400 | [diff] [blame] | 105 | |
Matthew Treinish | ab77cbf | 2016-07-01 13:55:05 -0400 | [diff] [blame] | 106 | from the Tempest workspace directory. Or you can use the ``--workspace`` |
zhufl | 5eccdf4 | 2017-03-16 10:08:18 +0800 | [diff] [blame] | 107 | argument to run in the workspace you created regardless of your current |
Matthew Treinish | ab77cbf | 2016-07-01 13:55:05 -0400 | [diff] [blame] | 108 | working directory. For example:: |
Matthew Treinish | 85c8e3e | 2016-06-30 19:28:04 -0400 | [diff] [blame] | 109 | |
Yushiro FURUKAWA | e4b18ad | 2016-09-27 16:52:47 +0900 | [diff] [blame] | 110 | $ tempest run --workspace cloud-01 |
Matthew Treinish | 85c8e3e | 2016-06-30 19:28:04 -0400 | [diff] [blame] | 111 | |
| 112 | There is also the option to use testr directly, or any `testr`_ based test |
Matthew Treinish | ab77cbf | 2016-07-01 13:55:05 -0400 | [diff] [blame] | 113 | runner, like `ostestr`_. For example, from the workspace dir run:: |
Matthew Treinish | b17460e | 2013-09-17 17:04:03 +0000 | [diff] [blame] | 114 | |
Yushiro FURUKAWA | e4b18ad | 2016-09-27 16:52:47 +0900 | [diff] [blame] | 115 | $ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario))' |
Matthew Treinish | a970d65 | 2015-03-11 15:39:24 -0400 | [diff] [blame] | 116 | |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 117 | will run the same set of tests as the default gate jobs. |
Matthew Treinish | a970d65 | 2015-03-11 15:39:24 -0400 | [diff] [blame] | 118 | |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 119 | .. _testr: https://testrepository.readthedocs.org/en/latest/MANUAL.html |
chenxing | e98720a | 2017-07-19 03:42:23 +0000 | [diff] [blame] | 120 | .. _ostestr: https://docs.openstack.org/os-testr/latest/ |
nayna-patel | ddb489c | 2012-11-13 22:06:45 +0000 | [diff] [blame] | 121 | |
Matthew Treinish | 55511d9 | 2016-02-23 10:55:53 -0500 | [diff] [blame] | 122 | Library |
| 123 | ------- |
| 124 | Tempest exposes a library interface. This interface is a stable interface and |
| 125 | should be backwards compatible (including backwards compatibility with the |
| 126 | old tempest-lib package, with the exception of the import). If you plan to |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 127 | directly consume Tempest in your project you should only import code from the |
| 128 | Tempest library interface, other pieces of Tempest do not have the same |
Matthew Treinish | 55511d9 | 2016-02-23 10:55:53 -0500 | [diff] [blame] | 129 | stable interface and there are no guarantees on the Python API unless otherwise |
| 130 | stated. |
| 131 | |
| 132 | For more details refer to the library documentation here: :ref:`library` |
| 133 | |
| 134 | Release Versioning |
| 135 | ------------------ |
davyyy | ac670dc | 2017-11-16 21:27:03 +0800 | [diff] [blame] | 136 | `Tempest Release Notes <https://docs.openstack.org/releasenotes/tempest>`_ |
Ken'ichi Ohmichi | 7f5e1d7 | 2016-08-29 12:01:44 -0700 | [diff] [blame] | 137 | shows what changes have been released on each version. |
| 138 | |
Matthew Treinish | 55511d9 | 2016-02-23 10:55:53 -0500 | [diff] [blame] | 139 | Tempest's released versions are broken into 2 sets of information. Depending on |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 140 | how you intend to consume Tempest you might need |
Matthew Treinish | 55511d9 | 2016-02-23 10:55:53 -0500 | [diff] [blame] | 141 | |
| 142 | The version is a set of 3 numbers: |
| 143 | |
| 144 | X.Y.Z |
| 145 | |
| 146 | While this is almost `semver`_ like, the way versioning is handled is slightly |
| 147 | different: |
| 148 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 149 | X is used to represent the supported OpenStack releases for Tempest tests |
| 150 | in-tree, and to signify major feature changes to Tempest. It's a monotonically |
Matthew Treinish | 55511d9 | 2016-02-23 10:55:53 -0500 | [diff] [blame] | 151 | increasing integer where each version either indicates a new supported OpenStack |
| 152 | release, the drop of support for an OpenStack release (which will coincide with |
| 153 | the upstream stable branch going EOL), or a major feature lands (or is removed) |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 154 | from Tempest. |
Matthew Treinish | 55511d9 | 2016-02-23 10:55:53 -0500 | [diff] [blame] | 155 | |
| 156 | Y.Z is used to represent library interface changes. This is treated the same |
| 157 | way as minor and patch versions from `semver`_ but only for the library |
| 158 | interface. When Y is incremented we've added functionality to the library |
| 159 | interface and when Z is incremented it's a bug fix release for the library. |
| 160 | Also note that both Y and Z are reset to 0 at each increment of X. |
| 161 | |
| 162 | .. _semver: http://semver.org/ |
| 163 | |
Daryl Walleck | e36f623 | 2012-03-06 00:21:45 -0600 | [diff] [blame] | 164 | Configuration |
| 165 | ------------- |
| 166 | |
Joe H. Rahme | 00a7542 | 2015-03-16 17:46:24 +0100 | [diff] [blame] | 167 | Detailed configuration of Tempest is beyond the scope of this |
Matthew Treinish | a970d65 | 2015-03-11 15:39:24 -0400 | [diff] [blame] | 168 | document see :ref:`tempest-configuration` for more details on configuring |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 169 | Tempest. The ``etc/tempest.conf.sample`` attempts to be a self-documenting |
| 170 | version of the configuration. |
Sean Dague | b56052b | 2013-05-21 17:57:41 -0400 | [diff] [blame] | 171 | |
Matthew Treinish | a970d65 | 2015-03-11 15:39:24 -0400 | [diff] [blame] | 172 | You can generate a new sample tempest.conf file, run the following |
Yushiro FURUKAWA | e4b18ad | 2016-09-27 16:52:47 +0900 | [diff] [blame] | 173 | command from the top level of the Tempest directory:: |
Masayuki Igawa | ac401c7 | 2014-11-18 15:28:46 +0900 | [diff] [blame] | 174 | |
Hai Shi | 6f52fc5 | 2017-04-03 21:17:37 +0800 | [diff] [blame] | 175 | $ tox -e genconfig |
Matthew Treinish | 6eb0585 | 2013-11-26 15:28:12 +0000 | [diff] [blame] | 176 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 177 | The most important pieces that are needed are the user ids, OpenStack |
| 178 | endpoints, and basic flavors and images needed to run tests. |
Matthew Treinish | a7c7f9f | 2014-01-13 18:20:50 +0000 | [diff] [blame] | 179 | |
| 180 | Unit Tests |
| 181 | ---------- |
| 182 | |
Joe H. Rahme | 00a7542 | 2015-03-16 17:46:24 +0100 | [diff] [blame] | 183 | Tempest also has a set of unit tests which test the Tempest code itself. These |
Atsushi SAKAI | 0a183b8 | 2015-07-28 21:52:17 +0900 | [diff] [blame] | 184 | tests can be run by specifying the test discovery path:: |
Matthew Treinish | a7c7f9f | 2014-01-13 18:20:50 +0000 | [diff] [blame] | 185 | |
Masayuki Igawa | ebe4698 | 2017-09-14 16:38:40 -0600 | [diff] [blame] | 186 | $ stestr --test-path ./tempest/tests run |
Matthew Treinish | a7c7f9f | 2014-01-13 18:20:50 +0000 | [diff] [blame] | 187 | |
Masayuki Igawa | ebe4698 | 2017-09-14 16:38:40 -0600 | [diff] [blame] | 188 | By setting ``--test-path`` option to ./tempest/tests it specifies that test discover |
| 189 | should only be run on the unit test directory. The default value of ``test_path`` |
| 190 | is ``test_path=./tempest/test_discover`` which will only run test discover on the |
Joe H. Rahme | 00a7542 | 2015-03-16 17:46:24 +0100 | [diff] [blame] | 191 | Tempest suite. |
Matthew Treinish | a7c7f9f | 2014-01-13 18:20:50 +0000 | [diff] [blame] | 192 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 193 | Alternatively, there are the py27 and py35 tox jobs which will run the unit |
Masayuki Igawa | afb1143 | 2016-06-02 16:09:50 +0900 | [diff] [blame] | 194 | tests with the corresponding version of python. |
Matthew Treinish | af37dc9 | 2014-02-13 14:35:38 -0500 | [diff] [blame] | 195 | |
junboli | 9e25a57 | 2017-11-22 14:42:30 +0800 | [diff] [blame] | 196 | One common activity is to just run a single test, you can do this with tox |
| 197 | simply by specifying to just run py27 or py35 tests against a single test:: |
| 198 | |
| 199 | $ tox -e py27 -- -n tempest.tests.test_microversions.TestMicroversionsTestsClass.test_config_version_none_23 |
| 200 | |
| 201 | Or all tests in the test_microversions.py file:: |
| 202 | |
| 203 | $ tox -e py27 -- -n tempest.tests.test_microversions |
| 204 | |
| 205 | You may also use regular expressions to run any matching tests:: |
| 206 | |
| 207 | $ tox -e py27 -- test_microversions |
| 208 | |
| 209 | Additionally, when running a single test, or test-file, the ``-n/--no-discover`` |
| 210 | argument is no longer required, however it may perform faster if included. |
| 211 | |
| 212 | For more information on these options and details about stestr, please see the |
| 213 | `stestr documentation <http://stestr.readthedocs.io/en/latest/MANUAL.html>`_. |
| 214 | |
Matthew Treinish | af37dc9 | 2014-02-13 14:35:38 -0500 | [diff] [blame] | 215 | Python 2.6 |
| 216 | ---------- |
| 217 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 218 | Starting in the Kilo release the OpenStack services dropped all support for |
Joe H. Rahme | 00a7542 | 2015-03-16 17:46:24 +0100 | [diff] [blame] | 219 | python 2.6. This change has been mirrored in Tempest, starting after the |
| 220 | tempest-2 tag. This means that proposed changes to Tempest which only fix |
Matthew Treinish | d28dd7b | 2015-02-23 11:52:33 -0500 | [diff] [blame] | 221 | python 2.6 compatibility will be rejected, and moving forward more features not |
Joe H. Rahme | 00a7542 | 2015-03-16 17:46:24 +0100 | [diff] [blame] | 222 | present in python 2.6 will be used. If you're running your OpenStack services |
| 223 | on an earlier release with python 2.6 you can easily run Tempest against it |
Matthew Treinish | d28dd7b | 2015-02-23 11:52:33 -0500 | [diff] [blame] | 224 | from a remote system running python 2.7. (or deploy a cloud guest in your cloud |
| 225 | that has python 2.7) |
Matthew Treinish | 3460aaa | 2015-05-11 22:18:00 -0400 | [diff] [blame] | 226 | |
Matthew Treinish | 315aa21 | 2016-10-13 17:35:47 -0400 | [diff] [blame] | 227 | Python 3.x |
Matthew Treinish | 3460aaa | 2015-05-11 22:18:00 -0400 | [diff] [blame] | 228 | ---------- |
| 229 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 230 | Starting during the Pike cycle Tempest has a gating CI job that runs Tempest |
| 231 | with Python 3. Any Tempest release after 15.0.0 should fully support running |
Matthew Treinish | a60fe38 | 2017-03-02 17:15:05 -0500 | [diff] [blame] | 232 | under Python 3 as well as Python 2.7. |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 233 | |
| 234 | Legacy run method |
| 235 | ----------------- |
| 236 | |
| 237 | The legacy method of running Tempest is to just treat the Tempest source code |
| 238 | as a python unittest repository and run directly from the source repo. When |
| 239 | running in this way you still start with a Tempest config file and the steps |
| 240 | are basically the same except that it expects you know where the Tempest code |
| 241 | lives on your system and requires a bit more manual interaction to get Tempest |
| 242 | running. For example, when running Tempest this way things like a lock file |
| 243 | directory do not get generated automatically and the burden is on the user to |
| 244 | create and configure that. |
| 245 | |
| 246 | To start you need to create a configuration file. The easiest way to create a |
| 247 | configuration file is to generate a sample in the ``etc/`` directory :: |
| 248 | |
Ken'ichi Ohmichi | dcf55a0 | 2016-06-01 19:57:14 -0700 | [diff] [blame] | 249 | $ cd $TEMPEST_ROOT_DIR |
| 250 | $ oslo-config-generator --config-file \ |
Erickson Santos | 7d274ed | 2016-07-26 14:16:57 +0000 | [diff] [blame] | 251 | tempest/cmd/config-generator.tempest.conf \ |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 252 | --output-file etc/tempest.conf |
| 253 | |
| 254 | After that, open up the ``etc/tempest.conf`` file and edit the |
| 255 | configuration variables to match valid data in your environment. |
| 256 | This includes your Keystone endpoint, a valid user and credentials, |
| 257 | and reference data to be used in testing. |
| 258 | |
| 259 | .. note:: |
| 260 | |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 261 | If you have a running DevStack environment, Tempest will be |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 262 | automatically configured and placed in ``/opt/stack/tempest``. It |
| 263 | will have a configuration file already set up to work with your |
Jordan Pittier | 74a56ab | 2017-04-26 16:46:20 +0200 | [diff] [blame] | 264 | DevStack installation. |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 265 | |
| 266 | Tempest is not tied to any single test runner, but `testr`_ is the most commonly |
| 267 | used tool. Also, the nosetests test runner is **not** recommended to run Tempest. |
| 268 | |
| 269 | After setting up your configuration file, you can execute the set of Tempest |
| 270 | tests by using ``testr`` :: |
| 271 | |
Ken'ichi Ohmichi | dcf55a0 | 2016-06-01 19:57:14 -0700 | [diff] [blame] | 272 | $ testr run --parallel |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 273 | |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 274 | To run one single test serially :: |
| 275 | |
Ken'ichi Ohmichi | dcf55a0 | 2016-06-01 19:57:14 -0700 | [diff] [blame] | 276 | $ testr run tempest.api.compute.servers.test_servers_negative.ServersNegativeTestJSON.test_reboot_non_existent_server |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 277 | |
Jordan Pittier | 27ca251 | 2017-02-22 16:25:28 +0100 | [diff] [blame] | 278 | Tox also contains several existing job configurations. For example:: |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 279 | |
Hai Shi | 6f52fc5 | 2017-04-03 21:17:37 +0800 | [diff] [blame] | 280 | $ tox -e full |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 281 | |
| 282 | which will run the same set of tests as the OpenStack gate. (it's exactly how |
| 283 | the gate invokes Tempest) Or:: |
| 284 | |
Hai Shi | 6f52fc5 | 2017-04-03 21:17:37 +0800 | [diff] [blame] | 285 | $ tox -e smoke |
Matthew Treinish | 828734a | 2015-07-06 15:43:46 -0400 | [diff] [blame] | 286 | |
| 287 | to run the tests tagged as smoke. |