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
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 (community) Approve
Review via email: mp+286910@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

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/

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

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/

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

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/

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

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/

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

#recheck

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

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/

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

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/

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

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/

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

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/

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

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/

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

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/

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

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/

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

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/

Revision history for this message
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.
>

Revision history for this message
James Page (james-page) wrote :

#recheck

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

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/

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

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/

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

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/

Revision history for this message
Ryan Beisner (1chb1n) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/neutron_ovs_utils.py'
--- hooks/neutron_ovs_utils.py 2015-11-12 09:33:27 +0000
+++ hooks/neutron_ovs_utils.py 2016-02-23 14:51:17 +0000
@@ -84,6 +84,7 @@
84 'neutron-server',84 'neutron-server',
85 'neutron-plugin-openvswitch',85 'neutron-plugin-openvswitch',
86 'neutron-plugin-openvswitch-agent',86 'neutron-plugin-openvswitch-agent',
87 'neutron-openvswitch-agent',
87]88]
8889
89NOVA_CONF_DIR = "/etc/nova"90NOVA_CONF_DIR = "/etc/nova"
@@ -94,6 +95,7 @@
94NEUTRON_L3_AGENT_CONF = "/etc/neutron/l3_agent.ini"95NEUTRON_L3_AGENT_CONF = "/etc/neutron/l3_agent.ini"
95NEUTRON_FWAAS_CONF = "/etc/neutron/fwaas_driver.ini"96NEUTRON_FWAAS_CONF = "/etc/neutron/fwaas_driver.ini"
96ML2_CONF = '%s/plugins/ml2/ml2_conf.ini' % NEUTRON_CONF_DIR97ML2_CONF = '%s/plugins/ml2/ml2_conf.ini' % NEUTRON_CONF_DIR
98OVS_CONF = '%s/plugins/ml2/openvswitch_agent.ini' % NEUTRON_CONF_DIR
97EXT_PORT_CONF = '/etc/init/ext-port.conf'99EXT_PORT_CONF = '/etc/init/ext-port.conf'
98NEUTRON_METADATA_AGENT_CONF = "/etc/neutron/metadata_agent.ini"100NEUTRON_METADATA_AGENT_CONF = "/etc/neutron/metadata_agent.ini"
99DVR_PACKAGES = ['neutron-l3-agent']101DVR_PACKAGES = ['neutron-l3-agent']
@@ -114,6 +116,10 @@
114 'services': ['neutron-plugin-openvswitch-agent'],116 'services': ['neutron-plugin-openvswitch-agent'],
115 'contexts': [neutron_ovs_context.OVSPluginContext()],117 'contexts': [neutron_ovs_context.OVSPluginContext()],
116 }),118 }),
119 (OVS_CONF, {
120 'services': ['neutron-openvswitch-agent'],
121 'contexts': [neutron_ovs_context.OVSPluginContext()],
122 }),
117 (PHY_NIC_MTU_CONF, {123 (PHY_NIC_MTU_CONF, {
118 'services': ['os-charm-phy-nic-mtu'],124 'services': ['os-charm-phy-nic-mtu'],
119 'contexts': [context.PhyNICMTUContext()],125 'contexts': [context.PhyNICMTUContext()],
@@ -193,6 +199,11 @@
193 if p in pkgs:199 if p in pkgs:
194 pkgs.remove(p)200 pkgs.remove(p)
195201
202 release = os_release('neutron-common', base='icehouse')
203 if release >= 'mitaka' and 'neutron-plugin-openvswitch-agent' in pkgs:
204 pkgs.remove('neutron-plugin-openvswitch-agent')
205 pkgs.append('neutron-openvswitch-agent')
206
196 return pkgs207 return pkgs
197208
198209
@@ -221,6 +232,19 @@
221 resource_map.update(DHCP_RESOURCE_MAP)232 resource_map.update(DHCP_RESOURCE_MAP)
222 metadata_services = ['neutron-metadata-agent', 'neutron-dhcp-agent']233 metadata_services = ['neutron-metadata-agent', 'neutron-dhcp-agent']
223 resource_map[NEUTRON_CONF]['services'] += metadata_services234 resource_map[NEUTRON_CONF]['services'] += metadata_services
235 # Remap any service names as required
236 if os_release('neutron-common', base='icehouse') >= 'mitaka':
237 # ml2_conf.ini -> openvswitch_agent.ini
238 del resource_map[ML2_CONF]
239 # drop of -plugin from service name
240 resource_map[NEUTRON_CONF]['services'].remove(
241 'neutron-plugin-openvswitch-agent'
242 )
243 resource_map[NEUTRON_CONF]['services'].append(
244 'neutron-openvswitch-agent'
245 )
246 else:
247 del resource_map[OVS_CONF]
224 return resource_map248 return resource_map
225249
226250
227251
=== added directory 'templates/mitaka'
=== added file 'templates/mitaka/openvswitch_agent.ini'
--- templates/mitaka/openvswitch_agent.ini 1970-01-01 00:00:00 +0000
+++ templates/mitaka/openvswitch_agent.ini 2016-02-23 14:51:17 +0000
@@ -0,0 +1,27 @@
1# mitaka
2###############################################################################
3# [ WARNING ]
4# Configuration file maintained by Juju. Local changes may be overwritten.
5# Config managed by neutron-openvswitch charm
6###############################################################################
7[ovs]
8enable_tunneling = True
9local_ip = {{ local_ip }}
10bridge_mappings = {{ bridge_mappings }}
11
12[agent]
13tunnel_types = {{ overlay_network_type }}
14l2_population = {{ l2_population }}
15enable_distributed_routing = {{ distributed_routing }}
16prevent_arp_spoofing = {{ prevent_arp_spoofing }}
17{% if veth_mtu -%}
18veth_mtu = {{ veth_mtu }}
19{% endif -%}
20
21[securitygroup]
22{% if neutron_security_groups -%}
23enable_security_group = True
24firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
25{% else -%}
26enable_security_group = False
27{% endif -%}
028
=== modified file 'tests/basic_deployment.py'
--- tests/basic_deployment.py 2016-01-20 20:56:33 +0000
+++ tests/basic_deployment.py 2016-02-23 14:51:17 +0000
@@ -9,7 +9,7 @@
9 OpenStackAmuletDeployment9 OpenStackAmuletDeployment
10)10)
1111
12# This file needs de-linted. The (mis)use of n-o q-a below causes all lint 12# This file needs de-linted. The (mis)use of n-o q-a below causes all lint
13# to go undetected. Remove that & fixme.13# to go undetected. Remove that & fixme.
14from charmhelpers.contrib.openstack.amulet.utils import (14from charmhelpers.contrib.openstack.amulet.utils import (
15 OpenStackAmuletUtils,15 OpenStackAmuletUtils,
@@ -67,7 +67,7 @@
67 def _add_relations(self):67 def _add_relations(self):
68 """Add all of the relations for the services."""68 """Add all of the relations for the services."""
69 relations = {69 relations = {
70 'neutron-openvswitch:amqp': 'rabbitmq-server:amqp', 70 'neutron-openvswitch:amqp': 'rabbitmq-server:amqp',
71 'neutron-openvswitch:neutron-plugin':71 'neutron-openvswitch:neutron-plugin':
72 'nova-compute:neutron-plugin',72 'nova-compute:neutron-plugin',
73 'neutron-openvswitch:neutron-plugin-api':73 'neutron-openvswitch:neutron-plugin-api':
@@ -160,6 +160,12 @@
160 self.neutron_api_sentry: ['neutron-server'],160 self.neutron_api_sentry: ['neutron-server'],
161 }161 }
162162
163 if self._get_openstack_release() >= self.trusty_mitaka:
164 services[self.compute_sentry] = [
165 'nova-compute',
166 'neutron-openvswitch-agent'
167 ]
168
163 ret = u.validate_services_by_name(services)169 ret = u.validate_services_by_name(services)
164 if ret:170 if ret:
165 amulet.raise_status(amulet.FAIL, msg=ret)171 amulet.raise_status(amulet.FAIL, msg=ret)
@@ -218,7 +224,10 @@
218224
219 # Needs love - test actions not clear in log225 # Needs love - test actions not clear in log
220 unit = self.compute_sentry226 unit = self.compute_sentry
221 conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"227 if self._get_openstack_release() >= self.trusty_mitaka:
228 conf = "/etc/neutron/plugins/ml2/openvswitch_agent.ini"
229 else:
230 conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
222 for value in vpair:231 for value in vpair:
223 self.d.configure(service, {charm_key: value})232 self.d.configure(service, {charm_key: value})
224 time.sleep(60)233 time.sleep(60)
@@ -253,7 +262,10 @@
253262
254 # Needs love - not idempotent263 # Needs love - not idempotent
255 unit = self.compute_sentry264 unit = self.compute_sentry
256 conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"265 if self._get_openstack_release() >= self.trusty_mitaka:
266 conf = "/etc/neutron/plugins/ml2/openvswitch_agent.ini"
267 else:
268 conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
257 self.d.configure('neutron-api', {'neutron-security-groups': 'True'})269 self.d.configure('neutron-api', {'neutron-security-groups': 'True'})
258 self.d.configure('neutron-openvswitch',270 self.d.configure('neutron-openvswitch',
259 {'disable-security-groups': 'True'})271 {'disable-security-groups': 'True'})
260272
=== modified file 'unit_tests/test_neutron_ovs_utils.py'
--- unit_tests/test_neutron_ovs_utils.py 2015-10-07 10:41:12 +0000
+++ unit_tests/test_neutron_ovs_utils.py 2016-02-23 14:51:17 +0000
@@ -111,7 +111,8 @@
111 self.test_config.set('enable-local-dhcp-and-metadata', False)111 self.test_config.set('enable-local-dhcp-and-metadata', False)
112 _git_requested.return_value = False112 _git_requested.return_value = False
113 _use_dvr.return_value = False113 _use_dvr.return_value = False
114 _os_rel.return_value = 'trusty'114 _os_rel.return_value = 'icehouse'
115 self.os_release.return_value = 'icehouse'
115 _head_pkgs.return_value = head_pkg116 _head_pkgs.return_value = head_pkg
116 pkg_list = nutils.determine_packages()117 pkg_list = nutils.determine_packages()
117 expect = ['neutron-plugin-openvswitch-agent', head_pkg]118 expect = ['neutron-plugin-openvswitch-agent', head_pkg]
@@ -121,12 +122,29 @@
121 @patch.object(nutils, 'git_install_requested')122 @patch.object(nutils, 'git_install_requested')
122 @patch.object(charmhelpers.contrib.openstack.neutron, 'os_release')123 @patch.object(charmhelpers.contrib.openstack.neutron, 'os_release')
123 @patch.object(charmhelpers.contrib.openstack.neutron, 'headers_package')124 @patch.object(charmhelpers.contrib.openstack.neutron, 'headers_package')
125 def test_determine_packages_mitaka(self, _head_pkgs, _os_rel,
126 _git_requested, _use_dvr):
127 self.test_config.set('enable-local-dhcp-and-metadata', False)
128 _git_requested.return_value = False
129 _use_dvr.return_value = False
130 _os_rel.return_value = 'mitaka'
131 self.os_release.return_value = 'mitaka'
132 _head_pkgs.return_value = head_pkg
133 pkg_list = nutils.determine_packages()
134 expect = ['neutron-openvswitch-agent', head_pkg]
135 self.assertItemsEqual(pkg_list, expect)
136
137 @patch.object(nutils, 'use_dvr')
138 @patch.object(nutils, 'git_install_requested')
139 @patch.object(charmhelpers.contrib.openstack.neutron, 'os_release')
140 @patch.object(charmhelpers.contrib.openstack.neutron, 'headers_package')
124 def test_determine_packages_metadata(self, _head_pkgs, _os_rel,141 def test_determine_packages_metadata(self, _head_pkgs, _os_rel,
125 _git_requested, _use_dvr):142 _git_requested, _use_dvr):
126 self.test_config.set('enable-local-dhcp-and-metadata', True)143 self.test_config.set('enable-local-dhcp-and-metadata', True)
127 _git_requested.return_value = False144 _git_requested.return_value = False
128 _use_dvr.return_value = False145 _use_dvr.return_value = False
129 _os_rel.return_value = 'trusty'146 _os_rel.return_value = 'icehouse'
147 self.os_release.return_value = 'icehouse'
130 _head_pkgs.return_value = head_pkg148 _head_pkgs.return_value = head_pkg
131 pkg_list = nutils.determine_packages()149 pkg_list = nutils.determine_packages()
132 expect = ['neutron-plugin-openvswitch-agent', head_pkg,150 expect = ['neutron-plugin-openvswitch-agent', head_pkg,
@@ -142,7 +160,8 @@
142 self.test_config.set('enable-local-dhcp-and-metadata', False)160 self.test_config.set('enable-local-dhcp-and-metadata', False)
143 _git_requested.return_value = True161 _git_requested.return_value = True
144 _use_dvr.return_value = True162 _use_dvr.return_value = True
145 _os_rel.return_value = 'trusty'163 _os_rel.return_value = 'icehouse'
164 self.os_release.return_value = 'icehouse'
146 _head_pkgs.return_value = head_pkg165 _head_pkgs.return_value = head_pkg
147 pkg_list = nutils.determine_packages()166 pkg_list = nutils.determine_packages()
148 self.assertFalse('neutron-l3-agent' in pkg_list)167 self.assertFalse('neutron-l3-agent' in pkg_list)
@@ -159,7 +178,7 @@
159 self.ctxts.append(ctxt)178 self.ctxts.append(ctxt)
160179
161 _use_dvr.return_value = False180 _use_dvr.return_value = False
162 self.os_release.return_value = 'trusty'181 self.os_release.return_value = 'icehouse'
163 templating.OSConfigRenderer.side_effect = _mock_OSConfigRenderer182 templating.OSConfigRenderer.side_effect = _mock_OSConfigRenderer
164 _regconfs = nutils.register_configs()183 _regconfs = nutils.register_configs()
165 confs = ['/etc/neutron/neutron.conf',184 confs = ['/etc/neutron/neutron.conf',
@@ -168,8 +187,29 @@
168 self.assertItemsEqual(_regconfs.configs, confs)187 self.assertItemsEqual(_regconfs.configs, confs)
169188
170 @patch.object(nutils, 'use_dvr')189 @patch.object(nutils, 'use_dvr')
190 def test_register_configs_mitaka(self, _use_dvr):
191 class _mock_OSConfigRenderer():
192 def __init__(self, templates_dir=None, openstack_release=None):
193 self.configs = []
194 self.ctxts = []
195
196 def register(self, config, ctxt):
197 self.configs.append(config)
198 self.ctxts.append(ctxt)
199
200 _use_dvr.return_value = False
201 self.os_release.return_value = 'mitaka'
202 templating.OSConfigRenderer.side_effect = _mock_OSConfigRenderer
203 _regconfs = nutils.register_configs()
204 confs = ['/etc/neutron/neutron.conf',
205 '/etc/neutron/plugins/ml2/openvswitch_agent.ini',
206 '/etc/init/os-charm-phy-nic-mtu.conf']
207 self.assertItemsEqual(_regconfs.configs, confs)
208
209 @patch.object(nutils, 'use_dvr')
171 def test_resource_map(self, _use_dvr):210 def test_resource_map(self, _use_dvr):
172 _use_dvr.return_value = False211 _use_dvr.return_value = False
212 self.os_release.return_value = 'icehouse'
173 _map = nutils.resource_map()213 _map = nutils.resource_map()
174 svcs = ['neutron-plugin-openvswitch-agent']214 svcs = ['neutron-plugin-openvswitch-agent']
175 confs = [nutils.NEUTRON_CONF]215 confs = [nutils.NEUTRON_CONF]
@@ -177,8 +217,19 @@
177 self.assertEqual(_map[nutils.NEUTRON_CONF]['services'], svcs)217 self.assertEqual(_map[nutils.NEUTRON_CONF]['services'], svcs)
178218
179 @patch.object(nutils, 'use_dvr')219 @patch.object(nutils, 'use_dvr')
220 def test_resource_map_mitaka(self, _use_dvr):
221 _use_dvr.return_value = False
222 self.os_release.return_value = 'mitaka'
223 _map = nutils.resource_map()
224 svcs = ['neutron-openvswitch-agent']
225 confs = [nutils.NEUTRON_CONF]
226 [self.assertIn(q_conf, _map.keys()) for q_conf in confs]
227 self.assertEqual(_map[nutils.NEUTRON_CONF]['services'], svcs)
228
229 @patch.object(nutils, 'use_dvr')
180 def test_resource_map_dvr(self, _use_dvr):230 def test_resource_map_dvr(self, _use_dvr):
181 _use_dvr.return_value = True231 _use_dvr.return_value = True
232 self.os_release.return_value = 'icehouse'
182 _map = nutils.resource_map()233 _map = nutils.resource_map()
183 svcs = ['neutron-plugin-openvswitch-agent', 'neutron-metadata-agent',234 svcs = ['neutron-plugin-openvswitch-agent', 'neutron-metadata-agent',
184 'neutron-l3-agent']235 'neutron-l3-agent']

Subscribers

People subscribed via source and target branches