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

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 142
Proposed branch: lp:~1chb1n/charms/trusty/cinder/next.1601-test-update1
Merge into: lp:~openstack-charmers-archive/charms/trusty/cinder/next
Diff against target: 300 lines (+129/-81)
9 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/054-basic-vivid-kilo-git (+0/-9)
tests/README (+86/-62)
tests/tests.yaml (+2/-1)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/cinder/next.1601-test-update1
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+282068@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 #16877 cinder-next for 1chb1n mp282068
    LINT OK: passed

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

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

charm_unit_test #15767 cinder-next for 1chb1n mp282068
    UNIT OK: passed

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

141. By Ryan Beisner

remove amulet tests for unsupported releases

142. By Ryan Beisner

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

143. By Ryan Beisner

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

144. By Ryan Beisner

Update tests/README

145. By Ryan Beisner

Update bundletester testplan yaml file

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

charm_lint_check #16889 cinder-next for 1chb1n mp282068
    LINT OK: passed

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

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

charm_unit_test #15780 cinder-next for 1chb1n mp282068
    UNIT OK: passed

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

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
=== modified file 'Makefile'
--- Makefile 2015-10-29 04:46:01 +0000
+++ Makefile 2016-01-08 21:46:50 +0000
@@ -13,6 +13,7 @@
1313
14functional_test:14functional_test:
15 @echo Starting amulet deployment tests...15 @echo Starting amulet deployment tests...
16 @tests/setup/00-setup
16 @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 270017 @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 2700
1718
18bin/charm_helpers_sync.py:19bin/charm_helpers_sync.py:
1920
=== added file 'tests/018-basic-trusty-liberty'
--- tests/018-basic-trusty-liberty 1970-01-01 00:00:00 +0000
+++ tests/018-basic-trusty-liberty 2016-01-08 21:46:50 +0000
@@ -0,0 +1,11 @@
1#!/usr/bin/python
2
3"""Amulet tests on a basic cinder deployment on trusty-liberty."""
4
5from basic_deployment import CinderBasicDeployment
6
7if __name__ == '__main__':
8 deployment = CinderBasicDeployment(series='trusty',
9 openstack='cloud:trusty-liberty',
10 source='cloud:trusty-updates/liberty')
11 deployment.run_tests()
012
=== added file 'tests/019-basic-trusty-mitaka'
--- tests/019-basic-trusty-mitaka 1970-01-01 00:00:00 +0000
+++ tests/019-basic-trusty-mitaka 2016-01-08 21:46:50 +0000
@@ -0,0 +1,11 @@
1#!/usr/bin/python
2
3"""Amulet tests on a basic cinder deployment on trusty-liberty."""
4
5from basic_deployment import CinderBasicDeployment
6
7if __name__ == '__main__':
8 deployment = CinderBasicDeployment(series='trusty',
9 openstack='cloud:trusty-liberty',
10 source='cloud:trusty-updates/liberty')
11 deployment.run_tests()
012
=== removed file 'tests/019-basic-vivid-kilo'
--- tests/019-basic-vivid-kilo 2015-06-23 23:52:07 +0000
+++ tests/019-basic-vivid-kilo 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1#!/usr/bin/python
2
3"""Amulet tests on a basic Cinder deployment on vivid-kilo."""
4
5from basic_deployment import CinderBasicDeployment
6
7if __name__ == '__main__':
8 deployment = CinderBasicDeployment(series='vivid')
9 deployment.run_tests()
100
=== added file 'tests/020-basic-wily-liberty'
--- tests/020-basic-wily-liberty 1970-01-01 00:00:00 +0000
+++ tests/020-basic-wily-liberty 2016-01-08 21:46:50 +0000
@@ -0,0 +1,9 @@
1#!/usr/bin/python
2
3"""Amulet tests on a basic Cinder deployment on wily-liberty."""
4
5from basic_deployment import CinderBasicDeployment
6
7if __name__ == '__main__':
8 deployment = CinderBasicDeployment(series='wily')
9 deployment.run_tests()
010
=== added file 'tests/021-basic-xenial-mitaka'
--- tests/021-basic-xenial-mitaka 1970-01-01 00:00:00 +0000
+++ tests/021-basic-xenial-mitaka 2016-01-08 21:46:50 +0000
@@ -0,0 +1,9 @@
1#!/usr/bin/python
2
3"""Amulet tests on a basic Cinder deployment on xenial-mitaka."""
4
5from basic_deployment import CinderBasicDeployment
6
7if __name__ == '__main__':
8 deployment = CinderBasicDeployment(series='xenial')
9 deployment.run_tests()
010
=== removed file 'tests/054-basic-vivid-kilo-git'
--- tests/054-basic-vivid-kilo-git 2015-06-23 23:52:07 +0000
+++ tests/054-basic-vivid-kilo-git 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1#!/usr/bin/python
2
3"""Amulet tests on a basic Cinder git deployment on vivid-kilo."""
4
5from basic_deployment import CinderBasicDeployment
6
7if __name__ == '__main__':
8 deployment = CinderBasicDeployment(series='vivid', git=True)
9 deployment.run_tests()
100
=== modified file 'tests/README'
--- tests/README 2015-06-23 23:52:07 +0000
+++ tests/README 2016-01-08 21:46:50 +0000
@@ -1,89 +1,113 @@
1This directory provides Amulet tests that focus on verification of Cinder1This directory provides Amulet tests to verify basic deployment functionality
2deployments.2from the perspective of this charm, its requirements and its features, as
33exercised in a subset of the full OpenStack deployment test bundle topology.
4test_* methods are called in lexical sort order.4
55Reference: lp:openstack-charm-testing for full test bundles.
6Test name convention to ensure desired test order:6
7A single topology and configuration is defined and deployed, once for each of
8the defined Ubuntu:OpenStack release combos. The ongoing goal is for this
9charm to always possess tests and combo definitions for all currently-supported
10release combinations of U:OS.
11
12test_* methods are called in lexical sort order, as with most runners. However,
13each individual test method should be idempotent and expected to pass regardless
14of run order or Ubuntu:OpenStack combo. When writing or modifying tests,
15ensure that every individual test is not dependent on another test_ method.
16
17Test naming convention, purely for code organization purposes:
7 1xx service and endpoint checks18 1xx service and endpoint checks
8 2xx relation checks19 2xx relation checks
9 3xx config checks20 3xx config checks
10 4xx functional checks21 4xx functional checks
11 9xx restarts and other final checks22 9xx restarts, config changes, actions and other final checks
1223
13In order to run tests, you'll need charm-tools installed (in addition to24In order to run tests, charm-tools and juju must be installed:
14juju, of course):
15 sudo add-apt-repository ppa:juju/stable25 sudo add-apt-repository ppa:juju/stable
16 sudo apt-get update26 sudo apt-get update
17 sudo apt-get install charm-tools27 sudo apt-get install charm-tools juju juju-deployer amulet
1828
19If you use a web proxy server to access the web, you'll need to set the29Alternatively, tests may be exercised with proposed or development versions
20AMULET_HTTP_PROXY environment variable to the http URL of the proxy server.30of juju and related tools:
31
32 # juju proposed version
33 sudo add-apt-repository ppa:juju/proposed
34 sudo apt-get update
35 sudo apt-get install charm-tools juju juju-deployer
36
37 # juju development version
38 sudo add-apt-repository ppa:juju/devel
39 sudo apt-get update
40 sudo apt-get install charm-tools juju juju-deployer
41
42Some tests may need to download files. If a web proxy server is required in
43the environment, the AMULET_HTTP_PROXY environment variable must be set and
44passed into the juju test command. This is unrelated to juju's http proxy
45settings or behavior.
2146
22The following examples demonstrate different ways that tests can be executed.47The following examples demonstrate different ways that tests can be executed.
23All examples are run from the charm's root directory.48All examples are run from the charm's root directory.
2449
25 * To run all tests (starting with 00-setup):50 * To run all +x tests in the tests directory:
2651
27 make test52 bzr branch lp:charms/trusty/foo
2853 cd foo
29 * To run a specific test module (or modules):54 make functional_test
3055
31 juju test -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse56 * To run the tests against a specific release combo as defined in tests/:
3257
33 * To run a specific test module (or modules), and keep the environment58 bzr branch lp:charms/trusty/foo
34 deployed after a failure:59 cd foo
3560 juju test -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse
36 juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse61
62 * To run tests and keep the juju environment deployed after a failure:
63
64 bzr branch lp:charms/trusty/foo
65 cd foo
66 juju test --set-e -v -p AMULET_HTTP_PROXY 015-basic-trusty-icehouse
3767
38 * To re-run a test module against an already deployed environment (one68 * To re-run a test module against an already deployed environment (one
39 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'):
4070
41 ./tests/15-basic-trusty-icehouse71 ./tests/015-basic-trusty-icehouse
4272
4373 * Even with --set-e, `juju test` will tear down the deployment when all
44For debugging and test development purposes, all code should be idempotent.74 tests pass. The following work flow may be more effective when
45In other words, the code should have the ability to be re-run without changing75 iterating on test writing.
46the results beyond the initial run. This enables editing and re-running of a76
47test module against an already deployed environment, as described above.77 bzr branch lp:charms/trusty/foo
4878 cd foo
49Additional testing and debug information:79 ./tests/setup/00-setup
80 juju bootstrap
81 ./tests/015-basic-trusty-icehouse
82 # make some changes, run tests again
83 ./tests/015-basic-trusty-icehouse
84 # make some changes, run tests again
85 ./tests/015-basic-trusty-icehouse
86
87 * There may be test definitions in the tests/ dir which are not set +x
88 executable. This is generally true for deprecated releases, or for
89 upcoming releases which are not yet validated and enabled. To enable
90 and run these tests:
91 bzr branch lp:charms/trusty/foo
92 cd foo
93 ls tests
94 chmod +x tests/017-basic-trusty-kilo
95 ./tests/setup/00-setup
96 juju bootstrap
97 ./tests/017-basic-trusty-kilo
98
99
100Additional notes:
50101
51 * Use DEBUG to turn on debug logging, use ERROR otherwise.102 * Use DEBUG to turn on debug logging, use ERROR otherwise.
52
53 u = OpenStackAmuletUtils(ERROR)103 u = OpenStackAmuletUtils(ERROR)
54 u = OpenStackAmuletUtils(DEBUG)104 u = OpenStackAmuletUtils(DEBUG)
55105
56 * To interact with the deployed environment:106 * To interact with the deployed environment:
57
58 export OS_USERNAME=admin107 export OS_USERNAME=admin
59 export OS_PASSWORD=openstack108 export OS_PASSWORD=openstack
60 export OS_TENANT_NAME=admin109 export OS_TENANT_NAME=admin
61 export OS_REGION_NAME=RegionOne110 export OS_REGION_NAME=RegionOne
62 export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0111 export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju-deployer -e trusty -f keystone`:5000/v2.0
63 keystone user-list112 keystone user-list
64 cinder list113 glance image-list
65
66 * Handy commands for watching these tests run or manually poking around:
67
68 watch "cinder list && cinder snapshot-list && glance image-list"
69 watch "juju get cinder | egrep 'verbose|debug|true|false'"
70 watch "juju ssh cinder/0 'sudo lvs && sudo status cinder-api && sudo status cinder-volume'"
71 juju set cinder verbose=false && juju set cinder debug=false
72
73 * Be aware that method names that start with 'test_' are called in alpha/num
74 order. Test methods which are order-sensitive can be numbered to ensure
75 that they run in the expected order. ex:
76
77 test_000_earlytest
78 test_300_sometest
79 test_999_latertest
80
81 * Preserving the deployed environment:
82 Even with juju --set-e, amulet will tear down the juju environment
83 when all tests pass. This force_fail 'test' can be used in basic_deployment.py
84 to simulate a failed test and keep the environment.
85
86 def test_zzzz_fake_fail(self):
87 '''Force a fake fail to keep juju environment after a successful test run'''
88 # Useful in test writing, when used with: juju test --set-e
89 amulet.raise_status(amulet.FAIL, msg='using fake fail to keep juju environment')
90114
=== added directory 'tests/setup'
=== renamed file 'tests/00-setup' => 'tests/setup/00-setup'
=== modified file 'tests/tests.yaml'
--- tests/tests.yaml 2015-10-06 14:11:42 +0000
+++ tests/tests.yaml 2016-01-08 21:46:50 +0000
@@ -1,5 +1,5 @@
1bootstrap: true1bootstrap: true
2reset: true2reset: false
3virtualenv: true3virtualenv: true
4makefile:4makefile:
5 - lint5 - lint
@@ -9,6 +9,7 @@
9packages:9packages:
10 - amulet10 - amulet
11 - distro-info-data11 - distro-info-data
12 - python-ceilometerclient
12 - python-cinderclient13 - python-cinderclient
13 - python-distro-info14 - python-distro-info
14 - python-glanceclient15 - python-glanceclient

Subscribers

People subscribed via source and target branches