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