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

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 160
Proposed branch: lp:~1chb1n/charms/trusty/neutron-gateway/next.1601-test-update1
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-gateway/next
Diff against target: 242 lines (+119/-56)
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/-46)
tests/tests.yaml (+2/-1)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/neutron-gateway/next.1601-test-update1
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+282075@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 #16873 neutron-gateway-next for 1chb1n mp282075
    LINT OK: passed

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

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

charm_unit_test #15756 neutron-gateway-next for 1chb1n mp282075
    UNIT OK: passed

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

159. By Ryan Beisner

remove amulet tests for unsupported releases

160. By Ryan Beisner

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

161. By Ryan Beisner

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

162. By Ryan Beisner

Update tests/README

163. By Ryan Beisner

Update bundletester testplan yaml file

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

charm_lint_check #16887 neutron-gateway-next for 1chb1n mp282075
    LINT OK: passed

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

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

charm_unit_test #15781 neutron-gateway-next for 1chb1n mp282075
    UNIT OK: passed

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

Revision history for this message
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-10-06 16:24:24 +0000
3+++ Makefile 2016-01-08 21:47:54 +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:47:54 +0000
17@@ -0,0 +1,11 @@
18+#!/usr/bin/python
19+
20+"""Amulet tests on a basic quantum-gateway deployment on trusty-liberty."""
21+
22+from basic_deployment import NeutronGatewayBasicDeployment
23+
24+if __name__ == '__main__':
25+ deployment = NeutronGatewayBasicDeployment(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-22 04:58:53 +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 quantum-gateway deployment on vivid-kilo."""
37-
38-from basic_deployment import NeutronGatewayBasicDeployment
39-
40-if __name__ == '__main__':
41- deployment = NeutronGatewayBasicDeployment(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:47:54 +0000
48@@ -0,0 +1,9 @@
49+#!/usr/bin/python
50+
51+"""Amulet tests on a basic quantum-gateway deployment on xenial-mitaka."""
52+
53+from basic_deployment import NeutronGatewayBasicDeployment
54+
55+if __name__ == '__main__':
56+ deployment = NeutronGatewayBasicDeployment(series='xenial')
57+ deployment.run_tests()
58
59=== modified file 'tests/README'
60--- tests/README 2015-08-22 04:58:53 +0000
61+++ tests/README 2016-01-08 21:47:54 +0000
62@@ -1,63 +1,113 @@
63-This directory provides Amulet tests that focus on verification of
64-quantum-gateway 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+ export OS_TENANT_NAME=admin
218+ export OS_REGION_NAME=RegionOne
219+ export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0
220+ keystone user-list
221+ glance image-list
222
223=== added directory 'tests/setup'
224=== renamed file 'tests/00-setup' => 'tests/setup/00-setup'
225=== modified file 'tests/tests.yaml'
226--- tests/tests.yaml 2015-10-06 14:11:55 +0000
227+++ tests/tests.yaml 2016-01-08 21:47:54 +0000
228@@ -1,5 +1,5 @@
229 bootstrap: true
230-reset: true
231+reset: false
232 virtualenv: true
233 makefile:
234 - lint
235@@ -9,6 +9,7 @@
236 packages:
237 - amulet
238 - distro-info-data
239+ - python-ceilometerclient
240 - python-cinderclient
241 - python-distro-info
242 - python-glanceclient

Subscribers

People subscribed via source and target branches