Added support to verify extra-routes deletion
Earlier the test was only verifying presence of extra routes
on the router.
Tempest client provides a method to delete the extra routes.
Assertion on this deletion was not present before, hence this
support is added.
Now the testcase will assert,
1. Presence of extra routes on the router after creation.
2. Absence of extra routes on the router after deletion.
Change-Id: I6f2c2ebdce227705f073a43ff04c8bddc4ca5fd4
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 406ad44..c9fe58d 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -269,7 +269,7 @@
@test.idempotent_id('c86ac3a8-50bd-4b00-a6b8-62af84a0765c')
@test.requires_ext(extension='extraroute', service='network')
- def test_update_extra_route(self):
+ def test_update_delete_extra_route(self):
# Create different cidr for each subnet to avoid cidr duplicate
# The cidr starts from tenant_cidr
next_cidr = netaddr.IPNetwork(self.tenant_cidr)
@@ -322,6 +322,10 @@
routes[i]['destination'])
self.assertEqual(test_routes[i]['nexthop'], routes[i]['nexthop'])
+ self.client.delete_extra_routes(router['id'])
+ show_body_after_deletion = self.client.show_router(router['id'])
+ self.assertEmpty(show_body_after_deletion['router']['routes'])
+
def _delete_extra_routes(self, router_id):
self.client.delete_extra_routes(router_id)