Attila Fazekas | 58d2330 | 2013-07-24 10:25:02 +0200 | [diff] [blame] | 1 | ============================ |
Sean Dague | 7679b48 | 2013-05-24 08:49:44 -0400 | [diff] [blame] | 2 | Tempest Field Guide Overview |
Attila Fazekas | 58d2330 | 2013-07-24 10:25:02 +0200 | [diff] [blame] | 3 | ============================ |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 4 | |
| 5 | Tempest is designed to be useful for a large number of different |
| 6 | environments. This includes being useful for gating commits to |
| 7 | OpenStack core projects, being used to validate OpenStack cloud |
| 8 | implementations for both correctness, as well as a burn in tool for |
| 9 | OpenStack clouds. |
| 10 | |
| 11 | As such Tempest tests come in many flavors, each with their own rules |
| 12 | and guidelines. Below is the proposed Havana restructuring for Tempest |
| 13 | to make this clear. |
| 14 | |
Xiao Hanyu | a4036d1 | 2013-06-19 14:12:23 +0800 | [diff] [blame] | 15 | | 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 Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 21 | |
| 22 | Each of these directories contains different types of tests. What |
| 23 | belongs in each directory, the rules and examples for good tests, are |
| 24 | documented in a README.rst file in the directory. |
| 25 | |
Matthew Treinish | a9aef87 | 2014-07-25 16:03:08 -0400 | [diff] [blame] | 26 | :ref:`api_field_guide` |
| 27 | ---------------------- |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 28 | |
| 29 | API tests are validation tests for the OpenStack API. They should not |
| 30 | use the existing python clients for OpenStack, but should instead use |
| 31 | the tempest implementations of clients. This allows us to test both |
| 32 | XML and JSON. Having raw clients also lets us pass invalid JSON and |
| 33 | XML to the APIs and see the results, something we could not get with |
| 34 | the native clients. |
| 35 | |
| 36 | When it makes sense, API testing should be moved closer to the |
| 37 | projects themselves, possibly as functional tests in their unit test |
| 38 | frameworks. |
| 39 | |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 40 | |
Matthew Treinish | a9aef87 | 2014-07-25 16:03:08 -0400 | [diff] [blame] | 41 | :ref:`cli_field_guide` |
| 42 | ---------------------- |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 43 | |
| 44 | CLI tests use the openstack CLI to interact with the OpenStack |
| 45 | cloud. CLI testing in unit tests is somewhat difficult because unlike |
| 46 | server testing, there is no access to server code to |
| 47 | instantiate. Tempest seems like a logical place for this, as it |
| 48 | prereqs having a running OpenStack cloud. |
| 49 | |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 50 | |
Matthew Treinish | a9aef87 | 2014-07-25 16:03:08 -0400 | [diff] [blame] | 51 | :ref:`scenario_field_guide` |
| 52 | --------------------------- |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 53 | |
| 54 | Scenario tests are complex "through path" tests for OpenStack |
| 55 | functionality. They are typically a series of steps where complicated |
| 56 | state requiring multiple services is set up exercised, and torn down. |
| 57 | |
| 58 | Scenario tests can and should use the OpenStack python clients. |
| 59 | |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 60 | |
Matthew Treinish | a9aef87 | 2014-07-25 16:03:08 -0400 | [diff] [blame] | 61 | :ref:`stress_field_guide` |
| 62 | ------------------------- |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 63 | |
Marc Koderer | a58e851 | 2014-07-17 10:40:23 +0200 | [diff] [blame] | 64 | Stress tests are designed to stress an OpenStack environment by running a high |
| 65 | workload against it and seeing what breaks. The stress test framework runs |
| 66 | several test jobs in parallel and can run any existing test in Tempest as a |
| 67 | stress job. |
Sean Dague | 31a57ad | 2013-05-07 15:24:05 -0400 | [diff] [blame] | 68 | |
Matthew Treinish | a9aef87 | 2014-07-25 16:03:08 -0400 | [diff] [blame] | 69 | :ref:`third_party_field_guide` |
| 70 | ----------------------------- |
Sean Dague | 09761f6 | 2013-05-13 15:20:40 -0400 | [diff] [blame] | 71 | |
| 72 | Many openstack components include 3rdparty API support. It is |
ravikumar-venkatesan | bae88e1 | 2013-06-07 23:02:19 +0000 | [diff] [blame] | 73 | completely legitimate for Tempest to include tests of 3rdparty APIs, |
| 74 | but those should be kept separate from the normal OpenStack |
Sean Dague | 09761f6 | 2013-05-13 15:20:40 -0400 | [diff] [blame] | 75 | validation. |
Matthew Treinish | 817a808 | 2014-07-25 16:07:20 -0400 | [diff] [blame] | 76 | |
| 77 | :ref:`unit_tests_field_guide` |
| 78 | ----------------------------- |
| 79 | |
| 80 | Unit tests are the self checks for Tempest. They provide functional |
| 81 | verification and regression checking for the internal components of tempest. |
| 82 | They should be used to just verify that the individual pieces of tempest are |
| 83 | working as expected. |