Merge lp:~1chb1n/charms/trusty/heat/next.1601-test-update1 into lp:~openstack-charmers-archive/charms/trusty/heat/next

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 66
Proposed branch: lp:~1chb1n/charms/trusty/heat/next.1601-test-update1
Merge into: lp:~openstack-charmers-archive/charms/trusty/heat/next
Diff against target: 284 lines (+140/-70)
8 files modified
Makefile (+1/-0)
tests/018-basic-trusty-liberty (+11/-0)
tests/019-basic-trusty-mitaka (+11/-0)
tests/019-basic-vivid-kilo (+0/-9)
tests/020-basic-wily-liberty (+9/-0)
tests/021-basic-xenial-mitaka (+9/-0)
tests/README (+97/-60)
tests/tests.yaml (+2/-1)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/heat/next.1601-test-update1
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+282070@code.launchpad.net

Description of the change

Cosmetic updates to tests/dir and Makefile to standardize *os-charms, prep for 16.01. No changes to test code, hooks or charmhelpers.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #15760 heat-next for 1chb1n mp282070
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/15760/

65. By Ryan Beisner

remove amulet tests for unsupported releases

66. By Ryan Beisner

Move 00-setup to prevent extra, unnecessary bootstrap in test runs.

67. By Ryan Beisner

Re-number amulet test file names; add missing combos as not-executable for now.

68. By Ryan Beisner

Update tests/README

69. By Ryan Beisner

Update bundletester testplan yaml file

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #15769 heat-next for 1chb1n mp282070
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/15769/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #16906 heat-next for 1chb1n mp282070
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/16906/

Revision history for this message
Liam Young (gnuoy) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2015-11-02 16:40:35 +0000
3+++ Makefile 2016-01-08 21:47:06 +0000
4@@ -12,6 +12,7 @@
5
6 functional_test:
7 @echo Starting all functional, lint and unit tests...
8+ @tests/setup/00-setup
9 @juju test -v -p AMULET_HTTP_PROXY --timeout 2700
10
11 bin/charm_helpers_sync.py:
12
13=== added file 'tests/018-basic-trusty-liberty'
14--- tests/018-basic-trusty-liberty 1970-01-01 00:00:00 +0000
15+++ tests/018-basic-trusty-liberty 2016-01-08 21:47:06 +0000
16@@ -0,0 +1,11 @@
17+#!/usr/bin/python
18+
19+"""Amulet tests on a basic heat deployment on trusty-liberty."""
20+
21+from basic_deployment import HeatBasicDeployment
22+
23+if __name__ == '__main__':
24+ deployment = HeatBasicDeployment(series='trusty',
25+ openstack='cloud:trusty-liberty',
26+ source='cloud:trusty-updates/liberty')
27+ deployment.run_tests()
28
29=== added file 'tests/019-basic-trusty-mitaka'
30--- tests/019-basic-trusty-mitaka 1970-01-01 00:00:00 +0000
31+++ tests/019-basic-trusty-mitaka 2016-01-08 21:47:06 +0000
32@@ -0,0 +1,11 @@
33+#!/usr/bin/python
34+
35+"""Amulet tests on a basic heat deployment on trusty-liberty."""
36+
37+from basic_deployment import HeatBasicDeployment
38+
39+if __name__ == '__main__':
40+ deployment = HeatBasicDeployment(series='trusty',
41+ openstack='cloud:trusty-liberty',
42+ source='cloud:trusty-updates/liberty')
43+ deployment.run_tests()
44
45=== removed file 'tests/019-basic-vivid-kilo'
46--- tests/019-basic-vivid-kilo 2015-06-01 16:16:40 +0000
47+++ tests/019-basic-vivid-kilo 1970-01-01 00:00:00 +0000
48@@ -1,9 +0,0 @@
49-#!/usr/bin/python
50-
51-"""Amulet tests on a basic heat deployment on vivid-kilo."""
52-
53-from basic_deployment import HeatBasicDeployment
54-
55-if __name__ == '__main__':
56- deployment = HeatBasicDeployment(series='vivid')
57- deployment.run_tests()
58
59=== added file 'tests/020-basic-wily-liberty'
60--- tests/020-basic-wily-liberty 1970-01-01 00:00:00 +0000
61+++ tests/020-basic-wily-liberty 2016-01-08 21:47:06 +0000
62@@ -0,0 +1,9 @@
63+#!/usr/bin/python
64+
65+"""Amulet tests on a basic heat deployment on wily-liberty."""
66+
67+from basic_deployment import HeatBasicDeployment
68+
69+if __name__ == '__main__':
70+ deployment = HeatBasicDeployment(series='wily')
71+ deployment.run_tests()
72
73=== added file 'tests/021-basic-xenial-mitaka'
74--- tests/021-basic-xenial-mitaka 1970-01-01 00:00:00 +0000
75+++ tests/021-basic-xenial-mitaka 2016-01-08 21:47:06 +0000
76@@ -0,0 +1,9 @@
77+#!/usr/bin/python
78+
79+"""Amulet tests on a basic heat deployment on xenial-mitaka."""
80+
81+from basic_deployment import HeatBasicDeployment
82+
83+if __name__ == '__main__':
84+ deployment = HeatBasicDeployment(series='xenial')
85+ deployment.run_tests()
86
87=== modified file 'tests/README'
88--- tests/README 2015-06-11 15:38:21 +0000
89+++ tests/README 2016-01-08 21:47:06 +0000
90@@ -1,76 +1,113 @@
91-This directory provides Amulet tests that focus on verification of heat
92-deployments.
93-
94-test_* methods are called in lexical sort order.
95-
96-Test name convention to ensure desired test order:
97+This directory provides Amulet tests to verify basic deployment functionality
98+from the perspective of this charm, its requirements and its features, as
99+exercised in a subset of the full OpenStack deployment test bundle topology.
100+
101+Reference: lp:openstack-charm-testing for full test bundles.
102+
103+A single topology and configuration is defined and deployed, once for each of
104+the defined Ubuntu:OpenStack release combos. The ongoing goal is for this
105+charm to always possess tests and combo definitions for all currently-supported
106+release combinations of U:OS.
107+
108+test_* methods are called in lexical sort order, as with most runners. However,
109+each individual test method should be idempotent and expected to pass regardless
110+of run order or Ubuntu:OpenStack combo. When writing or modifying tests,
111+ensure that every individual test is not dependent on another test_ method.
112+
113+Test naming convention, purely for code organization purposes:
114 1xx service and endpoint checks
115 2xx relation checks
116 3xx config checks
117 4xx functional checks
118- 9xx restarts and other final checks
119-
120-Common uses of heat relations in deployments:
121- - [ heat, mysql ]
122- - [ heat, keystone ]
123- - [ heat, rabbitmq-server ]
124-
125-More detailed relations of heat service in a common deployment:
126- relations:
127- amqp:
128- - rabbitmq-server
129- identity-service:
130- - keystone
131- shared-db:
132- - mysql
133-
134-In order to run tests, you'll need charm-tools installed (in addition to
135-juju, of course):
136+ 9xx restarts, config changes, actions and other final checks
137+
138+In order to run tests, charm-tools and juju must be installed:
139 sudo add-apt-repository ppa:juju/stable
140 sudo apt-get update
141- sudo apt-get install charm-tools
142-
143-If you use a web proxy server to access the web, you'll need to set the
144-AMULET_HTTP_PROXY environment variable to the http URL of the proxy server.
145+ sudo apt-get install charm-tools juju juju-deployer amulet
146+
147+Alternatively, tests may be exercised with proposed or development versions
148+of juju and related tools:
149+
150+ # juju proposed version
151+ sudo add-apt-repository ppa:juju/proposed
152+ sudo apt-get update
153+ sudo apt-get install charm-tools juju juju-deployer
154+
155+ # juju development version
156+ sudo add-apt-repository ppa:juju/devel
157+ sudo apt-get update
158+ sudo apt-get install charm-tools juju juju-deployer
159+
160+Some tests may need to download files. If a web proxy server is required in
161+the environment, the AMULET_HTTP_PROXY environment variable must be set and
162+passed into the juju test command. This is unrelated to juju's http proxy
163+settings or behavior.
164
165 The following examples demonstrate different ways that tests can be executed.
166 All examples are run from the charm's root directory.
167
168- * To run all tests (starting with 00-setup):
169-
170- make test
171-
172- * To run a specific test module (or modules):
173-
174- juju test -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse
175-
176- * To run a specific test module (or modules), and keep the environment
177- deployed after a failure:
178-
179- juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse
180+ * To run all +x tests in the tests directory:
181+
182+ bzr branch lp:charms/trusty/foo
183+ cd foo
184+ make functional_test
185+
186+ * To run the tests against a specific release combo as defined in tests/:
187+
188+ bzr branch lp:charms/trusty/foo
189+ cd foo
190+ juju test -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse
191+
192+ * To run tests and keep the juju environment deployed after a failure:
193+
194+ bzr branch lp:charms/trusty/foo
195+ cd foo
196+ juju test --set-e -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse
197
198 * To re-run a test module against an already deployed environment (one
199 that was deployed by a previous call to 'juju test --set-e'):
200
201- ./tests/15-basic-trusty-icehouse
202-
203-For debugging and test development purposes, all code should be idempotent.
204-In other words, the code should have the ability to be re-run without changing
205-the results beyond the initial run. This enables editing and re-running of a
206-test module against an already deployed environment, as described above.
207-
208-Manual debugging tips:
209-
210- * Set the following env vars before using the OpenStack CLI as admin:
211- export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0
212- export OS_TENANT_NAME=admin
213+ ./tests/015-basic-trusty-icehouse
214+
215+ * Even with --set-e, `juju test` will tear down the deployment when all
216+ tests pass. The following work flow may be more effective when
217+ iterating on test writing.
218+
219+ bzr branch lp:charms/trusty/foo
220+ cd foo
221+ ./tests/setup/00-setup
222+ juju bootstrap
223+ ./tests/015-basic-trusty-icehouse
224+ # make some changes, run tests again
225+ ./tests/015-basic-trusty-icehouse
226+ # make some changes, run tests again
227+ ./tests/015-basic-trusty-icehouse
228+
229+ * There may be test definitions in the tests/ dir which are not set +x
230+ executable. This is generally true for deprecated releases, or for
231+ upcoming releases which are not yet validated and enabled. To enable
232+ and run these tests:
233+ bzr branch lp:charms/trusty/foo
234+ cd foo
235+ ls tests
236+ chmod +x tests/017-basic-trusty-kilo
237+ ./tests/setup/00-setup
238+ juju bootstrap
239+ ./tests/017-basic-trusty-kilo
240+
241+
242+Additional notes:
243+
244+ * Use DEBUG to turn on debug logging, use ERROR otherwise.
245+ u = OpenStackAmuletUtils(ERROR)
246+ u = OpenStackAmuletUtils(DEBUG)
247+
248+ * To interact with the deployed environment:
249 export OS_USERNAME=admin
250 export OS_PASSWORD=openstack
251- export OS_REGION_NAME=RegionOne
252-
253- * Set the following env vars before using the OpenStack CLI as demoUser:
254- export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0
255- export OS_TENANT_NAME=demoTenant
256- export OS_USERNAME=demoUser
257- export OS_PASSWORD=password
258- export OS_REGION_NAME=RegionOne
259+ export OS_TENANT_NAME=admin
260+ export OS_REGION_NAME=RegionOne
261+ export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0
262+ keystone user-list
263+ glance image-list
264
265=== added directory 'tests/setup'
266=== renamed file 'tests/00-setup' => 'tests/setup/00-setup'
267=== modified file 'tests/tests.yaml'
268--- tests/tests.yaml 2015-10-06 14:11:45 +0000
269+++ tests/tests.yaml 2016-01-08 21:47:06 +0000
270@@ -1,5 +1,5 @@
271 bootstrap: true
272-reset: true
273+reset: false
274 virtualenv: true
275 makefile:
276 - lint
277@@ -9,6 +9,7 @@
278 packages:
279 - amulet
280 - distro-info-data
281+ - python-ceilometerclient
282 - python-cinderclient
283 - python-distro-info
284 - python-glanceclient

Subscribers

People subscribed via source and target branches