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

Proposed by Ryan Beisner on 2016-01-08
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
Reviewer Review Type Date Requested Status
Liam Young 2016-01-08 Approve on 2016-01-12
Review via email: mp+282060@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.

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/
Build: http://10.245.162.77:8080/job/charm_unit_test/15732/

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://paste.ubuntu.com/14440510/
Build: http://10.245.162.77:8080/job/charm_lint_check/16851/

charm_unit_test #15748 swift-storage-next for 1chb1n mp282060
    UNIT OK: passed

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

charm_lint_check #16867 swift-storage-next for 1chb1n mp282060
    LINT OK: passed

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

100. By Ryan Beisner on 2016-01-08

remove amulet tests for unsupported releases

101. By Ryan Beisner on 2016-01-08

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

102. By Ryan Beisner on 2016-01-08

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

103. By Ryan Beisner on 2016-01-08

Update tests/README

104. By Ryan Beisner on 2016-01-08

Update bundletester testplan yaml file

charm_lint_check #16886 swift-storage-next for 1chb1n mp282060
    LINT OK: passed

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

charm_unit_test #15785 swift-storage-next for 1chb1n mp282060
    UNIT OK: passed

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

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

Subscribers

People subscribed via source and target branches