Merge lp:~corey.bryant/charms/trusty/cinder/amulet-updates into lp:~openstack-charmers-archive/charms/trusty/cinder/next

Proposed by Corey Bryant
Status: Merged
Merged at revision: 54
Proposed branch: lp:~corey.bryant/charms/trusty/cinder/amulet-updates
Merge into: lp:~openstack-charmers-archive/charms/trusty/cinder/next
Diff against target: 158 lines (+38/-25)
4 files modified
Makefile (+5/-3)
tests/00-setup (+4/-4)
tests/README (+6/-0)
tests/basic_deployment.py (+23/-18)
To merge this branch: bzr merge lp:~corey.bryant/charms/trusty/cinder/amulet-updates
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+237490@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2014-10-06 21:50:53 +0000
3+++ Makefile 2014-10-07 21:13:25 +0000
4@@ -2,17 +2,19 @@
5 PYTHON := /usr/bin/env python
6
7 lint:
8- @flake8 --exclude hooks/charmhelpers hooks unit_tests
9+ @flake8 --exclude hooks/charmhelpers hooks unit_tests tests
10 @charm proof
11
12 unit_test:
13+ @echo Starting unit tests...
14 @$(PYTHON) /usr/bin/nosetests --nologcapture --with-coverage unit_tests
15
16 test:
17 @echo Starting amulet deployment tests...
18 #NOTE(beisner): can remove -v after bug 1320357 is fixed
19 # https://bugs.launchpad.net/amulet/+bug/1320357
20- @juju test -v -p AMULET_HTTP_PROXY
21+ @juju test -v -p AMULET_HTTP_PROXY --timeout 900 \
22+ 00-setup 14-basic-precise-icehouse 15-basic-trusty-icehouse
23
24 bin/charm_helpers_sync.py:
25 @mkdir -p bin
26@@ -21,7 +23,7 @@
27
28 sync: bin/charm_helpers_sync.py
29 @$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-hooks.yaml
30- @charm-helper-sync -c charm-helpers-tests.yaml
31+ @$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-tests.yaml
32
33 publish: lint unit_test
34 bzr push lp:charms/cinder
35
36=== modified file 'tests/00-setup'
37--- tests/00-setup 2014-07-31 15:27:14 +0000
38+++ tests/00-setup 2014-10-07 21:13:25 +0000
39@@ -4,7 +4,7 @@
40
41 sudo add-apt-repository --yes ppa:juju/stable
42 sudo apt-get update --yes
43-sudo apt-get install --yes python-amulet
44-sudo apt-get install --yes python-keystoneclient
45-sudo apt-get install --yes python-cinderclient
46-sudo apt-get install --yes python-glanceclient
47+sudo apt-get install --yes python-amulet \
48+ python-keystoneclient \
49+ python-cinderclient \
50+ python-glanceclient
51
52=== modified file 'tests/README'
53--- tests/README 2014-07-31 15:27:14 +0000
54+++ tests/README 2014-10-07 21:13:25 +0000
55@@ -1,6 +1,12 @@
56 This directory provides Amulet tests that focus on verification of Cinder
57 deployments.
58
59+In order to run tests, you'll need charm-tools installed (in addition to
60+juju, of course):
61+ sudo add-apt-repository ppa:juju/stable
62+ sudo apt-get update
63+ sudo apt-get install charm-tools
64+
65 If you use a web proxy server to access the web, you'll need to set the
66 AMULET_HTTP_PROXY environment variable to the http URL of the proxy server.
67
68
69=== modified file 'tests/basic_deployment.py'
70--- tests/basic_deployment.py 2014-09-26 21:51:06 +0000
71+++ tests/basic_deployment.py 2014-10-07 21:13:25 +0000
72@@ -17,7 +17,7 @@
73 )
74
75 # Use DEBUG to turn on debug logging
76-u = OpenStackAmuletUtils(DEBUG)
77+u = OpenStackAmuletUtils(ERROR)
78
79
80 class CinderBasicDeployment(OpenStackAmuletDeployment):
81@@ -29,9 +29,10 @@
82 # NOTE(beisner): Features and tests vary across Openstack releases.
83 # https://wiki.openstack.org/wiki/CinderSupportMatrix
84
85- def __init__(self, series=None, openstack=None, source=None):
86+ def __init__(self, series=None, openstack=None, source=None, stable=False):
87 '''Deploy the entire test environment.'''
88- super(CinderBasicDeployment, self).__init__(series, openstack, source)
89+ super(CinderBasicDeployment, self).__init__(series, openstack, source,
90+ stable)
91 self._add_services()
92 self._add_relations()
93 self._configure_services()
94@@ -39,12 +40,15 @@
95 self._initialize_tests()
96
97 def _add_services(self):
98- '''Add the service that we're testing, including the number of units,
99- where this charm is local, and the other charms are from
100- the charm store.'''
101- this_service = ('cinder', 1)
102- other_services = [('mysql', 1), ('rabbitmq-server', 1),
103- ('keystone', 1), ('glance', 1)]
104+ """Add services
105+
106+ Add the services that we're testing, where cinder is local,
107+ and the rest of the service are from lp branches that are
108+ compatible with the local charm (e.g. stable or next).
109+ """
110+ this_service = {'name': 'cinder'}
111+ other_services = [{'name': 'mysql'}, {'name': 'rabbitmq-server'},
112+ {'name': 'keystone'}, {'name': 'glance'}]
113 super(CinderBasicDeployment, self)._add_services(this_service,
114 other_services)
115
116@@ -508,10 +512,13 @@
117 amulet.raise_status(amulet.FAIL,
118 msg='glance endpoint: {}'.format(ret))
119
120- def test_cinder_restart_on_config_change(self):
121- '''Verify that cinder services are restarted when
122- the config is changed.'''
123+ def test_z_cinder_restart_on_config_change(self):
124+ '''Verify cinder services are restarted when the config is changed.
125
126+ Note(coreycb): The method name with the _z_ is a little odd
127+ but it forces the test to run last. It just makes things
128+ easier because restarting services requires re-authorization.
129+ '''
130 u.log.debug('making charm config change')
131 self.d.configure('cinder', {'verbose': 'True'})
132 self.d.configure('cinder', {'debug': 'True'})
133@@ -519,11 +526,15 @@
134 if not self.service_restarted(self.cinder_sentry, 'cinder-api',
135 '/etc/cinder/cinder.conf',
136 sleep_time=30):
137+ self.d.configure('cinder', {'verbose': 'False'})
138+ self.d.configure('cinder', {'debug': 'False'})
139 msg = "cinder-api service didn't restart after config change"
140 amulet.raise_status(amulet.FAIL, msg=msg)
141
142 if not self.service_restarted(self.cinder_sentry, 'cinder-volume',
143 '/etc/cinder/cinder.conf', sleep_time=0):
144+ self.d.configure('cinder', {'verbose': 'False'})
145+ self.d.configure('cinder', {'debug': 'False'})
146 msg = "cinder-volume service didn't restart after conf change"
147 amulet.raise_status(amulet.FAIL, msg=msg)
148
149@@ -806,9 +817,3 @@
150 ret = self.delete_all_objs(self.cinder.volumes, item_desc='volume')
151 if ret:
152 amulet.raise_status(amulet.FAIL, msg=ret)
153-
154- def test_zzzz_fake_fail(self):
155- '''Force a fake fail to keep juju environment after a successful test run'''
156- # Useful in test writing, when used with: juju test --set-e
157- amulet.raise_status(amulet.FAIL, msg='using fake fail to keep juju environment')
158-

Subscribers

People subscribed via source and target branches