214
214
@patch.object(charmhelpers.contrib.openstack.context, 'related_units')
215
215
@patch.object(charmhelpers.contrib.openstack.context, 'relation_ids')
216
216
@patch.object(charmhelpers.contrib.openstack.context, 'log')
217
@patch.object(charmhelpers.contrib.openstack.context, 'kv')
217
218
@patch('__builtin__.__import__')
218
219
@patch('__builtin__.open')
219
def test_context_peers(self, _open, _import, _log, _rids, _runits, _rget,
220
_uget, _lunit, _config, _get_address_in_network,
221
_get_netmask_for_address):
220
def test_context_peers(self, _open, _import, _kv, _log, _rids, _runits,
221
_rget, _uget, _lunit, _config,
222
_get_address_in_network, _get_netmask_for_address):
222
223
unit_addresses = {
223
224
'neutron-api-0': '10.10.10.10',
224
225
'neutron-api-1': '10.10.10.11',
231
232
_config.return_value = None
232
233
_get_address_in_network.return_value = None
233
234
_get_netmask_for_address.return_value = '255.255.255.0'
235
_kv().get.return_value = 'abcdefghijklmnopqrstuvwxyz123456'
234
236
service_ports = {'neutron-server': [9696, 9686]}
235
237
self.maxDiff = None
237
239
'local_host': '127.0.0.1',
238
240
'haproxy_host': '0.0.0.0',
239
241
'local_host': '127.0.0.1',
240
'stat_port': ':8888',
243
'stat_password': 'abcdefghijklmnopqrstuvwxyz123456',
243
246
'network': '10.10.10.11/255.255.255.0',