blob: 33842fdd1c453845489bfda9cddcfbd6ef86cead [file] [log] [blame]
Matthew Treinisha9aef872014-07-25 16:03:08 -04001.. _stress_field_guide:
2
Sean Dague7679b482013-05-24 08:49:44 -04003Tempest Field Guide to Stress Tests
Attila Fazekas23fdf1d2013-06-09 16:35:23 +02004===================================
David Kranzb9d97502013-05-01 15:55:04 -04005
Boris Pavlovic17ffbb92014-02-01 03:49:55 +04006OpenStack is a distributed, asynchronous system that is prone to race condition
David Kranzb9d97502013-05-01 15:55:04 -04007bugs. These bugs will not be easily found during
8functional testing but will be encountered by users in large deployments in a
9way that is hard to debug. The stress test tries to cause these bugs to happen
10in a more controlled environment.
11
12
13Environment
Attila Fazekas23fdf1d2013-06-09 16:35:23 +020014-----------
Sean Dague7679b482013-05-24 08:49:44 -040015This particular framework assumes your working Nova cluster understands Nova
David Kranzb9d97502013-05-01 15:55:04 -040016API 2.0. The stress tests can read the logs from the cluster. To enable this
17you have to provide the hostname to call 'nova-manage' and
18the private key and user name for ssh to the cluster in the
19[stress] section of tempest.conf. You also need to provide the
20location 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 Kodererb714de52013-08-08 09:21:46 +020028To activate logging on your console please make sure that you activate `use_stderr`
29in tempest.conf or use the default `logging.conf.sample` file.
David Kranzb9d97502013-05-01 15:55:04 -040030
Marc Koderer31fe4832013-11-06 17:02:03 +010031Running default stress test set
32-------------------------------
33
34The stress test framework can automatically discover test inside the tempest
35test suite. All test flag with the `@stresstest` decorator will be executed.
Masayuki Igawae5c70282015-10-30 12:18:58 +090036In order to use this discovery you have to install tempest CLI, be in the
37tempest root directory and execute the following:
Marc Koderer31fe4832013-11-06 17:02:03 +010038
Masayuki Igawae5c70282015-10-30 12:18:58 +090039 tempest run-stress -a -d 30
Marc Koderer31fe4832013-11-06 17:02:03 +010040
David Kranzb9d97502013-05-01 15:55:04 -040041Running the sample test
42-----------------------
43
Matthew Treinish55e29b42014-05-07 01:04:17 -040044To test installation, do the following:
David Kranzb9d97502013-05-01 15:55:04 -040045
Masayuki Igawae5c70282015-10-30 12:18:58 +090046 tempest run-stress -t tempest/stress/etc/server-create-destroy-test.json -d 30
David Kranzb9d97502013-05-01 15:55:04 -040047
48This sample test tries to create a few VMs and kill a few VMs.
49
50
51Additional Tools
52----------------
53
54Sometimes the tests don't finish, or there are failures. In these
55cases, you may want to clean out the nova cluster. We have provided
56some scripts to do this in the ``tools`` subdirectory.
57You can use the following script to destroy any keypairs,
58floating ips, and servers:
59
60tempest/stress/tools/cleanup.py