blob: c41ef96eec65bfdecae1e88f7579853e679f7966 [file] [log] [blame]
Sean Dague31a57ad2013-05-07 15:24:05 -04001Tempest Field Guide
2-----------
3
4Tempest is designed to be useful for a large number of different
5environments. This includes being useful for gating commits to
6OpenStack core projects, being used to validate OpenStack cloud
7implementations for both correctness, as well as a burn in tool for
8OpenStack clouds.
9
10As such Tempest tests come in many flavors, each with their own rules
11and guidelines. Below is the proposed Havana restructuring for Tempest
12to make this clear.
13
14tempest/
15 3rdparty/ - 3rd party api tests
16 api/ - API tests
17 cli/ - CLI tests
18 scenario/ - complex scenario tests
19 stress/ - stress tests
20 whitebox/ - white box testing
21
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
26
273rdparty
28------------
29
30Many openstack components include 3rdparty API support. It is
31completely legitmate for Tempest to include tests of 3rdparty APIs,
32but those should be kept seperate from the normal OpenStack
33validation.
34
35TODO: tempest/tests/boto should become tempest/3rdparty/boto
36
37
38api
39------------
40
41API tests are validation tests for the OpenStack API. They should not
42use the existing python clients for OpenStack, but should instead use
43the tempest implementations of clients. This allows us to test both
44XML and JSON. Having raw clients also lets us pass invalid JSON and
45XML to the APIs and see the results, something we could not get with
46the native clients.
47
48When it makes sense, API testing should be moved closer to the
49projects themselves, possibly as functional tests in their unit test
50frameworks.
51
52TODO: The bulk of tempest/tests should move to tempest/api
53
54
55cli
56------------
57
58CLI tests use the openstack CLI to interact with the OpenStack
59cloud. CLI testing in unit tests is somewhat difficult because unlike
60server testing, there is no access to server code to
61instantiate. Tempest seems like a logical place for this, as it
62prereqs having a running OpenStack cloud.
63
64TODO: the top level cli directory moves to tempest/cli
65
66
67scenario
68------------
69
70Scenario tests are complex "through path" tests for OpenStack
71functionality. They are typically a series of steps where complicated
72state requiring multiple services is set up exercised, and torn down.
73
74Scenario tests can and should use the OpenStack python clients.
75
76TODO: tests/network/test_network_basic_ops.py,
77tests/compute/servers/*_ops.py should move to tempest/scenario (others)
78
79
80stress
81-----------
82
83Stress tests are designed to stress an OpenStack environment by
84running a high workload against it and seeing what breaks. Tools may
85be provided to help detect breaks (stack traces in the logs).
86
87TODO: old stress tests deleted, new_stress that david is working on
88moves into here.
89
90
91whitebox
92----------
93
94Whitebox tests are tests which require access to the database of the
95target OpenStack machine to verify internal state after opperations
96are made. White box tests are allowed to use the python clients.
97
98TODO: collect out whitebox tests to this location.