summaryrefslogtreecommitdiff
path: root/watcher_tempest_plugin/README.rst
diff options
context:
space:
mode:
Diffstat (limited to 'watcher_tempest_plugin/README.rst')
-rw-r--r--watcher_tempest_plugin/README.rst158
1 files changed, 0 insertions, 158 deletions
diff --git a/watcher_tempest_plugin/README.rst b/watcher_tempest_plugin/README.rst
deleted file mode 100644
index 1fd805f..0000000
--- a/watcher_tempest_plugin/README.rst
+++ /dev/null
@@ -1,158 +0,0 @@
1..
2 Except where otherwise noted, this document is licensed under Creative
3 Commons Attribution 3.0 License. You can view the license at:
4
5 https://creativecommons.org/licenses/by/3.0/
6
7.. _tempest_tests:
8
9Tempest tests
10=============
11
12The following procedure gets you started with Tempest testing but you can also
13refer to the `Tempest documentation`_ for more details.
14
15.. _Tempest documentation: https://docs.openstack.org/tempest/latest
16
17
18Tempest installation
19--------------------
20
21To install Tempest you can issue the following commands::
22
23 $ git clone https://github.com/openstack/tempest/
24 $ cd tempest/
25 $ pip install .
26
27The folder you are into now will be called ``<TEMPEST_DIR>`` from now onwards.
28
29Please note that although it is fully working outside a virtual environment, it
30is recommended to install within a `venv`.
31
32
33Watcher Tempest testing setup
34-----------------------------
35
36You can now install Watcher alongside it in development mode by issuing the
37following command::
38
39 $ pip install -e <WATCHER_SRC_DIR>
40
41Then setup a local working environment (here ``watcher-cloud``) for running
42Tempest for Watcher which shall contain the configuration for your OpenStack
43integration platform.
44
45In a virtual environment, you can do so by issuing the following command::
46
47 $ cd <TEMPEST_DIR>
48 $ tempest init watcher-cloud
49
50Otherwise, if you are not using a virtualenv::
51
52 $ cd <TEMPEST_DIR>
53 $ tempest init --config-dir ./etc watcher-cloud
54
55By default the configuration file is empty so before starting, you need to
56issue the following commands::
57
58 $ cd <TEMPEST_DIR>/watcher-cloud/etc
59 $ cp tempest.conf.sample tempest.conf
60
61At this point you need to edit the ``watcher-cloud/etc/tempest.conf``
62file as described in the `Tempest configuration guide`_.
63Shown below is a minimal configuration you need to set within your
64``tempest.conf`` configuration file which can get you started.
65
66For Keystone V3::
67
68 [identity]
69 uri_v3 = http://<KEYSTONE_PUBLIC_ENDPOINT_IP>:<KEYSTONE_PORT>/v3
70 auth_version = v3
71
72 [auth]
73 admin_username = <ADMIN_USERNAME>
74 admin_password = <ADMIN_PASSWORD>
75 admin_tenant_name = <ADMIN_TENANT_NAME>
76 admin_domain_name = <ADMIN_DOMAIN_NAME>
77
78 [identity-feature-enabled]
79 api_v2 = false
80 api_v3 = true
81
82For Keystone V2::
83
84 [identity]
85 uri = http://<KEYSTONE_PUBLIC_ENDPOINT_IP>:<KEYSTONE_PORT>/v2.0
86 auth_version = v2
87
88 [auth]
89 admin_tenant_name = <ADMIN_TENANT_NAME>
90 admin_username = <ADMIN_USERNAME>
91 admin_password = <ADMIN_PASSWORD>
92
93In both cases::
94
95 [network]
96 public_network_id = <PUBLIC_NETWORK_ID>
97
98You now have the minimum configuration for running Watcher Tempest tests on a
99single node.
100
101Since deploying Watcher with only a single compute node is not very useful, a
102few more configuration have to be set in your ``tempest.conf`` file in order to
103enable the execution of multi-node scenarios::
104
105 [compute]
106 # To indicate Tempest test that you have provided enough compute nodes
107 min_compute_nodes = 2
108
109 # Image UUID you can get using the "glance image-list" command
110 image_ref = <IMAGE_UUID>
111
112
113For more information, please refer to:
114
115- Keystone connection: https://docs.openstack.org/tempest/latest/configuration.html#keystone-connection-info
116- Dynamic Keystone Credentials: https://docs.openstack.org/tempest/latest/configuration.html#dynamic-credentials
117
118.. _virtual environment: http://docs.python-guide.org/en/latest/dev/virtualenvs/
119.. _Tempest configuration guide: http://docs.openstack.org/tempest/latest/configuration.html
120
121
122Watcher Tempest tests execution
123-------------------------------
124
125To list all Watcher Tempest cases, you can issue the following commands::
126
127 $ cd <TEMPEST_DIR>
128 $ testr list-tests watcher
129
130To run only these tests in Tempest, you can then issue these commands::
131
132 $ ./run_tempest.sh --config watcher-cloud/etc/tempest.conf -N -- watcher
133
134Or alternatively the following commands if you are::
135
136 $ cd <TEMPEST_DIR>/watcher-cloud
137 $ ../run_tempest.sh -N -- watcher
138
139To run a single test case, go to Tempest directory, then run with test case
140name, e.g.::
141
142 $ cd <TEMPEST_DIR>
143 $ ./run_tempest.sh --config watcher-cloud/etc/tempest.conf -N \
144 -- watcher_tempest_plugin.tests.api.admin.test_audit_template.TestCreateDeleteAuditTemplate.test_create_audit_template
145
146Alternatively, you can also run the Watcher Tempest plugin tests using tox. But
147before you can do so, you need to follow the Tempest explanation on running
148`tox with plugins`_. Then, run::
149
150 $ export TEMPEST_CONFIG_DIR=<TEMPEST_DIR>/watcher-cloud/etc/
151 $ tox -eall-plugin watcher
152
153.. _tox with plugins: https://docs.openstack.org/tempest/latest/plugin.html#notes-for-using-plugins-with-virtualenvs
154
155And, to run a specific test::
156
157 $ export TEMPEST_CONFIG_DIR=<TEMPEST_DIR>/watcher-cloud/etc/
158 $ tox -eall-plugin watcher_tempest_plugin.tests.api.admin.test_audit_template.TestCreateDeleteAuditTemplate.test_create_audit_template