Test suite structure

Test types

There are three types of tests for Zaqar:

Unit tests
Unit tests check modules separately. For example, there are checks for each individual method that the storage layer provides.
Functional tests
Functional tests verify that the service works as expected. In particular, in Zaqar they exercise the API endpoints and validate that the API responses conform to the specs. These include positive and negative tests.
Tempest tests

Tempest tests are integration tests for OpenStack [1].

Tempest tests for Zaqar are available in the Tempest repository.

Refer to Running tests document for details on how to run Unit and Functional tests.

Refer to the Tempest repository for details on how to run Tempest tests.

Code structure

The test suite lives in zaqar/tests directory of Zaqar:

  • zaqar/tests/etc
    Contains various configuration files for Zaqar. They help to test how Zaqar works in different configurations.
  • zaqar/tests/functional
    Contains functional tests.
  • zaqar/tests/unit
    Contains unit tests.

The base class of all test classes is located in the zaqar/tests/base.py file.

Test invocation

When you run tests via tox -e py27 command in the root directory of Zaqar:

  1. Tox program executes:

    1. Looks for tox.ini file.
    2. Creates .tox directory for storing python environments.
    3. Parses this file and finds parameters for py27 testing environment.
    4. Sets this environment up and activates it.
    5. Sets environment variables for this environment that are described in tox.ini
    6. In case of Zaqar it invokes Testr program in the environment.

    You can find more information about Tox in OpenStack Tox testing manual and in official Tox documentation.

  2. Testr (Test Repository) program executes:

    1. Looks for testr.ini file.
    2. Parses this file and finds parameters for executing tests.
    3. Creates .testrepository directory for storing statistics of executing tests.
    4. In case of Zaqar it invokes Subunit program which finds all tests and executes it.

    You can find more information about Testr in OpenStack Testr manual.

Footnotes

[1]See http://docs.openstack.org/developer/tempest/overview.html