watcher-tempest-plugin/doc/source
Andreas Jaeger 25d06aa08a Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Disable openstackdocs_auto_name to use 'project' variable as name.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I5cdda37a7312c05b62e7468200486c6a7f6e1397
2020-05-30 15:58:42 +02:00
..
conf.py Switch to newer openstackdocstheme and reno versions 2020-05-30 15:58:42 +02:00
contributing.rst Apply cookiecutter 2017-08-04 16:46:20 +03:00
index.rst Apply cookiecutter 2017-08-04 16:46:20 +03:00
readme.rst Sync Sphinx requirement 2019-06-05 09:55:20 +08:00

Tempest tests

The following procedure gets you started with Tempest testing but you can also refer to the Tempest documentation for more details.

Tempest installation

To install Tempest you can issue the following commands:

$ git clone https://github.com/openstack/tempest/
$ cd tempest/
$ pip install .

The folder you are into now will be called <TEMPEST_DIR> from now onwards.

Please note that although it is fully working outside a virtual environment, it is recommended to install within a venv.

Watcher Tempest testing setup

You can now install Watcher alongside it in development mode by issuing the following command:

$  pip install -e <WATCHER_SRC_DIR>

Then setup a local working environment (here watcher-cloud) for running Tempest for Watcher which shall contain the configuration for your OpenStack integration platform.

In a virtual environment, you can do so by issuing the following command:

$ cd <TEMPEST_DIR>
$ tempest init watcher-cloud

Otherwise, if you are not using a virtualenv:

$ cd <TEMPEST_DIR>
$ tempest init --config-dir ./etc watcher-cloud

By default the configuration file is empty so before starting, you need to issue the following commands:

$ cd <TEMPEST_DIR>/watcher-cloud/etc
$ cp tempest.conf.sample tempest.conf

At this point you need to edit the watcher-cloud/etc/tempest.conf file as described in the Tempest configuration guide. Shown below is a minimal configuration you need to set within your tempest.conf configuration file which can get you started.

For Keystone V3:

[identity]
uri_v3 = http://<KEYSTONE_PUBLIC_ENDPOINT_IP>:<KEYSTONE_PORT>/v3
auth_version = v3

[auth]
admin_username = <ADMIN_USERNAME>
admin_password = <ADMIN_PASSWORD>
admin_tenant_name = <ADMIN_TENANT_NAME>
admin_domain_name = <ADMIN_DOMAIN_NAME>

[identity-feature-enabled]
api_v3 = true

[network]
public_network_id = <PUBLIC_NETWORK_ID>

You now have the minimum configuration for running Watcher Tempest tests on a single node.

Since deploying Watcher with only a single compute node is not very useful, a few more configuration have to be set in your tempest.conf file in order to enable the execution of multi-node scenarios:

[compute]
# To indicate Tempest test that you have provided enough compute nodes
min_compute_nodes = 2

# Image UUID you can get using the "glance image-list" command
image_ref = <IMAGE_UUID>

For more information, please refer to:

Watcher Tempest tests execution

To list all Watcher Tempest cases, you can issue the following commands:

$ cd <TEMPEST_DIR>
$ tempest run --list-tests --regex watcher_tempest_plugin

To run only these tests in Tempest, you can then issue these commands:

$ tempest run --config-file watcher-cloud/etc/tempest.conf --regex watcher_tempest_plugin

Or alternatively the following commands if you are:

$ cd <TEMPEST_DIR>/watcher-cloud
$ tempest run --regex watcher_tempest_plugin

To run a single test case, go to Tempest directory, then run with test case name, e.g.:

$ cd <TEMPEST_DIR>
$ tempest run --config-file watcher-cloud/etc/tempest.conf --regex \
    watcher_tempest_plugin.tests.api.admin.test_audit_template.TestCreateDeleteAuditTemplate.test_create_audit_template

Alternatively, you can also run the Watcher Tempest plugin tests using tox. But before you can do so, you need to follow the Tempest explanation on running tox with plugins. Then, run:

$ export TEMPEST_CONFIG_DIR=<TEMPEST_DIR>/watcher-cloud/etc/
$ tox -eall-plugin watcher

And, to run a specific test:

$ export TEMPEST_CONFIG_DIR=<TEMPEST_DIR>/watcher-cloud/etc/
$ tox -eall-plugin watcher_tempest_plugin.tests.api.admin.test_audit_template.TestCreateDeleteAuditTemplate.test_create_audit_template