Merge lp:~1chb1n/charms/trusty/ceph/next.1601-test-update1 into lp:~openstack-charmers-archive/charms/trusty/ceph/next
- Trusty Tahr (14.04)
- next.1601-test-update1
- Merge into 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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenStack Charmers | Pending | ||
Review via email: mp+282065@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 #15768 ceph-next for 1chb1n mp282065
UNIT OK: passed
- 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
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://
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 | 13 | 13 | ||
6 | 14 | functional_test: | 14 | functional_test: |
7 | 15 | @echo Starting Amulet tests... | 15 | @echo Starting Amulet 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:29 +0000 | |||
16 | @@ -0,0 +1,11 @@ | |||
17 | 1 | #!/usr/bin/python | ||
18 | 2 | |||
19 | 3 | """Amulet tests on a basic ceph deployment on trusty-liberty.""" | ||
20 | 4 | |||
21 | 5 | from basic_deployment import CephBasicDeployment | ||
22 | 6 | |||
23 | 7 | if __name__ == '__main__': | ||
24 | 8 | deployment = CephBasicDeployment(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:29 +0000 | |||
32 | @@ -0,0 +1,11 @@ | |||
33 | 1 | #!/usr/bin/python | ||
34 | 2 | |||
35 | 3 | """Amulet tests on a basic ceph deployment on trusty-liberty.""" | ||
36 | 4 | |||
37 | 5 | from basic_deployment import CephBasicDeployment | ||
38 | 6 | |||
39 | 7 | if __name__ == '__main__': | ||
40 | 8 | deployment = CephBasicDeployment(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-15 20:40:45 +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 ceph deployment on vivid-kilo.""" | ||
52 | 4 | |||
53 | 5 | from basic_deployment import CephBasicDeployment | ||
54 | 6 | |||
55 | 7 | if __name__ == '__main__': | ||
56 | 8 | deployment = CephBasicDeployment(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:29 +0000 | |||
62 | @@ -0,0 +1,9 @@ | |||
63 | 1 | #!/usr/bin/python | ||
64 | 2 | |||
65 | 3 | """Amulet tests on a basic ceph deployment on wily-liberty.""" | ||
66 | 4 | |||
67 | 5 | from basic_deployment import CephBasicDeployment | ||
68 | 6 | |||
69 | 7 | if __name__ == '__main__': | ||
70 | 8 | deployment = CephBasicDeployment(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:29 +0000 | |||
76 | @@ -0,0 +1,9 @@ | |||
77 | 1 | #!/usr/bin/python | ||
78 | 2 | |||
79 | 3 | """Amulet tests on a basic ceph deployment on xenial-mitaka.""" | ||
80 | 4 | |||
81 | 5 | from basic_deployment import CephBasicDeployment | ||
82 | 6 | |||
83 | 7 | if __name__ == '__main__': | ||
84 | 8 | deployment = CephBasicDeployment(series='xenial') | ||
85 | 9 | deployment.run_tests() | ||
86 | 0 | 10 | ||
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 @@ | |||
97 | 1 | This directory provides Amulet tests that focus on verification of ceph | 1 | This directory provides Amulet tests to verify basic deployment functionality |
98 | 2 | deployments. | 2 | from the perspective of this charm, its requirements and its features, as |
99 | 3 | 3 | exercised in a subset of the full OpenStack deployment test bundle topology. | |
100 | 4 | test_* methods are called in lexical sort order. | 4 | |
101 | 5 | 5 | Reference: lp:openstack-charm-testing for full test bundles. | |
102 | 6 | Test name convention to ensure desired test order: | 6 | |
103 | 7 | A single topology and configuration is defined and deployed, once for each of | ||
104 | 8 | the defined Ubuntu:OpenStack release combos. The ongoing goal is for this | ||
105 | 9 | charm to always possess tests and combo definitions for all currently-supported | ||
106 | 10 | release combinations of U:OS. | ||
107 | 11 | |||
108 | 12 | test_* methods are called in lexical sort order, as with most runners. However, | ||
109 | 13 | each individual test method should be idempotent and expected to pass regardless | ||
110 | 14 | of run order or Ubuntu:OpenStack combo. When writing or modifying tests, | ||
111 | 15 | ensure that every individual test is not dependent on another test_ method. | ||
112 | 16 | |||
113 | 17 | Test naming convention, purely for code organization purposes: | ||
114 | 7 | 1xx service and endpoint checks | 18 | 1xx service and endpoint checks |
115 | 8 | 2xx relation checks | 19 | 2xx relation checks |
116 | 9 | 3xx config checks | 20 | 3xx config checks |
117 | 10 | 4xx functional checks | 21 | 4xx functional checks |
137 | 11 | 9xx restarts and other final checks | 22 | 9xx restarts, config changes, actions and other final checks |
138 | 12 | 23 | ||
139 | 13 | Common uses of ceph relations in bundle deployments: | 24 | In order to run tests, charm-tools and juju must be installed: |
121 | 14 | - [ nova-compute, ceph ] | ||
122 | 15 | - [ glance, ceph ] | ||
123 | 16 | - [ cinder, cinder-ceph ] | ||
124 | 17 | - [ cinder-ceph, ceph ] | ||
125 | 18 | |||
126 | 19 | More detailed relations of ceph service in a common deployment: | ||
127 | 20 | relations: | ||
128 | 21 | client: | ||
129 | 22 | - cinder-ceph | ||
130 | 23 | - glance | ||
131 | 24 | - nova-compute | ||
132 | 25 | mon: | ||
133 | 26 | - ceph | ||
134 | 27 | |||
135 | 28 | In order to run tests, you'll need charm-tools installed (in addition to | ||
136 | 29 | juju, of course): | ||
140 | 30 | sudo add-apt-repository ppa:juju/stable | 25 | sudo add-apt-repository ppa:juju/stable |
141 | 31 | sudo apt-get update | 26 | sudo apt-get update |
146 | 32 | sudo apt-get install charm-tools | 27 | sudo apt-get install charm-tools juju juju-deployer amulet |
147 | 33 | 28 | ||
148 | 34 | 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 |
149 | 35 | AMULET_HTTP_PROXY environment variable to the http URL of the proxy server. | 30 | of juju and related tools: |
150 | 31 | |||
151 | 32 | # juju proposed version | ||
152 | 33 | sudo add-apt-repository ppa:juju/proposed | ||
153 | 34 | sudo apt-get update | ||
154 | 35 | sudo apt-get install charm-tools juju juju-deployer | ||
155 | 36 | |||
156 | 37 | # juju development version | ||
157 | 38 | sudo add-apt-repository ppa:juju/devel | ||
158 | 39 | sudo apt-get update | ||
159 | 40 | sudo apt-get install charm-tools juju juju-deployer | ||
160 | 41 | |||
161 | 42 | Some tests may need to download files. If a web proxy server is required in | ||
162 | 43 | the environment, the AMULET_HTTP_PROXY environment variable must be set and | ||
163 | 44 | passed into the juju test command. This is unrelated to juju's http proxy | ||
164 | 45 | settings or behavior. | ||
165 | 36 | 46 | ||
166 | 37 | The following examples demonstrate different ways that tests can be executed. | 47 | The following examples demonstrate different ways that tests can be executed. |
167 | 38 | All examples are run from the charm's root directory. | 48 | All examples are run from the charm's root directory. |
168 | 39 | 49 | ||
181 | 40 | * To run all tests (starting with 00-setup): | 50 | * To run all +x tests in the tests directory: |
182 | 41 | 51 | ||
183 | 42 | make test | 52 | bzr branch lp:charms/trusty/foo |
184 | 43 | 53 | cd foo | |
185 | 44 | * To run a specific test module (or modules): | 54 | make functional_test |
186 | 45 | 55 | ||
187 | 46 | 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/: |
188 | 47 | 57 | ||
189 | 48 | * To run a specific test module (or modules), and keep the environment | 58 | bzr branch lp:charms/trusty/foo |
190 | 49 | deployed after a failure: | 59 | cd foo |
191 | 50 | 60 | juju test -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse | |
192 | 51 | juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse | 61 | |
193 | 62 | * To run tests and keep the juju environment deployed after a failure: | ||
194 | 63 | |||
195 | 64 | bzr branch lp:charms/trusty/foo | ||
196 | 65 | cd foo | ||
197 | 66 | juju test --set-e -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse | ||
198 | 52 | 67 | ||
199 | 53 | * 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 |
200 | 54 | 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'): |
201 | 55 | 70 | ||
214 | 56 | ./tests/15-basic-trusty-icehouse | 71 | ./tests/015-basic-trusty-icehouse |
215 | 57 | 72 | ||
216 | 58 | For debugging and test development purposes, all code should be idempotent. | 73 | * Even with --set-e, `juju test` will tear down the deployment when all |
217 | 59 | In other words, the code should have the ability to be re-run without changing | 74 | tests pass. The following work flow may be more effective when |
218 | 60 | the results beyond the initial run. This enables editing and re-running of a | 75 | iterating on test writing. |
219 | 61 | test module against an already deployed environment, as described above. | 76 | |
220 | 62 | 77 | bzr branch lp:charms/trusty/foo | |
221 | 63 | Manual debugging tips: | 78 | cd foo |
222 | 64 | 79 | ./tests/setup/00-setup | |
223 | 65 | * Set the following env vars before using the OpenStack CLI as admin: | 80 | juju bootstrap |
224 | 66 | export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0 | 81 | ./tests/015-basic-trusty-icehouse |
225 | 67 | export OS_TENANT_NAME=admin | 82 | # make some changes, run tests again |
226 | 83 | ./tests/015-basic-trusty-icehouse | ||
227 | 84 | # make some changes, run tests again | ||
228 | 85 | ./tests/015-basic-trusty-icehouse | ||
229 | 86 | |||
230 | 87 | * There may be test definitions in the tests/ dir which are not set +x | ||
231 | 88 | executable. This is generally true for deprecated releases, or for | ||
232 | 89 | upcoming releases which are not yet validated and enabled. To enable | ||
233 | 90 | and run these tests: | ||
234 | 91 | bzr branch lp:charms/trusty/foo | ||
235 | 92 | cd foo | ||
236 | 93 | ls tests | ||
237 | 94 | chmod +x tests/017-basic-trusty-kilo | ||
238 | 95 | ./tests/setup/00-setup | ||
239 | 96 | juju bootstrap | ||
240 | 97 | ./tests/017-basic-trusty-kilo | ||
241 | 98 | |||
242 | 99 | |||
243 | 100 | Additional notes: | ||
244 | 101 | |||
245 | 102 | * Use DEBUG to turn on debug logging, use ERROR otherwise. | ||
246 | 103 | u = OpenStackAmuletUtils(ERROR) | ||
247 | 104 | u = OpenStackAmuletUtils(DEBUG) | ||
248 | 105 | |||
249 | 106 | * To interact with the deployed environment: | ||
250 | 68 | export OS_USERNAME=admin | 107 | export OS_USERNAME=admin |
251 | 69 | export OS_PASSWORD=openstack | 108 | export OS_PASSWORD=openstack |
260 | 70 | export OS_REGION_NAME=RegionOne | 109 | export OS_TENANT_NAME=admin |
261 | 71 | 110 | export OS_REGION_NAME=RegionOne | |
262 | 72 | * Set the following env vars before using the OpenStack CLI as demoUser: | 111 | export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0 |
263 | 73 | export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0 | 112 | keystone user-list |
264 | 74 | export OS_TENANT_NAME=demoTenant | 113 | glance image-list |
257 | 75 | export OS_USERNAME=demoUser | ||
258 | 76 | export OS_PASSWORD=password | ||
259 | 77 | export OS_REGION_NAME=RegionOne | ||
265 | 78 | 114 | ||
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 | 1 | bootstrap: true | 1 | bootstrap: true |
274 | 2 | reset: true | 2 | reset: false |
275 | 3 | virtualenv: true | 3 | virtualenv: true |
276 | 4 | makefile: | 4 | makefile: |
277 | 5 | - lint | 5 | - lint |
278 | @@ -9,6 +9,7 @@ | |||
279 | 9 | packages: | 9 | packages: |
280 | 10 | - amulet | 10 | - amulet |
281 | 11 | - distro-info-data | 11 | - distro-info-data |
282 | 12 | - python-ceilometerclient | ||
283 | 12 | - python-cinderclient | 13 | - python-cinderclient |
284 | 13 | - python-distro-info | 14 | - python-distro-info |
285 | 14 | - python-glanceclient | 15 | - python-glanceclient |
charm_lint_check #16881 ceph-next for 1chb1n mp282065
LINT OK: passed
Build: http:// 10.245. 162.77: 8080/job/ charm_lint_ check/16881/