Matthew Treinish | a9aef87 | 2014-07-25 16:03:08 -0400 | [diff] [blame] | 1 | .. _stress_field_guide: |
| 2 | |
Sean Dague | 7679b48 | 2013-05-24 08:49:44 -0400 | [diff] [blame] | 3 | Tempest Field Guide to Stress Tests |
Attila Fazekas | 23fdf1d | 2013-06-09 16:35:23 +0200 | [diff] [blame] | 4 | =================================== |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 5 | |
Boris Pavlovic | 17ffbb9 | 2014-02-01 03:49:55 +0400 | [diff] [blame] | 6 | OpenStack is a distributed, asynchronous system that is prone to race condition |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 7 | bugs. These bugs will not be easily found during |
| 8 | functional testing but will be encountered by users in large deployments in a |
| 9 | way that is hard to debug. The stress test tries to cause these bugs to happen |
| 10 | in a more controlled environment. |
| 11 | |
| 12 | |
| 13 | Environment |
Attila Fazekas | 23fdf1d | 2013-06-09 16:35:23 +0200 | [diff] [blame] | 14 | ----------- |
Sean Dague | 7679b48 | 2013-05-24 08:49:44 -0400 | [diff] [blame] | 15 | This particular framework assumes your working Nova cluster understands Nova |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 16 | API 2.0. The stress tests can read the logs from the cluster. To enable this |
| 17 | you have to provide the hostname to call 'nova-manage' and |
| 18 | the private key and user name for ssh to the cluster in the |
| 19 | [stress] section of tempest.conf. You also need to provide the |
| 20 | location of the log files: |
| 21 | |
| 22 | target_logfiles = "regexp to all log files to be checked for errors" |
| 23 | target_private_key_path = "private ssh key for controller and log file nodes" |
| 24 | target_ssh_user = "username for controller and log file nodes" |
| 25 | target_controller = "hostname or ip of controller node (for nova-manage) |
| 26 | log_check_interval = "time between checking logs for errors (default 60s)" |
| 27 | |
Marc Koderer | b714de5 | 2013-08-08 09:21:46 +0200 | [diff] [blame] | 28 | To activate logging on your console please make sure that you activate `use_stderr` |
| 29 | in tempest.conf or use the default `logging.conf.sample` file. |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 30 | |
Marc Koderer | 31fe483 | 2013-11-06 17:02:03 +0100 | [diff] [blame] | 31 | Running default stress test set |
| 32 | ------------------------------- |
| 33 | |
| 34 | The stress test framework can automatically discover test inside the tempest |
| 35 | test suite. All test flag with the `@stresstest` decorator will be executed. |
Masayuki Igawa | e5c7028 | 2015-10-30 12:18:58 +0900 | [diff] [blame] | 36 | In order to use this discovery you have to install tempest CLI, be in the |
| 37 | tempest root directory and execute the following: |
Marc Koderer | 31fe483 | 2013-11-06 17:02:03 +0100 | [diff] [blame] | 38 | |
Masayuki Igawa | e5c7028 | 2015-10-30 12:18:58 +0900 | [diff] [blame] | 39 | tempest run-stress -a -d 30 |
Marc Koderer | 31fe483 | 2013-11-06 17:02:03 +0100 | [diff] [blame] | 40 | |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 41 | Running the sample test |
| 42 | ----------------------- |
| 43 | |
Matthew Treinish | 55e29b4 | 2014-05-07 01:04:17 -0400 | [diff] [blame] | 44 | To test installation, do the following: |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 45 | |
Masayuki Igawa | e5c7028 | 2015-10-30 12:18:58 +0900 | [diff] [blame] | 46 | tempest run-stress -t tempest/stress/etc/server-create-destroy-test.json -d 30 |
David Kranz | b9d9750 | 2013-05-01 15:55:04 -0400 | [diff] [blame] | 47 | |
| 48 | This sample test tries to create a few VMs and kill a few VMs. |
| 49 | |
| 50 | |
| 51 | Additional Tools |
| 52 | ---------------- |
| 53 | |
| 54 | Sometimes the tests don't finish, or there are failures. In these |
| 55 | cases, you may want to clean out the nova cluster. We have provided |
| 56 | some scripts to do this in the ``tools`` subdirectory. |
| 57 | You can use the following script to destroy any keypairs, |
| 58 | floating ips, and servers: |
| 59 | |
| 60 | tempest/stress/tools/cleanup.py |