Merge "Remove dead helper function from test_l3_plugin"
This commit is contained in:
commit
756ea5125a
@ -1262,42 +1262,6 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
|
||||
self._test_floatingip_with_assoc_fails(
|
||||
'neutron.db.l3_db.L3_NAT_db_mixin')
|
||||
|
||||
def _test_floatingip_with_ip_generation_failure(self, plugin_class):
|
||||
with self.subnet(cidr='200.0.0.0/24') as public_sub:
|
||||
self._set_net_external(public_sub['subnet']['network_id'])
|
||||
with self.port() as private_port:
|
||||
with self.router() as r:
|
||||
sid = private_port['port']['fixed_ips'][0]['subnet_id']
|
||||
private_sub = {'subnet': {'id': sid}}
|
||||
self._add_external_gateway_to_router(
|
||||
r['router']['id'],
|
||||
public_sub['subnet']['network_id'])
|
||||
self._router_interface_action('add', r['router']['id'],
|
||||
private_sub['subnet']['id'],
|
||||
None)
|
||||
method = plugin_class + '._update_fip_assoc'
|
||||
with mock.patch(method) as pl:
|
||||
pl.side_effect = n_exc.IpAddressGenerationFailure(
|
||||
net_id='netid')
|
||||
res = self._create_floatingip(
|
||||
self.fmt,
|
||||
public_sub['subnet']['network_id'],
|
||||
port_id=private_port['port']['id'])
|
||||
self.assertEqual(res.status_int, exc.HTTPConflict.code)
|
||||
|
||||
for p in self._list('ports')['ports']:
|
||||
if (p['device_owner'] ==
|
||||
l3_constants.DEVICE_OWNER_FLOATINGIP):
|
||||
self.fail('garbage port is not deleted')
|
||||
|
||||
self._remove_external_gateway_from_router(
|
||||
r['router']['id'],
|
||||
public_sub['subnet']['network_id'])
|
||||
self._router_interface_action('remove',
|
||||
r['router']['id'],
|
||||
private_sub['subnet']['id'],
|
||||
None)
|
||||
|
||||
def test_floatingip_update(
|
||||
self, expected_status=l3_constants.FLOATINGIP_STATUS_ACTIVE):
|
||||
with self.port() as p:
|
||||
|
Loading…
x
Reference in New Issue
Block a user