blob: 9eac19d21382cd8ab4f0416037ce0ad5865783c4 [file] [log] [blame]
Masayuki Igawac268dd62013-09-18 00:51:05 +09001Tempest Field Guide to API tests
2================================
Sean Dague1937d092013-05-17 16:36:38 -04003
4
5What are these tests?
Attila Fazekas23fdf1d2013-06-09 16:35:23 +02006---------------------
Sean Dague1937d092013-05-17 16:36:38 -04007
8One of Tempest's prime function is to ensure that your OpenStack cloud
9works with the OpenStack API as documented. The current largest
10portion of Tempest code is devoted to test cases that do exactly this.
11
Yong Sheng Gonge99072d2013-08-15 13:52:41 +080012It's also important to test not only the expected positive path on
Sean Dague1937d092013-05-17 16:36:38 -040013APIs, but also to provide them with invalid data to ensure they fail
14in expected and documented ways. Over the course of the OpenStack
15project Tempest has discovered many fundamental bugs by doing just
16this.
17
Yong Sheng Gonge99072d2013-08-15 13:52:41 +080018In order for some APIs to return meaningful results, there must be
Sean Dague1937d092013-05-17 16:36:38 -040019enough data in the system. This means these tests might start by
Yong Sheng Gonge99072d2013-08-15 13:52:41 +080020spinning up a server, image, etc, then operating on it.
Sean Dague1937d092013-05-17 16:36:38 -040021
22
23Why are these tests in tempest?
Attila Fazekas23fdf1d2013-06-09 16:35:23 +020024-------------------------------
Sean Dague1937d092013-05-17 16:36:38 -040025
26This is one of the core missions for the Tempest project, and where it
27started. Many people use this bit of function in Tempest to ensure
28their clouds haven't broken the OpenStack API.
29
30It could be argued that some of the negative testing could be done
31back in the projects themselves, and we might evolve there over time,
32but currently in the OpenStack gate this is a fundamentally important
33place to keep things.
34
35
36Scope of these tests
Attila Fazekas23fdf1d2013-06-09 16:35:23 +020037--------------------
Sean Dague1937d092013-05-17 16:36:38 -040038
39API tests should always use the Tempest implementation of the
40OpenStack API, as we want to ensure that bugs aren't hidden by the
41official clients.
42
43They should test specific API calls, and can build up complex state if
44it's needed for the API call to be meaningful.
45
46They should send not only good data, but bad data at the API and look
47for error codes.
48
49They should all be able to be run on their own, not depending on the
50state created by a previous test.