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:
@@ -24,7 +24,9 @@ Configuration options for Microversion
|
|||||||
* max_microversion
|
* max_microversion
|
||||||
|
|
||||||
Those should be defined under respective section of each service.
|
Those should be defined under respective section of each service.
|
||||||
For example::
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: ini
|
||||||
|
|
||||||
[compute]
|
[compute]
|
||||||
min_microversion = None
|
min_microversion = None
|
||||||
@@ -42,7 +44,9 @@ range.
|
|||||||
api_version_utils.check_skip_with_microversion function can be used
|
api_version_utils.check_skip_with_microversion function can be used
|
||||||
to automatically skip the tests which do not fall under configured
|
to automatically skip the tests which do not fall under configured
|
||||||
Microversion range.
|
Microversion range.
|
||||||
For example::
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
class BaseTestCase1(api_version_utils.BaseMicroversionTest):
|
class BaseTestCase1(api_version_utils.BaseMicroversionTest):
|
||||||
|
|
||||||
@@ -65,7 +69,9 @@ Select appropriate Microversion which needs to be used
|
|||||||
to send with API request.
|
to send with API request.
|
||||||
api_version_utils.select_request_microversion function can be used
|
api_version_utils.select_request_microversion function can be used
|
||||||
to select the appropriate Microversion which will be used for API request.
|
to select the appropriate Microversion which will be used for API request.
|
||||||
For example::
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def resource_setup(cls):
|
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
|
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
|
should be constant because it is not supposed to be changed by project
|
||||||
as per API contract.
|
as per API contract.
|
||||||
For example::
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
COMPUTE_MICROVERSION = None
|
COMPUTE_MICROVERSION = None
|
||||||
|
|
||||||
@@ -96,7 +104,9 @@ For example::
|
|||||||
|
|
||||||
Now test class can set the selected Microversion on required service clients
|
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.
|
using fixture which can take care of resetting the same once tests is completed.
|
||||||
For example::
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BaseTestCase1, self).setUp()
|
super(BaseTestCase1, self).setUp()
|
||||||
@@ -105,7 +115,9 @@ For example::
|
|||||||
|
|
||||||
Service clients needs to add set Microversion in API request header which
|
Service clients needs to add set Microversion in API request header which
|
||||||
can be done by overriding the get_headers() method of rest_client.
|
can be done by overriding the get_headers() method of rest_client.
|
||||||
For example::
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
COMPUTE_MICROVERSION = None
|
COMPUTE_MICROVERSION = None
|
||||||
|
|
||||||
@@ -136,7 +148,9 @@ will be skipped.
|
|||||||
|
|
||||||
For example:
|
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,
|
class BaseTestCase1(api_version_utils.BaseMicroversionTest,
|
||||||
tempest.test.BaseTestCase):
|
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):
|
class Test2(BaseTestCase1):
|
||||||
min_microversion = '2.10'
|
min_microversion = '2.10'
|
||||||
@@ -159,8 +175,6 @@ Below test is applicable for Microversion from 2.10 till latest::
|
|||||||
[..]
|
[..]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Notes about Compute Microversion Tests
|
Notes about Compute Microversion Tests
|
||||||
""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
@@ -61,7 +61,9 @@ project to enable tempest to find the plugin. The entry point must be added
|
|||||||
to the "tempest.test_plugins" namespace.
|
to the "tempest.test_plugins" namespace.
|
||||||
|
|
||||||
If you are using pbr this is fairly straightforward, in the setup.cfg just add
|
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]
|
[entry_points]
|
||||||
tempest.test_plugins =
|
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
|
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
|
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
|
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
|
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
|
easy to write tests which rely on multiple APIs whose service clients are in
|
||||||
different plugins.
|
different plugins.
|
||||||
|
|
||||||
Example implementation of ``get_service_clients``::
|
Example implementation of ``get_service_clients``:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
def get_service_clients(self):
|
def get_service_clients(self):
|
||||||
# Example implementation with two service clients
|
# Example implementation with two service clients
|
||||||
@@ -213,7 +219,9 @@ Parameters:
|
|||||||
* **client_names**: Name of the classes that implement service clients in the
|
* **client_names**: Name of the classes that implement service clients in the
|
||||||
service clients module.
|
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
|
# my_creds is instance of tempest.lib.auth.Credentials
|
||||||
# identity_uri is v2 or v3 depending on the configuration
|
# 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
|
Third the service client classes should inherit from ``RestClient``, should
|
||||||
accept generic keyword arguments, and should pass those arguments to the
|
accept generic keyword arguments, and should pass those arguments to the
|
||||||
``__init__`` method of ``RestClient``. Extra arguments can be added. For
|
``__init__`` method of ``RestClient``. Extra arguments can be added. For
|
||||||
instance::
|
instance:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
class MyAPIClient(rest_client.RestClient):
|
class MyAPIClient(rest_client.RestClient):
|
||||||
|
|
||||||
@@ -273,7 +283,9 @@ API version::
|
|||||||
client_api_1.py
|
client_api_1.py
|
||||||
client_api_2.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_1.py import API1Client
|
||||||
from client_api_2.py import API2Client
|
from client_api_2.py import API2Client
|
||||||
@@ -294,7 +306,9 @@ API version::
|
|||||||
client_api_1.py
|
client_api_1.py
|
||||||
client_api_2.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_1.py import API1Client
|
||||||
from client_api_2.py import API2Client
|
from client_api_2.py import API2Client
|
||||||
|
@@ -19,6 +19,8 @@ the private key and user name for ssh to the cluster in the
|
|||||||
[stress] section of tempest.conf. You also need to provide the
|
[stress] section of tempest.conf. You also need to provide the
|
||||||
location of the log files:
|
location of the log files:
|
||||||
|
|
||||||
|
.. code-block:: ini
|
||||||
|
|
||||||
target_logfiles = "regexp to all log files to be checked for errors"
|
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_private_key_path = "private ssh key for controller and log file nodes"
|
||||||
target_ssh_user = "username for controller and log file nodes"
|
target_ssh_user = "username for controller and log file nodes"
|
||||||
|
Reference in New Issue
Block a user