Merge "Finish migration to new engine facade in test_db_base_plugin_v2"
This commit is contained in:
commit
5db4be9bb1
|
@ -6508,11 +6508,10 @@ class DbModelMixin(object):
|
||||||
project_id='fake_project',
|
project_id='fake_project',
|
||||||
mtu=1500)
|
mtu=1500)
|
||||||
ctx.session.add(network)
|
ctx.session.add(network)
|
||||||
with db_api.autonested_transaction(ctx.session):
|
|
||||||
sg = sg_models.SecurityGroup(name='sg', description='sg')
|
|
||||||
ctx.session.add(sg)
|
|
||||||
# ensure db rels aren't loaded until commit for network object
|
# ensure db rels aren't loaded until commit for network object
|
||||||
# by sharing after a nested transaction
|
# by sharing after flush
|
||||||
|
ctx.session.flush()
|
||||||
|
|
||||||
network_obj.NetworkRBAC(
|
network_obj.NetworkRBAC(
|
||||||
ctx, object_id=network.id,
|
ctx, object_id=network.id,
|
||||||
action='access_as_shared',
|
action='access_as_shared',
|
||||||
|
@ -6556,11 +6555,12 @@ class DbModelMixin(object):
|
||||||
return sg, rule
|
return sg, rule
|
||||||
|
|
||||||
def _make_floating_ip(self, ctx, port_id):
|
def _make_floating_ip(self, ctx, port_id):
|
||||||
flip = l3_obj.FloatingIP(
|
with db_api.CONTEXT_WRITER.using(ctx):
|
||||||
ctx, floating_ip_address=netaddr.IPAddress('1.2.3.4'),
|
flip = l3_obj.FloatingIP(
|
||||||
floating_network_id=uuidutils.generate_uuid(),
|
ctx, floating_ip_address=netaddr.IPAddress('1.2.3.4'),
|
||||||
floating_port_id=port_id)
|
floating_network_id=uuidutils.generate_uuid(),
|
||||||
flip.create()
|
floating_port_id=port_id)
|
||||||
|
flip.create()
|
||||||
return flip
|
return flip
|
||||||
|
|
||||||
def _make_router(self, ctx):
|
def _make_router(self, ctx):
|
||||||
|
@ -6579,7 +6579,7 @@ class DbModelMixin(object):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
obj.__table__.name,
|
obj.__table__.name,
|
||||||
self._get_neutron_attr(ctx, attr_id).resource_type)
|
self._get_neutron_attr(ctx, attr_id).resource_type)
|
||||||
with ctx.session.begin():
|
with db_api.CONTEXT_WRITER.using(ctx):
|
||||||
ctx.session.delete(obj)
|
ctx.session.delete(obj)
|
||||||
with testtools.ExpectedException(orm.exc.NoResultFound):
|
with testtools.ExpectedException(orm.exc.NoResultFound):
|
||||||
# we want to make sure that the attr resource was removed
|
# we want to make sure that the attr resource was removed
|
||||||
|
@ -6755,7 +6755,7 @@ class DbModelTenantTestCase(DbModelMixin, testlib_api.SqlTestCase):
|
||||||
return subnet
|
return subnet
|
||||||
|
|
||||||
def _make_port(self, ctx, network_id):
|
def _make_port(self, ctx, network_id):
|
||||||
with ctx.session.begin():
|
with db_api.CONTEXT_WRITER.using(ctx):
|
||||||
port = models_v2.Port(network_id=network_id, mac_address='1',
|
port = models_v2.Port(network_id=network_id, mac_address='1',
|
||||||
tenant_id='dbcheck',
|
tenant_id='dbcheck',
|
||||||
admin_state_up=True, status="COOL",
|
admin_state_up=True, status="COOL",
|
||||||
|
@ -6795,7 +6795,7 @@ class DbModelProjectTestCase(DbModelMixin, testlib_api.SqlTestCase):
|
||||||
return subnet
|
return subnet
|
||||||
|
|
||||||
def _make_port(self, ctx, network_id):
|
def _make_port(self, ctx, network_id):
|
||||||
with ctx.session.begin():
|
with db_api.CONTEXT_WRITER.using(ctx):
|
||||||
port = models_v2.Port(network_id=network_id, mac_address='1',
|
port = models_v2.Port(network_id=network_id, mac_address='1',
|
||||||
project_id='dbcheck',
|
project_id='dbcheck',
|
||||||
admin_state_up=True, status="COOL",
|
admin_state_up=True, status="COOL",
|
||||||
|
|
Loading…
Reference in New Issue