blob: c0e0c8f9f5166ab0fada5d9323e725aef3630ee2 [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
82 enable_rbac must be true.
83
84 test_custom_requirements must be true if you want to run tests against a `custom_requirements_file` which defines RBAC requirements.
85
86 custom_requirements_file must be absolute path of file path of the YAML file that defines your RBAC requirements.
87
88For 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.
89
90
91**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.
92
93 [sdn]
94 endpoint_type = <public|admin|internal|publicURL|adminURL|internalURL>
95 catalog_type = <Catalog type of the SDN service, default sdn-l-config>
96
97#Running tungsten-tempest
98
99Once the configuration is done you're now ready to run tungsten-fabric.
100
101The easiest way to run is using any testr utilities like below:
102
103 $ ostestr run --regex tungsten_tempest_plugin.tests.api
104
105This can also be done using the `tempest_run`_ command. This can be done by running::
106
107 $ tempest run --regex '^tungsten_tempest_plugin\.tests\.api'
108
109There is also the option to use testr directly, or any `testr`_ based test runner, like `ostestr`_. For example, from the work-space dir run::
110
111 $ stestr --regex '(?!.*\[.*\bslow\b.*\])(^tungsten_tempest_plugin\.tests\.api))'
112
113will run the same set of tests as the default gate jobs.
114
115You can also run tungsten_tempest tests using `tox`_. To do so, ``cd`` into the **Tempest** directory and run::
116
117 $ tox -eall-plugin -- tungstent_tempest_plugin.tests.api
118
119#Log Information
120
121Log 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`.
122
123More detailed RBAC testing log output is emitted to ``tungsten_log``.
124
125To configure tungsten-tempest's logging, see the :ref:`tungsten-tempest-configuration` guide.
126
127
128Tempest: [https://github.com/openstack/tempest](https://github.com/openstack/tempest)
129
130Tempest Quickstart: [https://docs.openstack.org/tempest/latest/overview.html#quickstart](https://docs.openstack.org/tempest/latest/overview.html#quickstart)
131
132tempest_run: [https://docs.openstack.org/tempest/latest/run.html](https://docs.openstack.org/tempest/latest/run.html)
133
134testr: [https://testrepository.readthedocs.org/en/latest/MANUAL.html
135](https://testrepository.readthedocs.org/en/latest/MANUAL.html)
136
137ostestr: [https://docs.openstack.org/os-testr/latest/](https://docs.openstack.org/os-testr/latest/)
138
139tox: [https://tox.readthedocs.io/en/latest/](https://tox.readthedocs.io/en/latest/)
140
141
142
143#RBAC Tests
144----------
145
146To change the role that the tungsten_tempest tests are being run as, edit ``rbac_test_role`` in the ``patrole`` section of tempest.conf: ::
147
148 [patrole]
149 rbac_test_role = member
150 ...
151
152**NOTE**::
153
154The ``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.
155
156For more information about the member role and its nomenclature,
157
158please see: `<https://ask.openstack.org/en/question/4759/member-vs-_member_/>`__.
159