Refactor the subnetpools API tests
test_create_dual_stack_subnets_from_subnetpools
was not cleaning the created subnetpool.
In order to address this issue, this patch
- adds the cleanup of subnetpools in base.resource_cleanup
- and removes the calls to the function addCleanup in the
subnetpools tests.
This patch also removes the CRUD subnetpools functions
from network_client.py as it is not required.
Change-Id: I7ad902dbb303ab9e5d01caceb59cc16f7902aaf9
Closes-bug: #1475176
diff --git a/neutron/tests/tempest/services/network/json/network_client.py b/neutron/tests/tempest/services/network/json/network_client.py
index 25400ca..862afbe 100644
--- a/neutron/tests/tempest/services/network/json/network_client.py
+++ b/neutron/tests/tempest/services/network/json/network_client.py
@@ -177,46 +177,6 @@
return method_functors[index](name[prefix_len:])
raise AttributeError(name)
- # Subnetpool methods
- def create_subnetpool(self, post_data):
- body = self.serialize_list(post_data, "subnetpools", "subnetpool")
- uri = self.get_uri("subnetpools")
- resp, body = self.post(uri, body)
- body = {'subnetpool': self.deserialize_list(body)}
- self.expected_success(201, resp.status)
- return service_client.ResponseBody(resp, body)
-
- def get_subnetpool(self, id):
- uri = self.get_uri("subnetpools")
- subnetpool_uri = '%s/%s' % (uri, id)
- resp, body = self.get(subnetpool_uri)
- body = {'subnetpool': self.deserialize_list(body)}
- self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body)
-
- def delete_subnetpool(self, id):
- uri = self.get_uri("subnetpools")
- subnetpool_uri = '%s/%s' % (uri, id)
- resp, body = self.delete(subnetpool_uri)
- self.expected_success(204, resp.status)
- return service_client.ResponseBody(resp, body)
-
- def list_subnetpools(self):
- uri = self.get_uri("subnetpools")
- resp, body = self.get(uri)
- body = {'subnetpools': self.deserialize_list(body)}
- self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body)
-
- def update_subnetpool(self, id, post_data):
- body = self.serialize_list(post_data, "subnetpools", "subnetpool")
- uri = self.get_uri("subnetpools")
- subnetpool_uri = '%s/%s' % (uri, id)
- resp, body = self.put(subnetpool_uri, body)
- body = {'subnetpool': self.deserialize_list(body)}
- self.expected_success(200, resp.status)
- return service_client.ResponseBody(resp, body)
-
# Common methods that are hard to automate
def create_bulk_network(self, names, shared=False):
network_list = [{'name': name, 'shared': shared} for name in names]