blob: 099602213f54ade060728763683d47c3f072d686 [file] [log] [blame]
Jay Pipes7f757632011-12-02 15:53:32 -05001Tempest - The OpenStack Integration Test Suite
2==============================================
Justin Shepherd0d9bbd12011-08-11 12:57:44 -05003
Sean Dagueb56052b2013-05-21 17:57:41 -04004This is a set of integration tests to be run against a live OpenStack
5cluster. Tempest has batteries of tests for OpenStack API validation,
6Scenarios, and other specific tests useful in validating an OpenStack
7deployment.
8
Sean Daguea26454d2013-11-01 18:09:55 -04009Design Principles
10----------
11Tempest Design Principles that we strive to live by.
12
13- Tempest should be able to run against any OpenStack cloud, be it a
14 one node devstack install, a 20 node lxc cloud, or a 1000 node kvm
15 cloud.
16- Tempest should be explicit in testing features. It is easy to auto
17 discover features of a cloud incorrectly, and give people an
18 incorrect assessment of their cloud. Explicit is always better.
19- Tempest uses OpenStack public interfaces. Tests in Tempest should
20 only touch public interfaces, API calls (native or 3rd party),
21 public CLI or libraries.
22- Tempest should not touch private or implementation specific
23 interfaces. This means not directly going to the database, not
24 directly hitting the hypervisors, not testing extensions not
25 included in the OpenStack base. If there is some feature of
26 OpenStack that is not verifiable through standard interfaces, this
27 should be considered a possible enhancement.
28- Tempest strives for complete coverage of the OpenStack API and
29 common scenarios that demonstrate a working cloud.
30- Tempest drives load in an OpenStack cloud. By including a broad
31 array of API and scenario tests Tempest can be reused in whole or in
32 parts as load generation for an OpenStack cloud.
33- Tempest should attempt to clean up after itself, whenever possible
34 we should tear down resources when done.
35- Tempest should be self testing.
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050036
37Quickstart
38----------
39
Jay Pipes7f757632011-12-02 15:53:32 -050040To run Tempest, you first need to create a configuration file that
41will tell Tempest where to find the various OpenStack services and
Daryl Wallecke36f6232012-03-06 00:21:45 -060042other testing behavior switches.
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050043
Jay Pipes7f757632011-12-02 15:53:32 -050044The easiest way to create a configuration file is to copy the sample
45one in the ``etc/`` directory ::
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050046
Jay Pipes7f757632011-12-02 15:53:32 -050047 $> cd $TEMPEST_ROOT_DIR
Brian Lamar930fc5b2011-12-08 11:51:26 -050048 $> cp etc/tempest.conf.sample etc/tempest.conf
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050049
Brian Lamar930fc5b2011-12-08 11:51:26 -050050After that, open up the ``etc/tempest.conf`` file and edit the
Daryl Wallecke36f6232012-03-06 00:21:45 -060051configuration variables to match valid data in your environment.
52This includes your Keystone endpoint, a valid user and credentials,
53and reference data to be used in testing.
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050054
Jay Pipes7f757632011-12-02 15:53:32 -050055.. note::
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050056
Sean Dagueb56052b2013-05-21 17:57:41 -040057 If you have a running devstack environment, tempest will be
58 automatically configured and placed in ``/opt/stack/tempest``. It
59 will have a configuration file already set up to work with your
60 devstack installation.
Jay Pipes7f757632011-12-02 15:53:32 -050061
Matthew Treinishb17460e2013-09-17 17:04:03 +000062Tempest is not tied to any single test runner, but testr is the most commonly
Daryl Wallecke36f6232012-03-06 00:21:45 -060063used tool. After setting up your configuration file, you can execute
Matthew Treinishb17460e2013-09-17 17:04:03 +000064the set of Tempest tests by using ``testr`` ::
Attila Fazekas58d23302013-07-24 10:25:02 +020065
Matthew Treinishb17460e2013-09-17 17:04:03 +000066 $> testr run --parallel tempest
Daryl Wallecke36f6232012-03-06 00:21:45 -060067
nayna-patelddb489c2012-11-13 22:06:45 +000068To run one single test ::
Attila Fazekas58d23302013-07-24 10:25:02 +020069
Matthew Treinishb17460e2013-09-17 17:04:03 +000070 $> testr run --parallel tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_rebuild_nonexistent_server
71
72Alternatively, you can use the run_tests.sh script which will create a venv
73and run the tests or use tox to do the same.
nayna-patelddb489c2012-11-13 22:06:45 +000074
Daryl Wallecke36f6232012-03-06 00:21:45 -060075Configuration
76-------------
77
Sean Dagueb56052b2013-05-21 17:57:41 -040078Detailed configuration of tempest is beyond the scope of this
79document. The etc/tempest.conf.sample attempts to be a self
80documenting version of the configuration.
81
82The most important pieces that are needed are the user ids, openstack
83endpoints, and basic flavors and images needed to run tests.
Daryl Wallecke36f6232012-03-06 00:21:45 -060084
85Common Issues
86-------------
87
88Tempest was originally designed to primarily run against a full OpenStack
89deployment. Due to that focus, some issues may occur when running Tempest
90against devstack.
91
92Running Tempest, especially in parallel, against a devstack instance may
93cause requests to be rate limited, which will cause unexpected failures.
94Given the number of requests Tempest can make against a cluster, rate limiting
95should be disabled for all test accounts.
96
97Additionally, devstack only provides a single image which Nova can use.
98For the moment, the best solution is to provide the same image uuid for
99both image_ref and image_ref_alt. Tempest will skip tests as needed if it
100detects that both images are the same.