Merge lp:~1chb1n/charms/trusty/cinder/next.1601-test-update1 into lp:~openstack-charmers-archive/charms/trusty/cinder/next
- Trusty Tahr (14.04)
- next.1601-test-update1
- Merge into next
Proposed by
Ryan Beisner
Status: | Merged |
---|---|
Merged at revision: | 142 |
Proposed branch: | lp:~1chb1n/charms/trusty/cinder/next.1601-test-update1 |
Merge into: | lp:~openstack-charmers-archive/charms/trusty/cinder/next |
Diff against target: |
300 lines (+129/-81) 9 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/054-basic-vivid-kilo-git (+0/-9) tests/README (+86/-62) tests/tests.yaml (+2/-1) |
To merge this branch: | bzr merge lp:~1chb1n/charms/trusty/cinder/next.1601-test-update1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Liam Young (community) | Approve | ||
Review via email: mp+282068@code.launchpad.net |
Commit message
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 : | # |
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #15767 cinder-next for 1chb1n mp282068
UNIT OK: passed
- 141. By Ryan Beisner
-
remove amulet tests for unsupported releases
- 142. By Ryan Beisner
-
Move 00-setup to prevent extra, unnecessary bootstrap in test runs.
- 143. By Ryan Beisner
-
Re-number amulet test file names; add missing combos as not-executable for now.
- 144. By Ryan Beisner
-
Update tests/README
- 145. By Ryan Beisner
-
Update bundletester testplan yaml file
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #16889 cinder-next for 1chb1n mp282068
LINT OK: passed
Build: http://
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #15780 cinder-next for 1chb1n mp282068
UNIT OK: passed
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-29 04:46:01 +0000 | |||
3 | +++ Makefile 2016-01-08 21:46:50 +0000 | |||
4 | @@ -13,6 +13,7 @@ | |||
5 | 13 | 13 | ||
6 | 14 | functional_test: | 14 | functional_test: |
7 | 15 | @echo Starting amulet deployment tests... | 15 | @echo Starting amulet deployment tests... |
8 | 16 | @tests/setup/00-setup | ||
9 | 16 | @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 2700 | 17 | @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 2700 |
10 | 17 | 18 | ||
11 | 18 | bin/charm_helpers_sync.py: | 19 | bin/charm_helpers_sync.py: |
12 | 19 | 20 | ||
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:50 +0000 | |||
16 | @@ -0,0 +1,11 @@ | |||
17 | 1 | #!/usr/bin/python | ||
18 | 2 | |||
19 | 3 | """Amulet tests on a basic cinder deployment on trusty-liberty.""" | ||
20 | 4 | |||
21 | 5 | from basic_deployment import CinderBasicDeployment | ||
22 | 6 | |||
23 | 7 | if __name__ == '__main__': | ||
24 | 8 | deployment = CinderBasicDeployment(series='trusty', | ||
25 | 9 | openstack='cloud:trusty-liberty', | ||
26 | 10 | source='cloud:trusty-updates/liberty') | ||
27 | 11 | deployment.run_tests() | ||
28 | 0 | 12 | ||
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:50 +0000 | |||
32 | @@ -0,0 +1,11 @@ | |||
33 | 1 | #!/usr/bin/python | ||
34 | 2 | |||
35 | 3 | """Amulet tests on a basic cinder deployment on trusty-liberty.""" | ||
36 | 4 | |||
37 | 5 | from basic_deployment import CinderBasicDeployment | ||
38 | 6 | |||
39 | 7 | if __name__ == '__main__': | ||
40 | 8 | deployment = CinderBasicDeployment(series='trusty', | ||
41 | 9 | openstack='cloud:trusty-liberty', | ||
42 | 10 | source='cloud:trusty-updates/liberty') | ||
43 | 11 | deployment.run_tests() | ||
44 | 0 | 12 | ||
45 | === removed file 'tests/019-basic-vivid-kilo' | |||
46 | --- tests/019-basic-vivid-kilo 2015-06-23 23:52:07 +0000 | |||
47 | +++ tests/019-basic-vivid-kilo 1970-01-01 00:00:00 +0000 | |||
48 | @@ -1,9 +0,0 @@ | |||
49 | 1 | #!/usr/bin/python | ||
50 | 2 | |||
51 | 3 | """Amulet tests on a basic Cinder deployment on vivid-kilo.""" | ||
52 | 4 | |||
53 | 5 | from basic_deployment import CinderBasicDeployment | ||
54 | 6 | |||
55 | 7 | if __name__ == '__main__': | ||
56 | 8 | deployment = CinderBasicDeployment(series='vivid') | ||
57 | 9 | deployment.run_tests() | ||
58 | 10 | 0 | ||
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:50 +0000 | |||
62 | @@ -0,0 +1,9 @@ | |||
63 | 1 | #!/usr/bin/python | ||
64 | 2 | |||
65 | 3 | """Amulet tests on a basic Cinder deployment on wily-liberty.""" | ||
66 | 4 | |||
67 | 5 | from basic_deployment import CinderBasicDeployment | ||
68 | 6 | |||
69 | 7 | if __name__ == '__main__': | ||
70 | 8 | deployment = CinderBasicDeployment(series='wily') | ||
71 | 9 | deployment.run_tests() | ||
72 | 0 | 10 | ||
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:50 +0000 | |||
76 | @@ -0,0 +1,9 @@ | |||
77 | 1 | #!/usr/bin/python | ||
78 | 2 | |||
79 | 3 | """Amulet tests on a basic Cinder deployment on xenial-mitaka.""" | ||
80 | 4 | |||
81 | 5 | from basic_deployment import CinderBasicDeployment | ||
82 | 6 | |||
83 | 7 | if __name__ == '__main__': | ||
84 | 8 | deployment = CinderBasicDeployment(series='xenial') | ||
85 | 9 | deployment.run_tests() | ||
86 | 0 | 10 | ||
87 | === removed file 'tests/054-basic-vivid-kilo-git' | |||
88 | --- tests/054-basic-vivid-kilo-git 2015-06-23 23:52:07 +0000 | |||
89 | +++ tests/054-basic-vivid-kilo-git 1970-01-01 00:00:00 +0000 | |||
90 | @@ -1,9 +0,0 @@ | |||
91 | 1 | #!/usr/bin/python | ||
92 | 2 | |||
93 | 3 | """Amulet tests on a basic Cinder git deployment on vivid-kilo.""" | ||
94 | 4 | |||
95 | 5 | from basic_deployment import CinderBasicDeployment | ||
96 | 6 | |||
97 | 7 | if __name__ == '__main__': | ||
98 | 8 | deployment = CinderBasicDeployment(series='vivid', git=True) | ||
99 | 9 | deployment.run_tests() | ||
100 | 10 | 0 | ||
101 | === modified file 'tests/README' | |||
102 | --- tests/README 2015-06-23 23:52:07 +0000 | |||
103 | +++ tests/README 2016-01-08 21:46:50 +0000 | |||
104 | @@ -1,89 +1,113 @@ | |||
111 | 1 | This directory provides Amulet tests that focus on verification of Cinder | 1 | This directory provides Amulet tests to verify basic deployment functionality |
112 | 2 | deployments. | 2 | from the perspective of this charm, its requirements and its features, as |
113 | 3 | 3 | exercised in a subset of the full OpenStack deployment test bundle topology. | |
114 | 4 | test_* methods are called in lexical sort order. | 4 | |
115 | 5 | 5 | Reference: lp:openstack-charm-testing for full test bundles. | |
116 | 6 | Test name convention to ensure desired test order: | 6 | |
117 | 7 | A single topology and configuration is defined and deployed, once for each of | ||
118 | 8 | the defined Ubuntu:OpenStack release combos. The ongoing goal is for this | ||
119 | 9 | charm to always possess tests and combo definitions for all currently-supported | ||
120 | 10 | release combinations of U:OS. | ||
121 | 11 | |||
122 | 12 | test_* methods are called in lexical sort order, as with most runners. However, | ||
123 | 13 | each individual test method should be idempotent and expected to pass regardless | ||
124 | 14 | of run order or Ubuntu:OpenStack combo. When writing or modifying tests, | ||
125 | 15 | ensure that every individual test is not dependent on another test_ method. | ||
126 | 16 | |||
127 | 17 | Test naming convention, purely for code organization purposes: | ||
128 | 7 | 1xx service and endpoint checks | 18 | 1xx service and endpoint checks |
129 | 8 | 2xx relation checks | 19 | 2xx relation checks |
130 | 9 | 3xx config checks | 20 | 3xx config checks |
131 | 10 | 4xx functional checks | 21 | 4xx functional checks |
133 | 11 | 9xx restarts and other final checks | 22 | 9xx restarts, config changes, actions and other final checks |
134 | 12 | 23 | ||
137 | 13 | In order to run tests, you'll need charm-tools installed (in addition to | 24 | In order to run tests, charm-tools and juju must be installed: |
136 | 14 | juju, of course): | ||
138 | 15 | sudo add-apt-repository ppa:juju/stable | 25 | sudo add-apt-repository ppa:juju/stable |
139 | 16 | sudo apt-get update | 26 | sudo apt-get update |
144 | 17 | sudo apt-get install charm-tools | 27 | sudo apt-get install charm-tools juju juju-deployer amulet |
145 | 18 | 28 | ||
146 | 19 | If you use a web proxy server to access the web, you'll need to set the | 29 | Alternatively, tests may be exercised with proposed or development versions |
147 | 20 | AMULET_HTTP_PROXY environment variable to the http URL of the proxy server. | 30 | of juju and related tools: |
148 | 31 | |||
149 | 32 | # juju proposed version | ||
150 | 33 | sudo add-apt-repository ppa:juju/proposed | ||
151 | 34 | sudo apt-get update | ||
152 | 35 | sudo apt-get install charm-tools juju juju-deployer | ||
153 | 36 | |||
154 | 37 | # juju development version | ||
155 | 38 | sudo add-apt-repository ppa:juju/devel | ||
156 | 39 | sudo apt-get update | ||
157 | 40 | sudo apt-get install charm-tools juju juju-deployer | ||
158 | 41 | |||
159 | 42 | Some tests may need to download files. If a web proxy server is required in | ||
160 | 43 | the environment, the AMULET_HTTP_PROXY environment variable must be set and | ||
161 | 44 | passed into the juju test command. This is unrelated to juju's http proxy | ||
162 | 45 | settings or behavior. | ||
163 | 21 | 46 | ||
164 | 22 | The following examples demonstrate different ways that tests can be executed. | 47 | The following examples demonstrate different ways that tests can be executed. |
165 | 23 | All examples are run from the charm's root directory. | 48 | All examples are run from the charm's root directory. |
166 | 24 | 49 | ||
179 | 25 | * To run all tests (starting with 00-setup): | 50 | * To run all +x tests in the tests directory: |
180 | 26 | 51 | ||
181 | 27 | make test | 52 | bzr branch lp:charms/trusty/foo |
182 | 28 | 53 | cd foo | |
183 | 29 | * To run a specific test module (or modules): | 54 | make functional_test |
184 | 30 | 55 | ||
185 | 31 | juju test -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse | 56 | * To run the tests against a specific release combo as defined in tests/: |
186 | 32 | 57 | ||
187 | 33 | * To run a specific test module (or modules), and keep the environment | 58 | bzr branch lp:charms/trusty/foo |
188 | 34 | deployed after a failure: | 59 | cd foo |
189 | 35 | 60 | juju test -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse | |
190 | 36 | juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse | 61 | |
191 | 62 | * To run tests and keep the juju environment deployed after a failure: | ||
192 | 63 | |||
193 | 64 | bzr branch lp:charms/trusty/foo | ||
194 | 65 | cd foo | ||
195 | 66 | juju test --set-e -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse | ||
196 | 37 | 67 | ||
197 | 38 | * To re-run a test module against an already deployed environment (one | 68 | * To re-run a test module against an already deployed environment (one |
198 | 39 | that was deployed by a previous call to 'juju test --set-e'): | 69 | that was deployed by a previous call to 'juju test --set-e'): |
199 | 40 | 70 | ||
209 | 41 | ./tests/15-basic-trusty-icehouse | 71 | ./tests/015-basic-trusty-icehouse |
210 | 42 | 72 | ||
211 | 43 | 73 | * Even with --set-e, `juju test` will tear down the deployment when all | |
212 | 44 | For debugging and test development purposes, all code should be idempotent. | 74 | tests pass. The following work flow may be more effective when |
213 | 45 | In other words, the code should have the ability to be re-run without changing | 75 | iterating on test writing. |
214 | 46 | the results beyond the initial run. This enables editing and re-running of a | 76 | |
215 | 47 | test module against an already deployed environment, as described above. | 77 | bzr branch lp:charms/trusty/foo |
216 | 48 | 78 | cd foo | |
217 | 49 | Additional testing and debug information: | 79 | ./tests/setup/00-setup |
218 | 80 | juju bootstrap | ||
219 | 81 | ./tests/015-basic-trusty-icehouse | ||
220 | 82 | # make some changes, run tests again | ||
221 | 83 | ./tests/015-basic-trusty-icehouse | ||
222 | 84 | # make some changes, run tests again | ||
223 | 85 | ./tests/015-basic-trusty-icehouse | ||
224 | 86 | |||
225 | 87 | * There may be test definitions in the tests/ dir which are not set +x | ||
226 | 88 | executable. This is generally true for deprecated releases, or for | ||
227 | 89 | upcoming releases which are not yet validated and enabled. To enable | ||
228 | 90 | and run these tests: | ||
229 | 91 | bzr branch lp:charms/trusty/foo | ||
230 | 92 | cd foo | ||
231 | 93 | ls tests | ||
232 | 94 | chmod +x tests/017-basic-trusty-kilo | ||
233 | 95 | ./tests/setup/00-setup | ||
234 | 96 | juju bootstrap | ||
235 | 97 | ./tests/017-basic-trusty-kilo | ||
236 | 98 | |||
237 | 99 | |||
238 | 100 | Additional notes: | ||
239 | 50 | 101 | ||
240 | 51 | * Use DEBUG to turn on debug logging, use ERROR otherwise. | 102 | * Use DEBUG to turn on debug logging, use ERROR otherwise. |
241 | 52 | |||
242 | 53 | u = OpenStackAmuletUtils(ERROR) | 103 | u = OpenStackAmuletUtils(ERROR) |
243 | 54 | u = OpenStackAmuletUtils(DEBUG) | 104 | u = OpenStackAmuletUtils(DEBUG) |
244 | 55 | 105 | ||
245 | 56 | * To interact with the deployed environment: | 106 | * To interact with the deployed environment: |
246 | 57 | |||
247 | 58 | export OS_USERNAME=admin | 107 | export OS_USERNAME=admin |
248 | 59 | export OS_PASSWORD=openstack | 108 | export OS_PASSWORD=openstack |
249 | 60 | export OS_TENANT_NAME=admin | 109 | export OS_TENANT_NAME=admin |
250 | 61 | export OS_REGION_NAME=RegionOne | 110 | export OS_REGION_NAME=RegionOne |
251 | 62 | export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0 | 111 | export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0 |
252 | 63 | keystone user-list | 112 | keystone user-list |
279 | 64 | cinder list | 113 | glance image-list |
254 | 65 | |||
255 | 66 | * Handy commands for watching these tests run or manually poking around: | ||
256 | 67 | |||
257 | 68 | watch "cinder list && cinder snapshot-list && glance image-list" | ||
258 | 69 | watch "juju get cinder | egrep 'verbose|debug|true|false'" | ||
259 | 70 | watch "juju ssh cinder/0 'sudo lvs && sudo status cinder-api && sudo status cinder-volume'" | ||
260 | 71 | juju set cinder verbose=false && juju set cinder debug=false | ||
261 | 72 | |||
262 | 73 | * Be aware that method names that start with 'test_' are called in alpha/num | ||
263 | 74 | order. Test methods which are order-sensitive can be numbered to ensure | ||
264 | 75 | that they run in the expected order. ex: | ||
265 | 76 | |||
266 | 77 | test_000_earlytest | ||
267 | 78 | test_300_sometest | ||
268 | 79 | test_999_latertest | ||
269 | 80 | |||
270 | 81 | * Preserving the deployed environment: | ||
271 | 82 | Even with juju --set-e, amulet will tear down the juju environment | ||
272 | 83 | when all tests pass. This force_fail 'test' can be used in basic_deployment.py | ||
273 | 84 | to simulate a failed test and keep the environment. | ||
274 | 85 | |||
275 | 86 | def test_zzzz_fake_fail(self): | ||
276 | 87 | '''Force a fake fail to keep juju environment after a successful test run''' | ||
277 | 88 | # Useful in test writing, when used with: juju test --set-e | ||
278 | 89 | amulet.raise_status(amulet.FAIL, msg='using fake fail to keep juju environment') | ||
280 | 90 | 114 | ||
281 | === added directory 'tests/setup' | |||
282 | === renamed file 'tests/00-setup' => 'tests/setup/00-setup' | |||
283 | === modified file 'tests/tests.yaml' | |||
284 | --- tests/tests.yaml 2015-10-06 14:11:42 +0000 | |||
285 | +++ tests/tests.yaml 2016-01-08 21:46:50 +0000 | |||
286 | @@ -1,5 +1,5 @@ | |||
287 | 1 | bootstrap: true | 1 | bootstrap: true |
289 | 2 | reset: true | 2 | reset: false |
290 | 3 | virtualenv: true | 3 | virtualenv: true |
291 | 4 | makefile: | 4 | makefile: |
292 | 5 | - lint | 5 | - lint |
293 | @@ -9,6 +9,7 @@ | |||
294 | 9 | packages: | 9 | packages: |
295 | 10 | - amulet | 10 | - amulet |
296 | 11 | - distro-info-data | 11 | - distro-info-data |
297 | 12 | - python-ceilometerclient | ||
298 | 12 | - python-cinderclient | 13 | - python-cinderclient |
299 | 13 | - python-distro-info | 14 | - python-distro-info |
300 | 14 | - python-glanceclient | 15 | - python-glanceclient |
charm_lint_check #16877 cinder-next for 1chb1n mp282068
LINT OK: passed
Build: http:// 10.245. 162.77: 8080/job/ charm_lint_ check/16877/