api: Add HA router delete test
The test makes sure deleting router does not influence any HA network
segmentation details being wiped out.
Change-Id: Ib12986c25eda25970445169310c7c0334d6da49c
Related-bug: #1732543
diff --git a/neutron_tempest_plugin/api/base.py b/neutron_tempest_plugin/api/base.py
index 8db5108..ec66818 100644
--- a/neutron_tempest_plugin/api/base.py
+++ b/neutron_tempest_plugin/api/base.py
@@ -412,17 +412,18 @@
return qos_rule
@classmethod
- def delete_router(cls, router):
- body = cls.client.list_router_interfaces(router['id'])
+ def delete_router(cls, router, client=None):
+ client = client or cls.client
+ body = client.list_router_interfaces(router['id'])
interfaces = [port for port in body['ports']
if port['device_owner'] in const.ROUTER_INTERFACE_OWNERS]
for i in interfaces:
try:
- cls.client.remove_router_interface_with_subnet_id(
+ client.remove_router_interface_with_subnet_id(
router['id'], i['fixed_ips'][0]['subnet_id'])
except lib_exc.NotFound:
pass
- cls.client.delete_router(router['id'])
+ client.delete_router(router['id'])
@classmethod
def create_address_scope(cls, name, is_admin=False, **kwargs):