Merge lp:~1chb1n/charms/trusty/nova-cloud-controller/next-amulet-1602b into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 219
Proposed branch: lp:~1chb1n/charms/trusty/nova-cloud-controller/next-amulet-1602b
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 247 lines (+74/-114)
2 files modified
tests/010-basic-precise-essex (+0/-10)
tests/basic_deployment.py (+74/-104)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/nova-cloud-controller/next-amulet-1602b
Reviewer Review Type Date Requested Status
David Ames (community) Approve
Review via email: mp+286392@code.launchpad.net

Description of the change

Update amulet test for Mitaka; Refactor conf dict checks for clarity and simplicity; Remove Essex conditionals and definition.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #753 nova-cloud-controller-next for 1chb1n mp286392
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/753/

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

charm_unit_test #659 nova-cloud-controller-next for 1chb1n mp286392
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/659/

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

charm_amulet_test #307 nova-cloud-controller-next for 1chb1n mp286392
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/307/

Revision history for this message
David Ames (thedac) wrote :

Ryan,

Checking on in line question before merging.

review: Needs Information
Revision history for this message
Ryan Beisner (1chb1n) wrote :

@thedac - Thanks for the review. Ack on the legacy_ratelimit for Mitaka and later. It's driven by the mitaka template @:

http://bazaar.launchpad.net/~openstack-charmers/charms/trusty/nova-cloud-controller/next/view/head:/templates/mitaka/api-paste.ini#L111

Revision history for this message
Ryan Beisner (1chb1n) wrote :
Revision history for this message
David Ames (thedac) wrote :

OK, looks good. Merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'tests/010-basic-precise-essex'
2--- tests/010-basic-precise-essex 2015-10-14 02:27:48 +0000
3+++ tests/010-basic-precise-essex 1970-01-01 00:00:00 +0000
4@@ -1,10 +0,0 @@
5-#!/usr/bin/python
6-
7-"""Amulet tests on a basic nova cloud controller deployment on
8- precise-essex."""
9-
10-from basic_deployment import NovaCCBasicDeployment
11-
12-if __name__ == '__main__':
13- deployment = NovaCCBasicDeployment(series='precise')
14- deployment.run_tests()
15
16=== modified file 'tests/019-basic-trusty-mitaka' (properties changed: -x to +x)
17=== modified file 'tests/021-basic-xenial-mitaka' (properties changed: -x to +x)
18=== modified file 'tests/basic_deployment.py'
19--- tests/basic_deployment.py 2016-02-16 18:59:48 +0000
20+++ tests/basic_deployment.py 2016-02-17 19:37:31 +0000
21@@ -438,8 +438,6 @@
22 'private-address': u.valid_ip,
23 'restart_trigger': u.not_null
24 }
25- if self._get_openstack_release() == self.precise_essex:
26- expected['volume_service'] = 'nova-volume'
27
28 ret = u.validate_relation_data(unit, relation, expected)
29 if ret:
30@@ -493,11 +491,6 @@
31
32 def test_300_nova_default_config(self):
33 """Verify the data in the nova config file's default section."""
34- # NOTE(coreycb): Currently no way to test on essex because config file
35- # has no section headers.
36- if self._get_openstack_release() == self.precise_essex:
37- return
38-
39 u.log.debug('Checking nova config file data...')
40 unit = self.nova_cc_sentry
41 conf = '/etc/nova/nova.conf'
42@@ -557,90 +550,74 @@
43 'ec2_listen_port': '8763'
44 }
45 }
46+
47 if self._get_openstack_release() < self.trusty_kilo:
48- d = 'DEFAULT'
49- if self._get_openstack_release() < self.precise_icehouse:
50- expected[d]['sql_connection'] = db_uri
51- else:
52- database = {
53- 'database': {
54- 'connection': db_uri
55- }
56- }
57- keystone_authtoken = {
58- 'keystone_authtoken': {
59- 'auth_uri': ks_uri,
60- 'auth_host': ks_ncc_rel['service_host'],
61- 'auth_port': ks_ncc_rel['auth_port'],
62- 'auth_protocol': ks_ncc_rel['auth_protocol'],
63- 'admin_tenant_name': ks_ncc_rel['service_tenant'],
64- 'admin_user': ks_ncc_rel['service_username'],
65- 'admin_password': ks_ncc_rel['service_password'],
66- }
67- }
68- expected.update(database)
69- expected.update(keystone_authtoken)
70- expected[d]['lock_path'] = '/var/lock/nova'
71- expected[d]['libvirt_use_virtio_for_bridges'] = 'True'
72- expected[d]['compute_driver'] = 'libvirt.LibvirtDriver'
73- expected[d]['rabbit_userid'] = 'nova'
74- expected[d]['rabbit_virtual_host'] = 'openstack'
75- expected[d]['rabbit_password'] = rmq_ncc_rel['password']
76- expected[d]['rabbit_host'] = rmq_ncc_rel['hostname']
77- expected[d]['glance_api_servers'] = gl_ncc_rel['glance-api-server']
78-
79+ # Juno and earlier
80+ expected['database'] = {
81+ 'connection': db_uri
82+ }
83+ expected['keystone_authtoken'] = {
84+ 'auth_uri': ks_uri,
85+ 'auth_host': ks_ncc_rel['service_host'],
86+ 'auth_port': ks_ncc_rel['auth_port'],
87+ 'auth_protocol': ks_ncc_rel['auth_protocol'],
88+ 'admin_tenant_name': ks_ncc_rel['service_tenant'],
89+ 'admin_user': ks_ncc_rel['service_username'],
90+ 'admin_password': ks_ncc_rel['service_password'],
91+ }
92+ expected['DEFAULT'].update({
93+ 'lock_path': '/var/lock/nova',
94+ 'libvirt_use_virtio_for_bridges': 'True',
95+ 'compute_driver': 'libvirt.LibvirtDriver',
96+ 'rabbit_userid': 'nova',
97+ 'rabbit_virtual_host': 'openstack',
98+ 'rabbit_password': rmq_ncc_rel['password'],
99+ 'rabbit_host': rmq_ncc_rel['hostname'],
100+ 'glance_api_servers': gl_ncc_rel['glance-api-server']
101+ })
102 else:
103- database = {
104- 'database': {
105- 'connection': db_uri,
106- 'max_pool_size': '2',
107- }
108- }
109- glance = {
110- 'glance': {
111- 'api_servers': gl_ncc_rel['glance-api-server'],
112- }
113- }
114- keystone_authtoken = {
115- 'keystone_authtoken': {
116- 'identity_uri': id_uri,
117- 'auth_uri': ks_uri,
118- 'admin_tenant_name': ks_ncc_rel['service_tenant'],
119- 'admin_user': ks_ncc_rel['service_username'],
120- 'admin_password': ks_ncc_rel['service_password'],
121- 'signing_dir': '/var/cache/nova',
122- }
123- }
124- osapi_v3 = {
125- 'osapi_v3': {
126- 'enabled': 'True',
127- }
128- }
129- conductor = {
130- 'conductor': {
131- 'workers': '2',
132- }
133- }
134- oslo_messaging_rabbit = {
135- 'oslo_messaging_rabbit': {
136- 'rabbit_userid': 'nova',
137- 'rabbit_virtual_host': 'openstack',
138- 'rabbit_password': rmq_ncc_rel['password'],
139- 'rabbit_host': rmq_ncc_rel['hostname'],
140- }
141- }
142- oslo_concurrency = {
143- 'oslo_concurrency': {
144- 'lock_path': '/var/lock/nova',
145- }
146- }
147- expected.update(database)
148- expected.update(glance)
149- expected.update(keystone_authtoken)
150- expected.update(osapi_v3)
151- expected.update(conductor)
152- expected.update(oslo_messaging_rabbit)
153- expected.update(oslo_concurrency)
154+ # Kilo and later
155+ expected['database'] = {
156+ 'connection': db_uri,
157+ 'max_pool_size': '2',
158+ }
159+ expected['glance'] = {
160+ 'api_servers': gl_ncc_rel['glance-api-server'],
161+ }
162+ expected['keystone_authtoken'] = {
163+ 'identity_uri': id_uri,
164+ 'auth_uri': ks_uri,
165+ 'admin_tenant_name': ks_ncc_rel['service_tenant'],
166+ 'admin_user': ks_ncc_rel['service_username'],
167+ 'admin_password': ks_ncc_rel['service_password'],
168+ 'signing_dir': '/var/cache/nova',
169+ }
170+ expected['osapi_v3'] = {
171+ 'enabled': 'True',
172+ }
173+ expected['conductor'] = {
174+ 'workers': '2',
175+ }
176+ expected['oslo_messaging_rabbit'] = {
177+ 'rabbit_userid': 'nova',
178+ 'rabbit_virtual_host': 'openstack',
179+ 'rabbit_password': rmq_ncc_rel['password'],
180+ 'rabbit_host': rmq_ncc_rel['hostname'],
181+ }
182+ expected['oslo_concurrency'] = {
183+ 'lock_path': '/var/lock/nova',
184+ }
185+
186+ if self._get_openstack_release() >= self.trusty_mitaka:
187+ # Mitaka
188+ expected['keystone_authtoken'] = {
189+ 'auth_type': 'password',
190+ 'project_name': 'services',
191+ 'username': 'nova',
192+ 'password': ks_ncc_rel['service_password'],
193+ 'auth_url': id_uri.rstrip('/'),
194+ 'region': 'RegionOne'
195+ }
196
197 for section, pairs in expected.iteritems():
198 ret = u.validate_config_data(unit, conf, section, pairs)
199@@ -648,16 +625,20 @@
200 message = "nova config error: {}".format(ret)
201 amulet.raise_status(amulet.FAIL, msg=message)
202
203- def test_302_api_rate_limiting_is_enabled_for_icehouse_or_more(self):
204+ def test_302_api_rate_limiting_is_enabled(self):
205 """
206- The API rate limiting is enabled for icehouse or more. Otherwise the
207- api-paste.ini file is left untouched.
208+ Check that API rate limiting is enabled.
209 """
210 u.log.debug('Checking api-paste config file data...')
211
212 unit = self.nova_cc_sentry
213 conf = '/etc/nova/api-paste.ini'
214- section = "filter:ratelimit"
215+
216+ if self._get_openstack_release() >= self.trusty_mitaka:
217+ section = "filter:legacy_ratelimit"
218+ else:
219+ section = "filter:ratelimit"
220+
221 factory = ("nova.api.openstack.compute.limits:RateLimitingMiddleware"
222 ".factory")
223
224@@ -674,13 +655,6 @@
225
226 def test_400_image_instance_create(self):
227 """Create an image/instance, verify they exist, and delete them."""
228- # NOTE(coreycb): Skipping failing test on essex until resolved. essex
229- # nova API calls are getting "Malformed request url
230- # (HTTP 400)".
231- if self._get_openstack_release() == self.precise_essex:
232- u.log.error("Skipping test (due to Essex)")
233- return
234-
235 u.log.debug('Checking nova instance creation...')
236
237 image = u.create_cirros_image(self.glance, "cirros-image")
238@@ -713,10 +687,6 @@
239 def test_900_restart_on_config_change(self):
240 """Verify that the specified services are restarted when the config
241 is changed."""
242- if self._get_openstack_release() == self.precise_essex:
243- u.log.error("Skipping test (due to Essex)")
244- return
245-
246 u.log.info('Checking that conf files and system services respond '
247 'to a charm config change...')
248

Subscribers

People subscribed via source and target branches