Masayuki Igawa | c268dd6 | 2013-09-18 00:51:05 +0900 | [diff] [blame] | 1 | Tempest Field Guide to Scenario tests |
| 2 | ===================================== |
Sean Dague | 6dbc6da | 2013-05-08 17:49:46 -0400 | [diff] [blame] | 3 | |
| 4 | |
| 5 | What are these tests? |
Attila Fazekas | 23fdf1d | 2013-06-09 16:35:23 +0200 | [diff] [blame] | 6 | --------------------- |
Sean Dague | 6dbc6da | 2013-05-08 17:49:46 -0400 | [diff] [blame] | 7 | |
| 8 | Scenario tests are "through path" tests of OpenStack |
| 9 | function. Complicated setups where one part might depend on completion |
| 10 | of a previous part. They ideally involve the integration between |
| 11 | multiple OpenStack services to exercise the touch points between them. |
| 12 | |
Marc Koderer | 1b29d83 | 2013-11-08 08:43:35 +0100 | [diff] [blame] | 13 | Any scenario test should have a real-life use case. An example would be: |
| 14 | |
| 15 | - "As operator I want to start with a blank environment": |
| 16 | 1. upload a glance image |
| 17 | 2. deploy a vm from it |
| 18 | 3. ssh to the guest |
| 19 | 4. create a snapshot of the vm |
Sean Dague | 6dbc6da | 2013-05-08 17:49:46 -0400 | [diff] [blame] | 20 | |
| 21 | |
| 22 | Why are these tests in tempest? |
Attila Fazekas | 23fdf1d | 2013-06-09 16:35:23 +0200 | [diff] [blame] | 23 | ------------------------------- |
Sean Dague | 6dbc6da | 2013-05-08 17:49:46 -0400 | [diff] [blame] | 24 | This is one of tempests core purposes, testing the integration between |
| 25 | projects. |
| 26 | |
| 27 | |
| 28 | Scope of these tests |
Attila Fazekas | 23fdf1d | 2013-06-09 16:35:23 +0200 | [diff] [blame] | 29 | -------------------- |
David Kranz | c15a1ca | 2013-09-17 20:58:47 -0400 | [diff] [blame] | 30 | Scenario tests should use the official python client libraries for |
Sean Dague | 6dbc6da | 2013-05-08 17:49:46 -0400 | [diff] [blame] | 31 | OpenStack, as they provide a more realistic approach in how people |
| 32 | will interact with the services. |
| 33 | |
David Kranz | c15a1ca | 2013-09-17 20:58:47 -0400 | [diff] [blame] | 34 | Tests should be tagged with which services they exercise, as |
| 35 | determined by which client libraries are used directly by the test. |
Sean Dague | 6dbc6da | 2013-05-08 17:49:46 -0400 | [diff] [blame] | 36 | |
| 37 | |
| 38 | Example of a good test |
Attila Fazekas | 23fdf1d | 2013-06-09 16:35:23 +0200 | [diff] [blame] | 39 | ---------------------- |
Sean Dague | 6dbc6da | 2013-05-08 17:49:46 -0400 | [diff] [blame] | 40 | While we are looking for interaction of 2 or more services, be |
| 41 | specific in your interactions. A giant "this is my data center" smoke |
| 42 | test is hard to debug when it goes wrong. |
| 43 | |
| 44 | A flow of interactions between glance and nova, like in the |
| 45 | introduction, is a good example. Especially if it involves a repeated |
| 46 | interaction when a resource is setup, modified, detached, and then |
| 47 | reused later again. |