Merge lp:~1chb1n/charms/trusty/swift-storage/next.1601-test-update1 into lp:~openstack-charmers-archive/charms/trusty/swift-storage/next
- Trusty Tahr (14.04)
- next.1601-test-update1
- Merge into next
Status: | Merged |
---|---|
Merged at revision: | 100 |
Proposed branch: | lp:~1chb1n/charms/trusty/swift-storage/next.1601-test-update1 |
Merge into: | lp:~openstack-charmers-archive/charms/trusty/swift-storage/next |
Diff against target: |
247 lines (+119/-61) 6 files modified
Makefile (+1/-0) tests/019-basic-trusty-mitaka (+11/-0) tests/019-basic-vivid-kilo (+0/-9) tests/021-basic-xenial-mitaka (+9/-0) tests/README (+96/-51) tests/tests.yaml (+2/-1) |
To merge this branch: | bzr merge lp:~1chb1n/charms/trusty/swift-storage/next.1601-test-update1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Liam Young (community) | Approve | ||
Review via email: mp+282060@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.
uosci-testing-bot (uosci-testing-bot) wrote : | # |
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #16851 swift-storage-next for 1chb1n mp282060
LINT FAIL: lint-test failed
LINT Results (max last 2 lines):
Makefile:16: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
ERROR:root:Make target returned non-zero.
Full lint test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #15748 swift-storage-next for 1chb1n mp282060
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #16867 swift-storage-next for 1chb1n mp282060
LINT OK: passed
Build: http://
- 100. By Ryan Beisner
-
remove amulet tests for unsupported releases
- 101. By Ryan Beisner
-
Move 00-setup to prevent extra, unnecessary bootstrap in test runs.
- 102. By Ryan Beisner
-
Re-number amulet test file names; add missing combos as not-executable for now.
- 103. By Ryan Beisner
-
Update tests/README
- 104. By Ryan Beisner
-
Update bundletester testplan yaml file
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #16886 swift-storage-next for 1chb1n mp282060
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #15785 swift-storage-next for 1chb1n mp282060
UNIT OK: passed
Preview Diff
1 | === modified file 'Makefile' | |||
2 | --- Makefile 2015-08-22 04:12:14 +0000 | |||
3 | +++ Makefile 2016-01-08 21:48:14 +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 | === renamed file 'tests/020-basic-trusty-liberty' => 'tests/018-basic-trusty-liberty' | |||
14 | === added file 'tests/019-basic-trusty-mitaka' | |||
15 | --- tests/019-basic-trusty-mitaka 1970-01-01 00:00:00 +0000 | |||
16 | +++ tests/019-basic-trusty-mitaka 2016-01-08 21:48:14 +0000 | |||
17 | @@ -0,0 +1,11 @@ | |||
18 | 1 | #!/usr/bin/python | ||
19 | 2 | |||
20 | 3 | """Amulet tests on a basic swift-storage deployment on trusty-liberty.""" | ||
21 | 4 | |||
22 | 5 | from basic_deployment import SwiftStorageBasicDeployment | ||
23 | 6 | |||
24 | 7 | if __name__ == '__main__': | ||
25 | 8 | deployment = SwiftStorageBasicDeployment(series='trusty', | ||
26 | 9 | openstack='cloud:trusty-liberty', | ||
27 | 10 | source='cloud:trusty-updates/liberty') | ||
28 | 11 | deployment.run_tests() | ||
29 | 0 | 12 | ||
30 | === removed file 'tests/019-basic-vivid-kilo' | |||
31 | --- tests/019-basic-vivid-kilo 2015-08-21 17:40:45 +0000 | |||
32 | +++ tests/019-basic-vivid-kilo 1970-01-01 00:00:00 +0000 | |||
33 | @@ -1,9 +0,0 @@ | |||
34 | 1 | #!/usr/bin/python | ||
35 | 2 | |||
36 | 3 | """Amulet tests on a basic swift-storage deployment on vivid-kilo.""" | ||
37 | 4 | |||
38 | 5 | from basic_deployment import SwiftStorageBasicDeployment | ||
39 | 6 | |||
40 | 7 | if __name__ == '__main__': | ||
41 | 8 | deployment = SwiftStorageBasicDeployment(series='vivid') | ||
42 | 9 | deployment.run_tests() | ||
43 | 10 | 0 | ||
44 | === renamed file 'tests/021-basic-wily-liberty' => 'tests/020-basic-wily-liberty' | |||
45 | === added file 'tests/021-basic-xenial-mitaka' | |||
46 | --- tests/021-basic-xenial-mitaka 1970-01-01 00:00:00 +0000 | |||
47 | +++ tests/021-basic-xenial-mitaka 2016-01-08 21:48:14 +0000 | |||
48 | @@ -0,0 +1,9 @@ | |||
49 | 1 | #!/usr/bin/python | ||
50 | 2 | |||
51 | 3 | """Amulet tests on a basic swift-storage deployment on xenial-mitaka.""" | ||
52 | 4 | |||
53 | 5 | from basic_deployment import SwiftStorageBasicDeployment | ||
54 | 6 | |||
55 | 7 | if __name__ == '__main__': | ||
56 | 8 | deployment = SwiftStorageBasicDeployment(series='xenial') | ||
57 | 9 | deployment.run_tests() | ||
58 | 0 | 10 | ||
59 | === modified file 'tests/README' | |||
60 | --- tests/README 2015-08-21 15:18:31 +0000 | |||
61 | +++ tests/README 2016-01-08 21:48:14 +0000 | |||
62 | @@ -1,68 +1,113 @@ | |||
70 | 1 | This directory provides Amulet tests that focus on verification of swift-storage | 1 | This directory provides Amulet tests to verify basic deployment functionality |
71 | 2 | deployments. | 2 | from the perspective of this charm, its requirements and its features, as |
72 | 3 | 3 | exercised in a subset of the full OpenStack deployment test bundle topology. | |
73 | 4 | test_* methods are called in lexical sort order, although each individual test | 4 | |
74 | 5 | should be idempotent, and expected to pass regardless of run order. | 5 | Reference: lp:openstack-charm-testing for full test bundles. |
75 | 6 | 6 | ||
76 | 7 | Test name convention to ensure desired test order: | 7 | A single topology and configuration is defined and deployed, once for each of |
77 | 8 | the defined Ubuntu:OpenStack release combos. The ongoing goal is for this | ||
78 | 9 | charm to always possess tests and combo definitions for all currently-supported | ||
79 | 10 | release combinations of U:OS. | ||
80 | 11 | |||
81 | 12 | test_* methods are called in lexical sort order, as with most runners. However, | ||
82 | 13 | each individual test method should be idempotent and expected to pass regardless | ||
83 | 14 | of run order or Ubuntu:OpenStack combo. When writing or modifying tests, | ||
84 | 15 | ensure that every individual test is not dependent on another test_ method. | ||
85 | 16 | |||
86 | 17 | Test naming convention, purely for code organization purposes: | ||
87 | 8 | 1xx service and endpoint checks | 18 | 1xx service and endpoint checks |
88 | 9 | 2xx relation checks | 19 | 2xx relation checks |
89 | 10 | 3xx config checks | 20 | 3xx config checks |
90 | 11 | 4xx functional checks | 21 | 4xx functional checks |
92 | 12 | 9xx restarts and other final checks | 22 | 9xx restarts, config changes, actions and other final checks |
93 | 13 | 23 | ||
96 | 14 | 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: |
95 | 15 | juju, of course): | ||
97 | 16 | sudo add-apt-repository ppa:juju/stable | 25 | sudo add-apt-repository ppa:juju/stable |
98 | 17 | sudo apt-get update | 26 | sudo apt-get update |
103 | 18 | sudo apt-get install charm-tools | 27 | sudo apt-get install charm-tools juju juju-deployer amulet |
104 | 19 | 28 | ||
105 | 20 | 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 |
106 | 21 | AMULET_HTTP_PROXY environment variable to the http URL of the proxy server. | 30 | of juju and related tools: |
107 | 31 | |||
108 | 32 | # juju proposed version | ||
109 | 33 | sudo add-apt-repository ppa:juju/proposed | ||
110 | 34 | sudo apt-get update | ||
111 | 35 | sudo apt-get install charm-tools juju juju-deployer | ||
112 | 36 | |||
113 | 37 | # juju development version | ||
114 | 38 | sudo add-apt-repository ppa:juju/devel | ||
115 | 39 | sudo apt-get update | ||
116 | 40 | sudo apt-get install charm-tools juju juju-deployer | ||
117 | 41 | |||
118 | 42 | Some tests may need to download files. If a web proxy server is required in | ||
119 | 43 | the environment, the AMULET_HTTP_PROXY environment variable must be set and | ||
120 | 44 | passed into the juju test command. This is unrelated to juju's http proxy | ||
121 | 45 | settings or behavior. | ||
122 | 22 | 46 | ||
123 | 23 | The following examples demonstrate different ways that tests can be executed. | 47 | The following examples demonstrate different ways that tests can be executed. |
124 | 24 | All examples are run from the charm's root directory. | 48 | All examples are run from the charm's root directory. |
125 | 25 | 49 | ||
138 | 26 | * To run all tests (starting with 00-setup): | 50 | * To run all +x tests in the tests directory: |
139 | 27 | 51 | ||
140 | 28 | make test | 52 | bzr branch lp:charms/trusty/foo |
141 | 29 | 53 | cd foo | |
142 | 30 | * To run a specific test module (or modules): | 54 | make functional_test |
143 | 31 | 55 | ||
144 | 32 | 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/: |
145 | 33 | 57 | ||
146 | 34 | * To run a specific test module (or modules), and keep the environment | 58 | bzr branch lp:charms/trusty/foo |
147 | 35 | deployed after a failure: | 59 | cd foo |
148 | 36 | 60 | juju test -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse | |
149 | 37 | juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse | 61 | |
150 | 62 | * To run tests and keep the juju environment deployed after a failure: | ||
151 | 63 | |||
152 | 64 | bzr branch lp:charms/trusty/foo | ||
153 | 65 | cd foo | ||
154 | 66 | juju test --set-e -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse | ||
155 | 38 | 67 | ||
156 | 39 | * 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 |
157 | 40 | 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'): |
158 | 41 | 70 | ||
171 | 42 | ./tests/15-basic-trusty-icehouse | 71 | ./tests/015-basic-trusty-icehouse |
172 | 43 | 72 | ||
173 | 44 | 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 |
174 | 45 | 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 |
175 | 46 | the results beyond the initial run. This enables editing and re-running of a | 75 | iterating on test writing. |
176 | 47 | test module against an already deployed environment, as described above. | 76 | |
177 | 48 | 77 | bzr branch lp:charms/trusty/foo | |
178 | 49 | Manual debugging tips: | 78 | cd foo |
179 | 50 | 79 | ./tests/setup/00-setup | |
180 | 51 | * Set the following env vars before using the OpenStack CLI as admin: | 80 | juju bootstrap |
181 | 52 | export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0 | 81 | ./tests/015-basic-trusty-icehouse |
182 | 53 | export OS_TENANT_NAME=admin | 82 | # make some changes, run tests again |
183 | 83 | ./tests/015-basic-trusty-icehouse | ||
184 | 84 | # make some changes, run tests again | ||
185 | 85 | ./tests/015-basic-trusty-icehouse | ||
186 | 86 | |||
187 | 87 | * There may be test definitions in the tests/ dir which are not set +x | ||
188 | 88 | executable. This is generally true for deprecated releases, or for | ||
189 | 89 | upcoming releases which are not yet validated and enabled. To enable | ||
190 | 90 | and run these tests: | ||
191 | 91 | bzr branch lp:charms/trusty/foo | ||
192 | 92 | cd foo | ||
193 | 93 | ls tests | ||
194 | 94 | chmod +x tests/017-basic-trusty-kilo | ||
195 | 95 | ./tests/setup/00-setup | ||
196 | 96 | juju bootstrap | ||
197 | 97 | ./tests/017-basic-trusty-kilo | ||
198 | 98 | |||
199 | 99 | |||
200 | 100 | Additional notes: | ||
201 | 101 | |||
202 | 102 | * Use DEBUG to turn on debug logging, use ERROR otherwise. | ||
203 | 103 | u = OpenStackAmuletUtils(ERROR) | ||
204 | 104 | u = OpenStackAmuletUtils(DEBUG) | ||
205 | 105 | |||
206 | 106 | * To interact with the deployed environment: | ||
207 | 54 | export OS_USERNAME=admin | 107 | export OS_USERNAME=admin |
208 | 55 | export OS_PASSWORD=openstack | 108 | export OS_PASSWORD=openstack |
222 | 56 | export OS_REGION_NAME=RegionOne | 109 | export OS_TENANT_NAME=admin |
223 | 57 | 110 | export OS_REGION_NAME=RegionOne | |
224 | 58 | * 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 |
225 | 59 | export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0 | 112 | keystone user-list |
226 | 60 | export OS_TENANT_NAME=demoTenant | 113 | glance image-list |
214 | 61 | export OS_USERNAME=demoUser | ||
215 | 62 | export OS_PASSWORD=password | ||
216 | 63 | export OS_REGION_NAME=RegionOne | ||
217 | 64 | |||
218 | 65 | * Sample swift command: | ||
219 | 66 | swift -A $OS_AUTH_URL --os-tenant-name services --os-username swift \ | ||
220 | 67 | --os-password password list | ||
221 | 68 | (where tenant/user names and password are in swift-proxy's nova.conf file) | ||
227 | 69 | 114 | ||
228 | === added directory 'tests/setup' | |||
229 | === renamed file 'tests/00-setup' => 'tests/setup/00-setup' | |||
230 | === modified file 'tests/tests.yaml' | |||
231 | --- tests/tests.yaml 2015-10-06 14:11:59 +0000 | |||
232 | +++ tests/tests.yaml 2016-01-08 21:48:14 +0000 | |||
233 | @@ -1,5 +1,5 @@ | |||
234 | 1 | bootstrap: true | 1 | bootstrap: true |
236 | 2 | reset: true | 2 | reset: false |
237 | 3 | virtualenv: true | 3 | virtualenv: true |
238 | 4 | makefile: | 4 | makefile: |
239 | 5 | - lint | 5 | - lint |
240 | @@ -9,6 +9,7 @@ | |||
241 | 9 | packages: | 9 | packages: |
242 | 10 | - amulet | 10 | - amulet |
243 | 11 | - distro-info-data | 11 | - distro-info-data |
244 | 12 | - python-ceilometerclient | ||
245 | 12 | - python-cinderclient | 13 | - python-cinderclient |
246 | 13 | - python-distro-info | 14 | - python-distro-info |
247 | 14 | - python-glanceclient | 15 | - python-glanceclient |
charm_unit_test #15732 swift-storage-next for 1chb1n mp282060
UNIT FAIL: unit-test failed
UNIT Results (max last 2 lines):
Makefile:16: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
ERROR:root:Make target returned non-zero.
Full unit test output: http:// paste.ubuntu. com/14440499/ 10.245. 162.77: 8080/job/ charm_unit_ test/15732/
Build: http://