blob: fb25151b5ae9dccc9cbcadeba5e3113c37e3240b [file] [log] [blame]
Attila Fazekas58d23302013-07-24 10:25:02 +02001============================
Sean Dague7679b482013-05-24 08:49:44 -04002Tempest Field Guide Overview
Attila Fazekas58d23302013-07-24 10:25:02 +02003============================
Sean Dague31a57ad2013-05-07 15:24:05 -04004
5Tempest is designed to be useful for a large number of different
6environments. This includes being useful for gating commits to
7OpenStack core projects, being used to validate OpenStack cloud
8implementations for both correctness, as well as a burn in tool for
9OpenStack clouds.
10
11As such Tempest tests come in many flavors, each with their own rules
12and guidelines. Below is the proposed Havana restructuring for Tempest
13to make this clear.
14
Xiao Hanyua4036d12013-06-19 14:12:23 +080015| tempest/
16| api/ - API tests
17| cli/ - CLI tests
18| scenario/ - complex scenario tests
19| stress/ - stress tests
20| thirdparty/ - 3rd party api tests
Sean Dague31a57ad2013-05-07 15:24:05 -040021
22Each of these directories contains different types of tests. What
23belongs in each directory, the rules and examples for good tests, are
24documented in a README.rst file in the directory.
25
Matthew Treinisha9aef872014-07-25 16:03:08 -040026:ref:`api_field_guide`
27----------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040028
29API tests are validation tests for the OpenStack API. They should not
30use the existing python clients for OpenStack, but should instead use
31the tempest implementations of clients. This allows us to test both
32XML and JSON. Having raw clients also lets us pass invalid JSON and
33XML to the APIs and see the results, something we could not get with
34the native clients.
35
36When it makes sense, API testing should be moved closer to the
37projects themselves, possibly as functional tests in their unit test
38frameworks.
39
Sean Dague31a57ad2013-05-07 15:24:05 -040040
Matthew Treinisha9aef872014-07-25 16:03:08 -040041:ref:`cli_field_guide`
42----------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040043
44CLI tests use the openstack CLI to interact with the OpenStack
45cloud. CLI testing in unit tests is somewhat difficult because unlike
46server testing, there is no access to server code to
47instantiate. Tempest seems like a logical place for this, as it
48prereqs having a running OpenStack cloud.
49
Sean Dague31a57ad2013-05-07 15:24:05 -040050
Matthew Treinisha9aef872014-07-25 16:03:08 -040051:ref:`scenario_field_guide`
52---------------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040053
54Scenario tests are complex "through path" tests for OpenStack
55functionality. They are typically a series of steps where complicated
56state requiring multiple services is set up exercised, and torn down.
57
58Scenario tests can and should use the OpenStack python clients.
59
Sean Dague31a57ad2013-05-07 15:24:05 -040060
Matthew Treinisha9aef872014-07-25 16:03:08 -040061:ref:`stress_field_guide`
62-------------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040063
Marc Koderera58e8512014-07-17 10:40:23 +020064Stress tests are designed to stress an OpenStack environment by running a high
65workload against it and seeing what breaks. The stress test framework runs
66several test jobs in parallel and can run any existing test in Tempest as a
67stress job.
Sean Dague31a57ad2013-05-07 15:24:05 -040068
Matthew Treinisha9aef872014-07-25 16:03:08 -040069:ref:`third_party_field_guide`
70-----------------------------
Sean Dague09761f62013-05-13 15:20:40 -040071
72Many openstack components include 3rdparty API support. It is
ravikumar-venkatesanbae88e12013-06-07 23:02:19 +000073completely legitimate for Tempest to include tests of 3rdparty APIs,
74but those should be kept separate from the normal OpenStack
Sean Dague09761f62013-05-13 15:20:40 -040075validation.
Matthew Treinish817a8082014-07-25 16:07:20 -040076
77:ref:`unit_tests_field_guide`
78-----------------------------
79
80Unit tests are the self checks for Tempest. They provide functional
81verification and regression checking for the internal components of tempest.
82They should be used to just verify that the individual pieces of tempest are
83working as expected.