Add 'code-block' and revise tab

This commit inserts '.. code-block::' and revises tab to 4 spaces.

Change-Id: Ic36444f101cc8a560c1cfa67dffdf64956c2bb99
This commit is contained in:
Yushiro FURUKAWA 2016-09-30 23:26:58 +09:00
parent 4db514cc01
commit 836361de95
3 changed files with 54 additions and 24 deletions

View File

@ -24,7 +24,9 @@ Configuration options for Microversion
* max_microversion
Those should be defined under respective section of each service.
For example::
For example:
.. code-block:: ini
[compute]
min_microversion = None
@ -42,7 +44,9 @@ range.
api_version_utils.check_skip_with_microversion function can be used
to automatically skip the tests which do not fall under configured
Microversion range.
For example::
For example:
.. code-block:: python
class BaseTestCase1(api_version_utils.BaseMicroversionTest):
@ -65,7 +69,9 @@ Select appropriate Microversion which needs to be used
to send with API request.
api_version_utils.select_request_microversion function can be used
to select the appropriate Microversion which will be used for API request.
For example::
For example:
.. code-block:: python
@classmethod
def resource_setup(cls):
@ -87,7 +93,9 @@ can be set using fixture.
Also Microversion header name needs to be defined on service clients which
should be constant because it is not supposed to be changed by project
as per API contract.
For example::
For example:
.. code-block:: python
COMPUTE_MICROVERSION = None
@ -96,7 +104,9 @@ For example::
Now test class can set the selected Microversion on required service clients
using fixture which can take care of resetting the same once tests is completed.
For example::
For example:
.. code-block:: python
def setUp(self):
super(BaseTestCase1, self).setUp()
@ -105,7 +115,9 @@ For example::
Service clients needs to add set Microversion in API request header which
can be done by overriding the get_headers() method of rest_client.
For example::
For example:
.. code-block:: python
COMPUTE_MICROVERSION = None
@ -136,7 +148,9 @@ will be skipped.
For example:
Below test is applicable for Microversion from 2.2 till 2.9::
Below test is applicable for Microversion from 2.2 till 2.9:
.. code-block:: python
class BaseTestCase1(api_version_utils.BaseMicroversionTest,
tempest.test.BaseTestCase):
@ -150,7 +164,9 @@ Below test is applicable for Microversion from 2.2 till 2.9::
[..]
Below test is applicable for Microversion from 2.10 till latest::
Below test is applicable for Microversion from 2.10 till latest:
.. code-block:: python
class Test2(BaseTestCase1):
min_microversion = '2.10'
@ -159,8 +175,6 @@ Below test is applicable for Microversion from 2.10 till latest::
[..]
Notes about Compute Microversion Tests
""""""""""""""""""""""""""""""""""""""

View File

@ -61,7 +61,9 @@ project to enable tempest to find the plugin. The entry point must be added
to the "tempest.test_plugins" namespace.
If you are using pbr this is fairly straightforward, in the setup.cfg just add
something like the following::
something like the following:
.. code-block:: ini
[entry_points]
tempest.test_plugins =
@ -105,7 +107,9 @@ To provide tempest with all the required information it needs to be able to run
your plugin you need to create a plugin class which tempest will load and call
to get information when it needs. To simplify creating this tempest provides an
abstract class that should be used as the parent for your plugin. To use this
you would do something like the following::
you would do something like the following:
.. code-block:: python
from tempest.test_discover import plugins
@ -177,7 +181,9 @@ installed, all service clients from all plugins will be registered, making it
easy to write tests which rely on multiple APIs whose service clients are in
different plugins.
Example implementation of ``get_service_clients``::
Example implementation of ``get_service_clients``:
.. code-block:: python
def get_service_clients(self):
# Example implementation with two service clients
@ -213,7 +219,9 @@ Parameters:
* **client_names**: Name of the classes that implement service clients in the
service clients module.
Example usage of the service clients in tests::
Example usage of the service clients in tests:
.. code-block:: python
# my_creds is instance of tempest.lib.auth.Credentials
# identity_uri is v2 or v3 depending on the configuration
@ -249,7 +257,9 @@ as they do not necessarily apply to all service clients.
Third the service client classes should inherit from ``RestClient``, should
accept generic keyword arguments, and should pass those arguments to the
``__init__`` method of ``RestClient``. Extra arguments can be added. For
instance::
instance:
.. code-block:: python
class MyAPIClient(rest_client.RestClient):
@ -273,7 +283,9 @@ API version::
client_api_1.py
client_api_2.py
The content of __init__.py module should be::
The content of __init__.py module should be:
.. code-block:: python
from client_api_1.py import API1Client
from client_api_2.py import API2Client
@ -294,7 +306,9 @@ API version::
client_api_1.py
client_api_2.py
The content each of __init__.py module under vN should be::
The content each of __init__.py module under vN should be:
.. code-block:: python
from client_api_1.py import API1Client
from client_api_2.py import API2Client

View File

@ -19,11 +19,13 @@ the private key and user name for ssh to the cluster in the
[stress] section of tempest.conf. You also need to provide the
location of the log files:
target_logfiles = "regexp to all log files to be checked for errors"
target_private_key_path = "private ssh key for controller and log file nodes"
target_ssh_user = "username for controller and log file nodes"
target_controller = "hostname or ip of controller node (for nova-manage)
log_check_interval = "time between checking logs for errors (default 60s)"
.. code-block:: ini
target_logfiles = "regexp to all log files to be checked for errors"
target_private_key_path = "private ssh key for controller and log file nodes"
target_ssh_user = "username for controller and log file nodes"
target_controller = "hostname or ip of controller node (for nova-manage)
log_check_interval = "time between checking logs for errors (default 60s)"
To activate logging on your console please make sure that you activate `use_stderr`
in tempest.conf or use the default `logging.conf.sample` file.
@ -36,14 +38,14 @@ test suite. All test flag with the `@stresstest` decorator will be executed.
In order to use this discovery you have to install tempest CLI, be in the
tempest root directory and execute the following:
tempest run-stress -a -d 30
tempest run-stress -a -d 30
Running the sample test
-----------------------
To test installation, do the following:
tempest run-stress -t tempest/stress/etc/server-create-destroy-test.json -d 30
tempest run-stress -t tempest/stress/etc/server-create-destroy-test.json -d 30
This sample test tries to create a few VMs and kill a few VMs.