Skip to main content

Run Gabbi Tests as Tempest Plugin

Project description

Gabbi-tempest is an experimental Tempest plugin that enables testing the APIs of running OpenStack services, integrated with tempest but without needing to write Python. Instead the YAML format provided by gabbi is used to write and evaluate HTTP requests and responses.

Tests are placed in YAML files in one or more directories. Those directories are added to a GABBI_TEMPEST_PATH environment variable. When that variable is passed into a tempest test runner that is aware of the gabbi plugin, the files on that path will be used to create tempests tests.

The test harness sets a series of enviornment variables that can be used in the YAML to reach the available services. The available variables may be extended in two ways:

  • Adding them to the environment that calls tempest if the values are known.

  • Setting them in a subclass of the plugin if the values need to be calculated from what tempest knows.

For each service in the service catalog there are <SERVICE_TYPE>_SERVICE and <SERVICE_TYPE>_BASE variables (e.g., PLACEMENT_SERVICE and PLACEMENT_BASE). A useful SERVICE_TOKEN, IMAGE_REF, FLAVOR_REF and FLAVOR_REF_ALT are also available.

For the time being the SERVICE_TOKEN is admin.

Trying It

To experiment with this you need a working tempest installation and configuration. One way to do that is to use devstack with the following added to the local.conf:

enable_service tempest
INSTALL_TEMPEST=True

in local.conf.

Once tempest is confirmed to be working, gabbi-tempest must be installed. Either install it from PyPI:

pip install gabbi-tempest

Or make a clone of this repo, cd into it, and do the equivalent of:

pip install -e .

If you are using virtualenvs or need sudo, your form will be different.

Create some gabbi tests that exercise the OpenStack services. There are sample files in the samples directory in the repo.

Go to the tempest directory (often /opt/stack/tempest) and run tempest as follows. Adding the regex will limit the test run to just gabbi related tests:

GABBI_TEMPEST_PATH=/path/one:/path/two tempest run --regex gabbi

This will run the tests described by the YAML files in /path/one and /path/two.

History

This code is based on the work of Mehdi Abaakouk who made a tempest plugin for gnocchi that worked with gabbi. He figured out the details of the plugin structure.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gabbi-tempest-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

gabbi_tempest-0.1.0-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file gabbi-tempest-0.1.0.tar.gz.

File metadata

File hashes

Hashes for gabbi-tempest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 419459f4eee8137684c3b5e2c2471b2a04118bb9204148e0a9fd2c32a190ff66
MD5 226952da23fccb08cd39911446ea0d68
BLAKE2b-256 c31dd72a8bdee295c7bf6ce8e9c6324c9a3dcd37938f13496b448944fa1b134e

See more details on using hashes here.

Provenance

File details

Details for the file gabbi_tempest-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for gabbi_tempest-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 25abb432d991dcbc26a60763d6b74a527407fa3cf81d7a7bf24aa86ba5c6af7c
MD5 9b9e8e48839d88bb4e7c82fd0e7b4a0a
BLAKE2b-256 c06f3c37656f89b48d4b2fcd61462e84bab794cf63125f00df88d67b3df5033b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page