Merge lp:~james-page/charms/trusty/neutron-openvswitch/mitaka-neutron-changes into lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next

Proposed by James Page on 2016-02-23
Status: Merged
Merged at revision: 110
Proposed branch: lp:~james-page/charms/trusty/neutron-openvswitch/mitaka-neutron-changes
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next
Diff against target: 268 lines (+122/-8)
4 files modified
hooks/neutron_ovs_utils.py (+24/-0)
templates/mitaka/openvswitch_agent.ini (+27/-0)
tests/basic_deployment.py (+16/-4)
unit_tests/test_neutron_ovs_utils.py (+55/-4)
To merge this branch: bzr merge lp:~james-page/charms/trusty/neutron-openvswitch/mitaka-neutron-changes
Reviewer Review Type Date Requested Status
Ryan Beisner 2016-02-23 Approve on 2016-02-25
Review via email: mp+286910@code.launchpad.net
To post a comment you must log in.

charm_lint_check #1295 neutron-openvswitch-next for james-page mp286910
    LINT OK: passed

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

charm_unit_test #1072 neutron-openvswitch-next for james-page mp286910
    UNIT OK: passed

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

charm_amulet_test #472 neutron-openvswitch-next for james-page mp286910
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/15181051/
Build: http://10.245.162.36:8080/job/charm_amulet_test/472/

charm_amulet_test #477 neutron-openvswitch-next for james-page mp286910
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/15181950/
Build: http://10.245.162.36:8080/job/charm_amulet_test/477/

Ryan Beisner (1chb1n) wrote :

#recheck

charm_unit_test #1077 neutron-openvswitch-next for james-page mp286910
    UNIT OK: passed

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

charm_lint_check #1310 neutron-openvswitch-next for james-page mp286910
    LINT OK: passed

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

charm_unit_test #1078 neutron-openvswitch-next for james-page mp286910
    UNIT OK: passed

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

charm_lint_check #1311 neutron-openvswitch-next for james-page mp286910
    LINT OK: passed

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

charm_amulet_test #481 neutron-openvswitch-next for james-page mp286910
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/15183170/
Build: http://10.245.162.36:8080/job/charm_amulet_test/481/

charm_lint_check #1368 neutron-openvswitch-next for james-page mp286910
    LINT OK: passed

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

charm_unit_test #1131 neutron-openvswitch-next for james-page mp286910
    UNIT OK: passed

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

charm_amulet_test #483 neutron-openvswitch-next for james-page mp286910
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/15185404/
Build: http://10.245.162.36:8080/job/charm_amulet_test/483/

James Page (james-page) wrote :

This won't pas just yet
On Tue, 23 Feb 2016 at 19:01, Ryan Beisner <email address hidden>
wrote:

> #recheck
> --
>
> https://code.launchpad.net/~james-page/charms/trusty/neutron-openvswitch/mitaka-neutron-changes/+merge/286910
> You are the owner of
> lp:~james-page/charms/trusty/neutron-openvswitch/mitaka-neutron-changes.
>

James Page (james-page) wrote :

#recheck

charm_lint_check #1480 neutron-openvswitch-next for james-page mp286910
    LINT OK: passed

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

charm_unit_test #1235 neutron-openvswitch-next for james-page mp286910
    UNIT OK: passed

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

charm_amulet_test #535 neutron-openvswitch-next for james-page mp286910
    AMULET OK: passed

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

Ryan Beisner (1chb1n) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/neutron_ovs_utils.py'
2--- hooks/neutron_ovs_utils.py 2015-11-12 09:33:27 +0000
3+++ hooks/neutron_ovs_utils.py 2016-02-23 14:51:17 +0000
4@@ -84,6 +84,7 @@
5 'neutron-server',
6 'neutron-plugin-openvswitch',
7 'neutron-plugin-openvswitch-agent',
8+ 'neutron-openvswitch-agent',
9 ]
10
11 NOVA_CONF_DIR = "/etc/nova"
12@@ -94,6 +95,7 @@
13 NEUTRON_L3_AGENT_CONF = "/etc/neutron/l3_agent.ini"
14 NEUTRON_FWAAS_CONF = "/etc/neutron/fwaas_driver.ini"
15 ML2_CONF = '%s/plugins/ml2/ml2_conf.ini' % NEUTRON_CONF_DIR
16+OVS_CONF = '%s/plugins/ml2/openvswitch_agent.ini' % NEUTRON_CONF_DIR
17 EXT_PORT_CONF = '/etc/init/ext-port.conf'
18 NEUTRON_METADATA_AGENT_CONF = "/etc/neutron/metadata_agent.ini"
19 DVR_PACKAGES = ['neutron-l3-agent']
20@@ -114,6 +116,10 @@
21 'services': ['neutron-plugin-openvswitch-agent'],
22 'contexts': [neutron_ovs_context.OVSPluginContext()],
23 }),
24+ (OVS_CONF, {
25+ 'services': ['neutron-openvswitch-agent'],
26+ 'contexts': [neutron_ovs_context.OVSPluginContext()],
27+ }),
28 (PHY_NIC_MTU_CONF, {
29 'services': ['os-charm-phy-nic-mtu'],
30 'contexts': [context.PhyNICMTUContext()],
31@@ -193,6 +199,11 @@
32 if p in pkgs:
33 pkgs.remove(p)
34
35+ release = os_release('neutron-common', base='icehouse')
36+ if release >= 'mitaka' and 'neutron-plugin-openvswitch-agent' in pkgs:
37+ pkgs.remove('neutron-plugin-openvswitch-agent')
38+ pkgs.append('neutron-openvswitch-agent')
39+
40 return pkgs
41
42
43@@ -221,6 +232,19 @@
44 resource_map.update(DHCP_RESOURCE_MAP)
45 metadata_services = ['neutron-metadata-agent', 'neutron-dhcp-agent']
46 resource_map[NEUTRON_CONF]['services'] += metadata_services
47+ # Remap any service names as required
48+ if os_release('neutron-common', base='icehouse') >= 'mitaka':
49+ # ml2_conf.ini -> openvswitch_agent.ini
50+ del resource_map[ML2_CONF]
51+ # drop of -plugin from service name
52+ resource_map[NEUTRON_CONF]['services'].remove(
53+ 'neutron-plugin-openvswitch-agent'
54+ )
55+ resource_map[NEUTRON_CONF]['services'].append(
56+ 'neutron-openvswitch-agent'
57+ )
58+ else:
59+ del resource_map[OVS_CONF]
60 return resource_map
61
62
63
64=== added directory 'templates/mitaka'
65=== added file 'templates/mitaka/openvswitch_agent.ini'
66--- templates/mitaka/openvswitch_agent.ini 1970-01-01 00:00:00 +0000
67+++ templates/mitaka/openvswitch_agent.ini 2016-02-23 14:51:17 +0000
68@@ -0,0 +1,27 @@
69+# mitaka
70+###############################################################################
71+# [ WARNING ]
72+# Configuration file maintained by Juju. Local changes may be overwritten.
73+# Config managed by neutron-openvswitch charm
74+###############################################################################
75+[ovs]
76+enable_tunneling = True
77+local_ip = {{ local_ip }}
78+bridge_mappings = {{ bridge_mappings }}
79+
80+[agent]
81+tunnel_types = {{ overlay_network_type }}
82+l2_population = {{ l2_population }}
83+enable_distributed_routing = {{ distributed_routing }}
84+prevent_arp_spoofing = {{ prevent_arp_spoofing }}
85+{% if veth_mtu -%}
86+veth_mtu = {{ veth_mtu }}
87+{% endif -%}
88+
89+[securitygroup]
90+{% if neutron_security_groups -%}
91+enable_security_group = True
92+firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
93+{% else -%}
94+enable_security_group = False
95+{% endif -%}
96
97=== modified file 'tests/basic_deployment.py'
98--- tests/basic_deployment.py 2016-01-20 20:56:33 +0000
99+++ tests/basic_deployment.py 2016-02-23 14:51:17 +0000
100@@ -9,7 +9,7 @@
101 OpenStackAmuletDeployment
102 )
103
104-# This file needs de-linted. The (mis)use of n-o q-a below causes all lint
105+# This file needs de-linted. The (mis)use of n-o q-a below causes all lint
106 # to go undetected. Remove that & fixme.
107 from charmhelpers.contrib.openstack.amulet.utils import (
108 OpenStackAmuletUtils,
109@@ -67,7 +67,7 @@
110 def _add_relations(self):
111 """Add all of the relations for the services."""
112 relations = {
113- 'neutron-openvswitch:amqp': 'rabbitmq-server:amqp',
114+ 'neutron-openvswitch:amqp': 'rabbitmq-server:amqp',
115 'neutron-openvswitch:neutron-plugin':
116 'nova-compute:neutron-plugin',
117 'neutron-openvswitch:neutron-plugin-api':
118@@ -160,6 +160,12 @@
119 self.neutron_api_sentry: ['neutron-server'],
120 }
121
122+ if self._get_openstack_release() >= self.trusty_mitaka:
123+ services[self.compute_sentry] = [
124+ 'nova-compute',
125+ 'neutron-openvswitch-agent'
126+ ]
127+
128 ret = u.validate_services_by_name(services)
129 if ret:
130 amulet.raise_status(amulet.FAIL, msg=ret)
131@@ -218,7 +224,10 @@
132
133 # Needs love - test actions not clear in log
134 unit = self.compute_sentry
135- conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
136+ if self._get_openstack_release() >= self.trusty_mitaka:
137+ conf = "/etc/neutron/plugins/ml2/openvswitch_agent.ini"
138+ else:
139+ conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
140 for value in vpair:
141 self.d.configure(service, {charm_key: value})
142 time.sleep(60)
143@@ -253,7 +262,10 @@
144
145 # Needs love - not idempotent
146 unit = self.compute_sentry
147- conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
148+ if self._get_openstack_release() >= self.trusty_mitaka:
149+ conf = "/etc/neutron/plugins/ml2/openvswitch_agent.ini"
150+ else:
151+ conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
152 self.d.configure('neutron-api', {'neutron-security-groups': 'True'})
153 self.d.configure('neutron-openvswitch',
154 {'disable-security-groups': 'True'})
155
156=== modified file 'unit_tests/test_neutron_ovs_utils.py'
157--- unit_tests/test_neutron_ovs_utils.py 2015-10-07 10:41:12 +0000
158+++ unit_tests/test_neutron_ovs_utils.py 2016-02-23 14:51:17 +0000
159@@ -111,7 +111,8 @@
160 self.test_config.set('enable-local-dhcp-and-metadata', False)
161 _git_requested.return_value = False
162 _use_dvr.return_value = False
163- _os_rel.return_value = 'trusty'
164+ _os_rel.return_value = 'icehouse'
165+ self.os_release.return_value = 'icehouse'
166 _head_pkgs.return_value = head_pkg
167 pkg_list = nutils.determine_packages()
168 expect = ['neutron-plugin-openvswitch-agent', head_pkg]
169@@ -121,12 +122,29 @@
170 @patch.object(nutils, 'git_install_requested')
171 @patch.object(charmhelpers.contrib.openstack.neutron, 'os_release')
172 @patch.object(charmhelpers.contrib.openstack.neutron, 'headers_package')
173+ def test_determine_packages_mitaka(self, _head_pkgs, _os_rel,
174+ _git_requested, _use_dvr):
175+ self.test_config.set('enable-local-dhcp-and-metadata', False)
176+ _git_requested.return_value = False
177+ _use_dvr.return_value = False
178+ _os_rel.return_value = 'mitaka'
179+ self.os_release.return_value = 'mitaka'
180+ _head_pkgs.return_value = head_pkg
181+ pkg_list = nutils.determine_packages()
182+ expect = ['neutron-openvswitch-agent', head_pkg]
183+ self.assertItemsEqual(pkg_list, expect)
184+
185+ @patch.object(nutils, 'use_dvr')
186+ @patch.object(nutils, 'git_install_requested')
187+ @patch.object(charmhelpers.contrib.openstack.neutron, 'os_release')
188+ @patch.object(charmhelpers.contrib.openstack.neutron, 'headers_package')
189 def test_determine_packages_metadata(self, _head_pkgs, _os_rel,
190 _git_requested, _use_dvr):
191 self.test_config.set('enable-local-dhcp-and-metadata', True)
192 _git_requested.return_value = False
193 _use_dvr.return_value = False
194- _os_rel.return_value = 'trusty'
195+ _os_rel.return_value = 'icehouse'
196+ self.os_release.return_value = 'icehouse'
197 _head_pkgs.return_value = head_pkg
198 pkg_list = nutils.determine_packages()
199 expect = ['neutron-plugin-openvswitch-agent', head_pkg,
200@@ -142,7 +160,8 @@
201 self.test_config.set('enable-local-dhcp-and-metadata', False)
202 _git_requested.return_value = True
203 _use_dvr.return_value = True
204- _os_rel.return_value = 'trusty'
205+ _os_rel.return_value = 'icehouse'
206+ self.os_release.return_value = 'icehouse'
207 _head_pkgs.return_value = head_pkg
208 pkg_list = nutils.determine_packages()
209 self.assertFalse('neutron-l3-agent' in pkg_list)
210@@ -159,7 +178,7 @@
211 self.ctxts.append(ctxt)
212
213 _use_dvr.return_value = False
214- self.os_release.return_value = 'trusty'
215+ self.os_release.return_value = 'icehouse'
216 templating.OSConfigRenderer.side_effect = _mock_OSConfigRenderer
217 _regconfs = nutils.register_configs()
218 confs = ['/etc/neutron/neutron.conf',
219@@ -168,8 +187,29 @@
220 self.assertItemsEqual(_regconfs.configs, confs)
221
222 @patch.object(nutils, 'use_dvr')
223+ def test_register_configs_mitaka(self, _use_dvr):
224+ class _mock_OSConfigRenderer():
225+ def __init__(self, templates_dir=None, openstack_release=None):
226+ self.configs = []
227+ self.ctxts = []
228+
229+ def register(self, config, ctxt):
230+ self.configs.append(config)
231+ self.ctxts.append(ctxt)
232+
233+ _use_dvr.return_value = False
234+ self.os_release.return_value = 'mitaka'
235+ templating.OSConfigRenderer.side_effect = _mock_OSConfigRenderer
236+ _regconfs = nutils.register_configs()
237+ confs = ['/etc/neutron/neutron.conf',
238+ '/etc/neutron/plugins/ml2/openvswitch_agent.ini',
239+ '/etc/init/os-charm-phy-nic-mtu.conf']
240+ self.assertItemsEqual(_regconfs.configs, confs)
241+
242+ @patch.object(nutils, 'use_dvr')
243 def test_resource_map(self, _use_dvr):
244 _use_dvr.return_value = False
245+ self.os_release.return_value = 'icehouse'
246 _map = nutils.resource_map()
247 svcs = ['neutron-plugin-openvswitch-agent']
248 confs = [nutils.NEUTRON_CONF]
249@@ -177,8 +217,19 @@
250 self.assertEqual(_map[nutils.NEUTRON_CONF]['services'], svcs)
251
252 @patch.object(nutils, 'use_dvr')
253+ def test_resource_map_mitaka(self, _use_dvr):
254+ _use_dvr.return_value = False
255+ self.os_release.return_value = 'mitaka'
256+ _map = nutils.resource_map()
257+ svcs = ['neutron-openvswitch-agent']
258+ confs = [nutils.NEUTRON_CONF]
259+ [self.assertIn(q_conf, _map.keys()) for q_conf in confs]
260+ self.assertEqual(_map[nutils.NEUTRON_CONF]['services'], svcs)
261+
262+ @patch.object(nutils, 'use_dvr')
263 def test_resource_map_dvr(self, _use_dvr):
264 _use_dvr.return_value = True
265+ self.os_release.return_value = 'icehouse'
266 _map = nutils.resource_map()
267 svcs = ['neutron-plugin-openvswitch-agent', 'neutron-metadata-agent',
268 'neutron-l3-agent']

Subscribers

People subscribed via source and target branches