Skip to content

Commit

Permalink
Merge "Use tempest.lib clients for bulk ops"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Mar 4, 2016
2 parents 63053db + 1f52fd9 commit 22dd1c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
6 changes: 3 additions & 3 deletions tempest/api/network/test_networks.py
Expand Up @@ -451,7 +451,7 @@ def test_bulk_create_delete_network(self):
# Creates 2 networks in one request
network_list = [{'name': data_utils.rand_name('network-')},
{'name': data_utils.rand_name('network-')}]
body = self.client.create_bulk_network(networks=network_list)
body = self.networks_client.create_bulk_networks(networks=network_list)
created_networks = body['networks']
self.addCleanup(self._delete_networks, created_networks)
# Asserting that the networks are found in the list after creation
Expand Down Expand Up @@ -486,7 +486,7 @@ def test_bulk_create_delete_subnet(self):
}
subnets_list.append(p1)
del subnets_list[1]['name']
body = self.client.create_bulk_subnet(subnets=subnets_list)
body = self.subnets_client.create_bulk_subnets(subnets=subnets_list)
created_subnets = body['subnets']
self.addCleanup(self._delete_subnets, created_subnets)
# Asserting that the subnets are found in the list after creation
Expand All @@ -512,7 +512,7 @@ def test_bulk_create_delete_port(self):
}
port_list.append(p1)
del port_list[1]['name']
body = self.client.create_bulk_port(ports=port_list)
body = self.ports_client.create_bulk_ports(ports=port_list)
created_ports = body['ports']
self.addCleanup(self._delete_ports, created_ports)
# Asserting that the ports are found in the list after creation
Expand Down
2 changes: 1 addition & 1 deletion tempest/api/network/test_ports.py
Expand Up @@ -75,7 +75,7 @@ def test_create_bulk_port(self):
network2 = self.create_network(network_name=name)
network_list = [network1['id'], network2['id']]
port_list = [{'network_id': net_id} for net_id in network_list]
body = self.client.create_bulk_port(ports=port_list)
body = self.ports_client.create_bulk_ports(ports=port_list)
created_ports = body['ports']
port1 = created_ports[0]
port2 = created_ports[1]
Expand Down
27 changes: 0 additions & 27 deletions tempest/services/network/json/network_client.py
Expand Up @@ -34,33 +34,6 @@ class NetworkClient(base.BaseNetworkClient):
quotas
"""

def create_bulk_network(self, **kwargs):
"""create bulk network
Available params: see http://developer.openstack.org/
api-ref-networking-v2.html#bulkCreateNetwork
"""
uri = '/networks'
return self.create_resource(uri, kwargs)

def create_bulk_subnet(self, **kwargs):
"""create bulk subnet
Available params: see http://developer.openstack.org/
api-ref-networking-v2.html#bulkCreateSubnet
"""
uri = '/subnets'
return self.create_resource(uri, kwargs)

def create_bulk_port(self, **kwargs):
"""create bulk port
Available params: see http://developer.openstack.org/
api-ref-networking-v2.html#bulkCreatePorts
"""
uri = '/ports'
return self.create_resource(uri, kwargs)

def wait_for_resource_deletion(self, resource_type, id, client=None):
"""Waits for a resource to be deleted."""
start_time = int(time.time())
Expand Down

0 comments on commit 22dd1c9

Please sign in to comment.