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

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 126
Proposed branch: lp:~1chb1n/charms/trusty/ceph/next.1601-test-update1
Merge into: lp:~openstack-charmers-archive/charms/trusty/ceph/next
Diff against target: 285 lines (+140/-71)
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/-61)
tests/tests.yaml (+2/-1)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/ceph/next.1601-test-update1
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+282065@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_lint_check #16881 ceph-next for 1chb1n mp282065
    LINT OK: passed

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

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

charm_unit_test #15768 ceph-next for 1chb1n mp282065
    UNIT OK: passed

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

126. By Ryan Beisner

remove amulet tests for unsupported releases

127. By Ryan Beisner

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

128. By Ryan Beisner

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

129. By Ryan Beisner

Update tests/README

130. By Ryan Beisner

Update bundletester testplan yaml file

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

charm_unit_test #15776 ceph-next for 1chb1n mp282065
    UNIT OK: passed

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

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

charm_lint_check #16904 ceph-next for 1chb1n mp282065
    LINT OK: passed

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2015-10-06 14:36:46 +0000
3+++ Makefile 2016-01-08 21:46:29 +0000
4@@ -13,6 +13,7 @@
5
6 functional_test:
7 @echo Starting Amulet tests...
8+ @tests/setup/00-setup
9 @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --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:46:29 +0000
16@@ -0,0 +1,11 @@
17+#!/usr/bin/python
18+
19+"""Amulet tests on a basic ceph deployment on trusty-liberty."""
20+
21+from basic_deployment import CephBasicDeployment
22+
23+if __name__ == '__main__':
24+ deployment = CephBasicDeployment(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:46:29 +0000
32@@ -0,0 +1,11 @@
33+#!/usr/bin/python
34+
35+"""Amulet tests on a basic ceph deployment on trusty-liberty."""
36+
37+from basic_deployment import CephBasicDeployment
38+
39+if __name__ == '__main__':
40+ deployment = CephBasicDeployment(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-15 20:40:45 +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 ceph deployment on vivid-kilo."""
52-
53-from basic_deployment import CephBasicDeployment
54-
55-if __name__ == '__main__':
56- deployment = CephBasicDeployment(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:46:29 +0000
62@@ -0,0 +1,9 @@
63+#!/usr/bin/python
64+
65+"""Amulet tests on a basic ceph deployment on wily-liberty."""
66+
67+from basic_deployment import CephBasicDeployment
68+
69+if __name__ == '__main__':
70+ deployment = CephBasicDeployment(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:46:29 +0000
76@@ -0,0 +1,9 @@
77+#!/usr/bin/python
78+
79+"""Amulet tests on a basic ceph deployment on xenial-mitaka."""
80+
81+from basic_deployment import CephBasicDeployment
82+
83+if __name__ == '__main__':
84+ deployment = CephBasicDeployment(series='xenial')
85+ deployment.run_tests()
86
87=== modified file 'tests/README'
88--- tests/README 2015-06-15 20:40:45 +0000
89+++ tests/README 2016-01-08 21:46:29 +0000
90@@ -1,77 +1,113 @@
91-This directory provides Amulet tests that focus on verification of ceph
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 ceph relations in bundle deployments:
121- - [ nova-compute, ceph ]
122- - [ glance, ceph ]
123- - [ cinder, cinder-ceph ]
124- - [ cinder-ceph, ceph ]
125-
126-More detailed relations of ceph service in a common deployment:
127- relations:
128- client:
129- - cinder-ceph
130- - glance
131- - nova-compute
132- mon:
133- - ceph
134-
135-In order to run tests, you'll need charm-tools installed (in addition to
136-juju, of course):
137+ 9xx restarts, config changes, actions and other final checks
138+
139+In order to run tests, charm-tools and juju must be installed:
140 sudo add-apt-repository ppa:juju/stable
141 sudo apt-get update
142- sudo apt-get install charm-tools
143-
144-If you use a web proxy server to access the web, you'll need to set the
145-AMULET_HTTP_PROXY environment variable to the http URL of the proxy server.
146+ sudo apt-get install charm-tools juju juju-deployer amulet
147+
148+Alternatively, tests may be exercised with proposed or development versions
149+of juju and related tools:
150+
151+ # juju proposed version
152+ sudo add-apt-repository ppa:juju/proposed
153+ sudo apt-get update
154+ sudo apt-get install charm-tools juju juju-deployer
155+
156+ # juju development version
157+ sudo add-apt-repository ppa:juju/devel
158+ sudo apt-get update
159+ sudo apt-get install charm-tools juju juju-deployer
160+
161+Some tests may need to download files. If a web proxy server is required in
162+the environment, the AMULET_HTTP_PROXY environment variable must be set and
163+passed into the juju test command. This is unrelated to juju's http proxy
164+settings or behavior.
165
166 The following examples demonstrate different ways that tests can be executed.
167 All examples are run from the charm's root directory.
168
169- * To run all tests (starting with 00-setup):
170-
171- make test
172-
173- * To run a specific test module (or modules):
174-
175- juju test -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse
176-
177- * To run a specific test module (or modules), and keep the environment
178- deployed after a failure:
179-
180- juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse
181+ * To run all +x tests in the tests directory:
182+
183+ bzr branch lp:charms/trusty/foo
184+ cd foo
185+ make functional_test
186+
187+ * To run the tests against a specific release combo as defined in tests/:
188+
189+ bzr branch lp:charms/trusty/foo
190+ cd foo
191+ juju test -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse
192+
193+ * To run tests and keep the juju environment deployed after a failure:
194+
195+ bzr branch lp:charms/trusty/foo
196+ cd foo
197+ juju test --set-e -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse
198
199 * To re-run a test module against an already deployed environment (one
200 that was deployed by a previous call to 'juju test --set-e'):
201
202- ./tests/15-basic-trusty-icehouse
203-
204-For debugging and test development purposes, all code should be idempotent.
205-In other words, the code should have the ability to be re-run without changing
206-the results beyond the initial run. This enables editing and re-running of a
207-test module against an already deployed environment, as described above.
208-
209-Manual debugging tips:
210-
211- * Set the following env vars before using the OpenStack CLI as admin:
212- export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0
213- export OS_TENANT_NAME=admin
214+ ./tests/015-basic-trusty-icehouse
215+
216+ * Even with --set-e, `juju test` will tear down the deployment when all
217+ tests pass. The following work flow may be more effective when
218+ iterating on test writing.
219+
220+ bzr branch lp:charms/trusty/foo
221+ cd foo
222+ ./tests/setup/00-setup
223+ juju bootstrap
224+ ./tests/015-basic-trusty-icehouse
225+ # make some changes, run tests again
226+ ./tests/015-basic-trusty-icehouse
227+ # make some changes, run tests again
228+ ./tests/015-basic-trusty-icehouse
229+
230+ * There may be test definitions in the tests/ dir which are not set +x
231+ executable. This is generally true for deprecated releases, or for
232+ upcoming releases which are not yet validated and enabled. To enable
233+ and run these tests:
234+ bzr branch lp:charms/trusty/foo
235+ cd foo
236+ ls tests
237+ chmod +x tests/017-basic-trusty-kilo
238+ ./tests/setup/00-setup
239+ juju bootstrap
240+ ./tests/017-basic-trusty-kilo
241+
242+
243+Additional notes:
244+
245+ * Use DEBUG to turn on debug logging, use ERROR otherwise.
246+ u = OpenStackAmuletUtils(ERROR)
247+ u = OpenStackAmuletUtils(DEBUG)
248+
249+ * To interact with the deployed environment:
250 export OS_USERNAME=admin
251 export OS_PASSWORD=openstack
252- export OS_REGION_NAME=RegionOne
253-
254- * Set the following env vars before using the OpenStack CLI as demoUser:
255- export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0
256- export OS_TENANT_NAME=demoTenant
257- export OS_USERNAME=demoUser
258- export OS_PASSWORD=password
259- export OS_REGION_NAME=RegionOne
260+ export OS_TENANT_NAME=admin
261+ export OS_REGION_NAME=RegionOne
262+ export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0
263+ keystone user-list
264+ glance image-list
265
266=== added directory 'tests/setup'
267=== renamed file 'tests/00-setup' => 'tests/setup/00-setup'
268=== modified file 'tests/tests.yaml'
269--- tests/tests.yaml 2015-10-06 14:11:37 +0000
270+++ tests/tests.yaml 2016-01-08 21:46:29 +0000
271@@ -1,5 +1,5 @@
272 bootstrap: true
273-reset: true
274+reset: false
275 virtualenv: true
276 makefile:
277 - lint
278@@ -9,6 +9,7 @@
279 packages:
280 - amulet
281 - distro-info-data
282+ - python-ceilometerclient
283 - python-cinderclient
284 - python-distro-info
285 - python-glanceclient

Subscribers

People subscribed via source and target branches