blob: f8f00b023756250e0f55421e64bc233332f0e487 [file] [log] [blame]
Avishek Dutadd808332018-09-20 13:27:10 -05001Tempest Integration of Tungsten Fabric (Contrail)
2=================================================
3
4This directory contains Tempest tests to cover the contrail project, as well
5as a plugin to automatically load these tests into tempest. This is a set of
6integration tests to be run against a live open-contrail cluster. Tempest has
7test-cases for Contrail API validation, scenarios, and other specific tests
8useful in validating an open-contrail deployment.
9
10See the tempest plugin docs for information on using it:
11
12[http://docs.openstack.org/developer/tempest/plugin.html#using-plugins](http://docs.openstack.org/developer/tempest/plugin.html#using-plugins)
13
14See the tempest docs for information on writing new tests etc:
15
16[http://docs.openstack.org/developer/tempest/](http://docs.openstack.org/developer/tempest/)
17
18
19Quickstart
20----------
21
22#Tempest Installation
23
24To run *tungsten-tempest*, you must first have `Tempest`_ installed and configured
25properly. Please reference Tempest's `Quickstart`_ guide to do so and for all
26exact details. Follow all the steps outlined therein.
27
28 Here are some sample steps:
29
30 $ git clone https://git.openstack.org/openstack/tempest
31 $ cd tempest
32 $ pip install -r requirements.txt
33 $ pip install -r test-requirements.txt
34 $ pip install tox
35 $ pip install tempest
36
37Now below command should show you list of available tempest test cases.
38
39 $ ostestr -l
40
41You can install all these including tempest in a virtual
42environment. If virtual environment is not installed, then install it using
43"`sudo apt-get install python-virtualenv`". Afterward, proceed with the steps below.
44
45#Patrole Installation
46
47This is done with pip after you check out the [Patrole repo](https://github.com/openstack/patrole "Patrole repo"). Please reference `Patrole` [Quickstart](https://github.com/openstack/patrole/blob/master/README.rst "Quickstart") guide for further details.
48
49 Here are some sample steps:
50
51 $ git clone https://git.openstack.org/openstack/patrole
52 $ cd patrole
53 $ pip install -e .
54
55NOTE: This can be done within a venv.
56Now below command should show you list of available Patrole test cases.
57
58 $ ostestr -l | grep patrole
59
60#Tungsten-tempest Installation
61
62This is done with pip after you check out the tungsten-tempest repo::
63
64 $ git clone https://git.openstack.org/tungsten/tungsten-tempest
65 $ pip install -e tungsten_tempest/
66
67NOTE: This can be done within a venv.
68Now below command should show you list of available tungsten-tempest test cases.
69
70 $ ostestr -l | grep tungsten
71
72#Configuration
73
74You must properly configure tempest, which is relatively straightforward. For details on configuring tempest refer to the [tempest-configuration](https://github.com/openstack/tempest/blob/master/doc/source/configuration.rst "tempest-configuration").
75
76Next you must properly configure Patrole, which is relatively straightforward. For details on configuring Patrole refer to the [patrole-configuration](https://github.com/openstack/patrole/blob/master/doc/source/configuration.rst "patrole-configuration")
77
78Next you must properly configure tungsten-fabric, which is relatively straightforward too. For details on configuring tungsten-fabric refer to the :ref:`tungsten-configuration`.
79
80After comfiguring tempmest.conf as per tempest and Patrole requirements, please make below changes too in the patrole section of tempest.conf:
81
Avishek Dutadd808332018-09-20 13:27:10 -050082 test_custom_requirements must be true if you want to run tests against a `custom_requirements_file` which defines RBAC requirements.
83
84 custom_requirements_file must be absolute path of file path of the YAML file that defines your RBAC requirements.
85
86For the details about these flags please refer [patrole.conf.sample](https://github.com/openstack/patrole/blob/master/etc/patrole.conf.sample "patrole.conf.sample") file.
87
88
89**NOTE:** Make sure you have contrail endpoints in keystone catalog-list already like sdn-l-config-*. Otherwise configure below two keys under [sdn] section of tempest.conf.
90
91 [sdn]
92 endpoint_type = <public|admin|internal|publicURL|adminURL|internalURL>
93 catalog_type = <Catalog type of the SDN service, default sdn-l-config>
94
95#Running tungsten-tempest
96
97Once the configuration is done you're now ready to run tungsten-fabric.
98
99The easiest way to run is using any testr utilities like below:
100
101 $ ostestr run --regex tungsten_tempest_plugin.tests.api
102
103This can also be done using the `tempest_run`_ command. This can be done by running::
104
105 $ tempest run --regex '^tungsten_tempest_plugin\.tests\.api'
106
107There is also the option to use testr directly, or any `testr`_ based test runner, like `ostestr`_. For example, from the work-space dir run::
108
109 $ stestr --regex '(?!.*\[.*\bslow\b.*\])(^tungsten_tempest_plugin\.tests\.api))'
110
111will run the same set of tests as the default gate jobs.
112
113You can also run tungsten_tempest tests using `tox`_. To do so, ``cd`` into the **Tempest** directory and run::
114
115 $ tox -eall-plugin -- tungstent_tempest_plugin.tests.api
116
117#Log Information
118
119Log information from tests is captured in ``tempest.log`` under the Tempest repository. Some Patrole debugging information is captured in that log related to expected test results and :ref:`role-overriding`.
120
121More detailed RBAC testing log output is emitted to ``tungsten_log``.
122
123To configure tungsten-tempest's logging, see the :ref:`tungsten-tempest-configuration` guide.
124
125
126Tempest: [https://github.com/openstack/tempest](https://github.com/openstack/tempest)
127
128Tempest Quickstart: [https://docs.openstack.org/tempest/latest/overview.html#quickstart](https://docs.openstack.org/tempest/latest/overview.html#quickstart)
129
130tempest_run: [https://docs.openstack.org/tempest/latest/run.html](https://docs.openstack.org/tempest/latest/run.html)
131
132testr: [https://testrepository.readthedocs.org/en/latest/MANUAL.html
133](https://testrepository.readthedocs.org/en/latest/MANUAL.html)
134
135ostestr: [https://docs.openstack.org/os-testr/latest/](https://docs.openstack.org/os-testr/latest/)
136
137tox: [https://tox.readthedocs.io/en/latest/](https://tox.readthedocs.io/en/latest/)
138
139
140
141#RBAC Tests
142----------
143
144To change the role that the tungsten_tempest tests are being run as, edit ``rbac_test_role`` in the ``patrole`` section of tempest.conf: ::
145
146 [patrole]
147 rbac_test_role = member
148 ...
149
150**NOTE**::
151
152The ``rbac_test_role`` is service-specific. member, for example, is an arbitrary role, but by convention is used to designate the default non-admin role in the system. Most tunsgtent_tempest tests should be run with **admin** and **member** roles. However, other services may use entirely different roles.
153
154For more information about the member role and its nomenclature,
155
156please see: `<https://ask.openstack.org/en/question/4759/member-vs-_member_/>`__.
157