Fix router leak from L3AgentsExtRbacTest class
The 'test_list_l3_agents_on_router' test leaves behind a router as a
resource leak. A class resource cleanup is added so that the router
is not left behind once the test runs.
Change-Id: Id393ea75e59fe26da598723993593f6759d594f5
diff --git a/patrole_tempest_plugin/tests/api/network/test_agents_rbac.py b/patrole_tempest_plugin/tests/api/network/test_agents_rbac.py
index 99210a4..3a34128 100644
--- a/patrole_tempest_plugin/tests/api/network/test_agents_rbac.py
+++ b/patrole_tempest_plugin/tests/api/network/test_agents_rbac.py
@@ -266,6 +266,10 @@
super(L3AgentsExtRbacTest, cls).resource_setup()
name = data_utils.rand_name(cls.__name__ + '-Router')
cls.router = cls.ntp_client.create_router(name)['router']
+ cls.addClassResourceCleanup(
+ test_utils.call_and_ignore_notfound_exc,
+ cls.ntp_client.delete_router,
+ cls.router['id'])
@decorators.idempotent_id('5d2bbdbc-40a5-43d2-828a-84dc93bcd321')
@rbac_rule_validation.action(service="neutron",