|
| 1 | +.. include:: vars.rst |
| 2 | + |
| 3 | +========================================== |
| 4 | +Verifying the Cloud with Rally and Tempest |
| 5 | +========================================== |
| 6 | + |
| 7 | +`Rally <https://docs.openstack.org/rally/latest/>`_ is a test framework, |
| 8 | +and `Tempest <https://docs.openstack.org/tempest/latest/>`_ is the |
| 9 | +OpenStack API test suite. In this guide, Rally is used to run Tempest tests. |
| 10 | + |
| 11 | +Requirements |
| 12 | +------------ |
| 13 | + |
| 14 | +OpenStack tests are run from a host with access to the OpenStack APIs |
| 15 | +and external network for instances. |
| 16 | + |
| 17 | +The following software environment is needed: |
| 18 | + |
| 19 | +* OpenStack admin credentials, eg public-openrc.sh from kayobe-config/etc/kolla |
| 20 | +* A virtualenv setup with python-openstackclient installed |
| 21 | + |
| 22 | +.. code-block:: shell |
| 23 | + :substitutions: |
| 24 | +
|
| 25 | + source venv/bin/activate |
| 26 | + pip install python-openstackclient |
| 27 | + source |base_path|/src/|kayobe_config|/etc/kolla/public-openrc.sh |
| 28 | +
|
| 29 | +Setup Rally for a new user |
| 30 | +-------------------------- |
| 31 | + |
| 32 | +A good directory hierarchy would be `~/rally/shakespeare/tempest-recipes`. |
| 33 | +This is assumed in this guide. |
| 34 | + |
| 35 | +Install Rally into the virtualenv: |
| 36 | + |
| 37 | +.. code-block:: shell |
| 38 | +
|
| 39 | + pip install rally-openstack \ |
| 40 | + --constraint https://releases.openstack.org/constraints/upper/master |
| 41 | +
|
| 42 | +Create the Rally test database and configuration file. For this you will |
| 43 | +need the virtualenv and public-openrc as described above: |
| 44 | + |
| 45 | +.. code-block:: shell |
| 46 | +
|
| 47 | + mkdir -p ~/.rally ~/rally/data |
| 48 | + echo "[database]" | tee ~/.rally/rally.conf |
| 49 | + echo "connection=sqlite:///${HOME}/rally/data/rally.db" | tee -a ~/.rally/rally.conf |
| 50 | + rally db recreate |
| 51 | + rally verify create-verifier --name default --type tempest |
| 52 | + rally deployment create --fromenv --name production |
| 53 | +
|
| 54 | +Check: |
| 55 | + |
| 56 | +.. code-block:: shell |
| 57 | +
|
| 58 | + rally deployment show |
| 59 | +
|
| 60 | +Install Shakespeare |
| 61 | +------------------- |
| 62 | + |
| 63 | +Shakespeare is used for writing Tempest test configuration. |
| 64 | + |
| 65 | +.. code-block:: shell |
| 66 | +
|
| 67 | + cd ~/rally |
| 68 | + git clone https://github.com/stackhpc/shakespeare.git |
| 69 | + cd shakespeare |
| 70 | + pip install -r requirements.txt |
| 71 | +
|
| 72 | +Install Tempest Recipe |
| 73 | +---------------------- |
| 74 | + |
| 75 | +A custom set of Tempest recipes should be maintained for |project_name|, |
| 76 | +defining key parameters needed and fine-grained control on the test cases |
| 77 | +to run (and which to skip). |
| 78 | + |
| 79 | +In your `shakespeare` directory, |
| 80 | +install the Tempest recipes in your Tempest configuration. |
| 81 | + |
| 82 | +.. code-block:: shell |
| 83 | + :substitutions: |
| 84 | +
|
| 85 | + git clone |tempest_recipes| |
| 86 | + ansible-playbook template.yml -e @tempest-recipes/production.yml |
| 87 | + mkdir -p ../config/production |
| 88 | + rally verify configure-verifier --reconfigure --extend ../config/production/production.conf |
| 89 | +
|
| 90 | +Rally invocation |
| 91 | +---------------- |
| 92 | + |
| 93 | +Invoke the tests (this will take several hours to complete): |
| 94 | + |
| 95 | +.. code-block:: shell |
| 96 | +
|
| 97 | + rally --debug verify start --concurrency 1 --skip-list tempest-recipes/production-skiplist.yml |
| 98 | +
|
| 99 | +Report generation |
| 100 | +----------------- |
| 101 | + |
| 102 | +Generate an HTML report of the results: |
| 103 | + |
| 104 | +.. code-block:: shell |
| 105 | +
|
| 106 | + rally verify report --type html --to ~/rally/report-$(date -d "today" +"%Y%m%d%H%M").html |
0 commit comments