Fix neutron-dynamic-routing tests when DVR is disabled
OVN doesn't support DVR, so even creating a router with distributed=False will fail. We want a non-distributed router anyway, so just retry without that option if we get a BadRequest error. Change-Id: I004248eb259824614e27b3d8b739d3a72b580df3
This commit is contained in:
parent
b3aa2a7127
commit
1184bb2d10
@ -149,6 +149,19 @@ class BgpSpeakerTestJSONBase(base.BaseAdminNetworkTest):
|
|||||||
def delete_address_scope(self, id):
|
def delete_address_scope(self, id):
|
||||||
return self.admin_client.delete_address_scope(id)
|
return self.admin_client.delete_address_scope(id)
|
||||||
|
|
||||||
|
def create_router(self, ext_gw_info):
|
||||||
|
try:
|
||||||
|
router = self.admin_client.create_router(
|
||||||
|
'my-router',
|
||||||
|
external_gateway_info=ext_gw_info,
|
||||||
|
distributed=False)
|
||||||
|
# Retry if not running with DVR enabled
|
||||||
|
except lib_exc.BadRequest:
|
||||||
|
router = self.admin_client.create_router(
|
||||||
|
'my-router',
|
||||||
|
external_gateway_info=ext_gw_info)
|
||||||
|
return router['router']
|
||||||
|
|
||||||
|
|
||||||
class BgpSpeakerTestJSON(BgpSpeakerTestJSONBase):
|
class BgpSpeakerTestJSON(BgpSpeakerTestJSONBase):
|
||||||
|
|
||||||
@ -253,16 +266,12 @@ class BgpSpeakerTestJSON(BgpSpeakerTestJSONBase):
|
|||||||
tenant_net = self.create_network()
|
tenant_net = self.create_network()
|
||||||
tenant_subnet = self.create_subnet(tenant_net)
|
tenant_subnet = self.create_subnet(tenant_net)
|
||||||
ext_gw_info = {'network_id': self.ext_net_id}
|
ext_gw_info = {'network_id': self.ext_net_id}
|
||||||
router = self.admin_client.create_router(
|
router = self.create_router(ext_gw_info)
|
||||||
'my-router',
|
self.admin_routers.append(router)
|
||||||
external_gateway_info=ext_gw_info,
|
|
||||||
admin_state_up=True,
|
|
||||||
distributed=False)
|
|
||||||
self.admin_routers.append(router['router'])
|
|
||||||
self.admin_client.add_router_interface_with_subnet_id(
|
self.admin_client.add_router_interface_with_subnet_id(
|
||||||
router['router']['id'],
|
router['id'],
|
||||||
tenant_subnet['id'])
|
tenant_subnet['id'])
|
||||||
self.admin_routerports.append({'router_id': router['router']['id'],
|
self.admin_routerports.append({'router_id': router['id'],
|
||||||
'subnet_id': tenant_subnet['id']})
|
'subnet_id': tenant_subnet['id']})
|
||||||
tenant_port = self.create_port(tenant_net)
|
tenant_port = self.create_port(tenant_net)
|
||||||
floatingip = self.create_floatingip(self.ext_net_id)
|
floatingip = self.create_floatingip(self.ext_net_id)
|
||||||
@ -302,10 +311,7 @@ class BgpSpeakerTestJSON(BgpSpeakerTestJSONBase):
|
|||||||
ip_version=4,
|
ip_version=4,
|
||||||
subnetpool_id=tenant_subnetpool['id'])
|
subnetpool_id=tenant_subnetpool['id'])
|
||||||
ext_gw_info = {'network_id': ext_net['id']}
|
ext_gw_info = {'network_id': ext_net['id']}
|
||||||
router = self.admin_client.create_router(
|
router = self.create_router(ext_gw_info)
|
||||||
'my-router',
|
|
||||||
external_gateway_info=ext_gw_info,
|
|
||||||
distributed=False)['router']
|
|
||||||
self.admin_routers.append(router)
|
self.admin_routers.append(router)
|
||||||
self.admin_client.add_router_interface_with_subnet_id(
|
self.admin_client.add_router_interface_with_subnet_id(
|
||||||
router['id'],
|
router['id'],
|
||||||
|
@ -98,10 +98,7 @@ class BgpSpeakerTestJSONNegative(test_base.BgpSpeakerTestJSONBase):
|
|||||||
ip_version=4,
|
ip_version=4,
|
||||||
subnetpool_id=tenant_subnetpool2['id'])
|
subnetpool_id=tenant_subnetpool2['id'])
|
||||||
ext_gw_info = {'network_id': ext_net['id']}
|
ext_gw_info = {'network_id': ext_net['id']}
|
||||||
router = self.admin_client.create_router(
|
router = self.create_router(ext_gw_info)
|
||||||
'my-router',
|
|
||||||
distributed=False,
|
|
||||||
external_gateway_info=ext_gw_info)['router']
|
|
||||||
self.admin_routers.append(router)
|
self.admin_routers.append(router)
|
||||||
self.admin_client.add_router_interface_with_subnet_id(
|
self.admin_client.add_router_interface_with_subnet_id(
|
||||||
router['id'],
|
router['id'],
|
||||||
|
Loading…
Reference in New Issue
Block a user