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

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 102
Proposed branch: lp:~1chb1n/charms/trusty/neutron-openvswitch/next.1601-test-update1
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next
Diff against target: 265 lines (+144/-51)
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 (+101/-41)
tests/tests.yaml (+2/-1)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/neutron-openvswitch/next.1601-test-update1
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+282057@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 #16847 neutron-openvswitch-next for 1chb1n mp282057
    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/14440500/
Build: http://10.245.162.77:8080/job/charm_lint_check/16847/

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

charm_unit_test #15741 neutron-openvswitch-next for 1chb1n mp282057
    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/14440522/
Build: http://10.245.162.77:8080/job/charm_unit_test/15741/

100. By Corey Bryant

[corey.bryant,r=osci] Enable sync of payload.archive and sync charm-helpers

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

charm_lint_check #16866 neutron-openvswitch-next for 1chb1n mp282057
    LINT OK: passed

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

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

charm_unit_test #15752 neutron-openvswitch-next for 1chb1n mp282057
    UNIT OK: passed

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

101. By Ryan Beisner

remove amulet tests for unsupported releases

102. By Ryan Beisner

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

103. By Ryan Beisner

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

104. By Ryan Beisner

Update tests/README

105. By Ryan Beisner

Update bundletester testplan yaml file

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

charm_unit_test #15792 neutron-openvswitch-next for 1chb1n mp282057
    UNIT OK: passed

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

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

Subscribers

People subscribed via source and target branches