Merge "Fix cinder message-client naming to volume_v3_messages_client"
diff --git a/REVIEWING.rst b/REVIEWING.rst
index cfe7f4c..9b272bb 100644
--- a/REVIEWING.rst
+++ b/REVIEWING.rst
@@ -93,6 +93,12 @@
.. _reno: http://docs.openstack.org/developer/reno/
+Deprecated Code
+---------------
+Sometimes we have some bugs in deprecated code. Basically, we leave it. Because
+we don't need to maintain it. However, if the bug is critical, we might need to
+fix it. When it will happen, we will deal with it on a case-by-case basis.
+
When to approve
---------------
* Every patch needs two +2s before being approved.
diff --git a/releasenotes/notes/add-cred_client-to-tempest.lib-4d4af33f969c576f.yaml b/releasenotes/notes/add-cred_client-to-tempest.lib-4d4af33f969c576f.yaml
new file mode 100644
index 0000000..432a6b1
--- /dev/null
+++ b/releasenotes/notes/add-cred_client-to-tempest.lib-4d4af33f969c576f.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - The cred_client module was added to tempest.lib. This module provides a
+ wrapper to the keystone services client which provides a uniform
+ interface that abstracts out the differences between keystone api versions.
diff --git a/releasenotes/source/unreleased.rst b/releasenotes/source/unreleased.rst
index 5860a46..875030f 100644
--- a/releasenotes/source/unreleased.rst
+++ b/releasenotes/source/unreleased.rst
@@ -1,5 +1,5 @@
-==========================
- Unreleased Release Notes
-==========================
+============================
+Current Series Release Notes
+============================
.. release-notes::
diff --git a/requirements.txt b/requirements.txt
index 9079a8d..07dd1c1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,10 +9,10 @@
netaddr!=0.7.16,>=0.7.13 # BSD
testrepository>=0.0.18 # Apache-2.0/BSD
oslo.concurrency>=3.8.0 # Apache-2.0
-oslo.config>=3.14.0 # Apache-2.0
+oslo.config!=3.18.0,>=3.14.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0
oslo.serialization>=1.10.0 # Apache-2.0
-oslo.utils>=3.17.0 # Apache-2.0
+oslo.utils>=3.18.0 # Apache-2.0
six>=1.9.0 # MIT
fixtures>=3.0.0 # Apache-2.0/BSD
PyYAML>=3.10.0 # MIT
diff --git a/tempest/api/baremetal/admin/test_nodestates.py b/tempest/api/baremetal/admin/test_nodestates.py
index 1ffea25..e74dd04 100644
--- a/tempest/api/baremetal/admin/test_nodestates.py
+++ b/tempest/api/baremetal/admin/test_nodestates.py
@@ -15,7 +15,7 @@
from oslo_utils import timeutils
from tempest.api.baremetal.admin import base
-from tempest import exceptions
+from tempest.lib import exceptions
from tempest import test
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index e5c8790..8504840 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -42,8 +42,12 @@
"{0} networks with label {1}".format(
len(configured_network),
CONF.compute.fixed_network_name))
+ elif CONF.network.public_network_id:
+ configured_network = [x for x in networks if x['id'] ==
+ CONF.network.public_network_id]
else:
- configured_network = networks
+ raise self.skipException(
+ "Environment has no known-for-sure existing network.")
configured_network = configured_network[0]
network = (self.client.show_network(configured_network['id'])
['network'])
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index a8c59ca..fc6a20f 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -20,7 +20,6 @@
from tempest.common.utils import net_utils
from tempest.common import waiters
from tempest import config
-from tempest import exceptions
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -71,7 +70,7 @@
'(current %s) within the required time (%s s).' %
(port_id, status, interface_status,
self.build_timeout))
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
return body
@@ -99,7 +98,7 @@
message = ('Port %s failed to detach (device_id %s) within '
'the required time (%s s).' %
(port_id, device_id, self.build_timeout))
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
return port
@@ -197,7 +196,7 @@
if len(ifs) == len(_ifs) and timed_out:
message = ('Failed to delete interface within '
'the required time: %s sec.' % self.build_timeout)
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
self.assertNotIn(iface['port_id'], [i['port_id'] for i in _ifs])
return _ifs
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index a48c17b..2f43157 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -265,22 +265,24 @@
self.flavor_ref)['flavor']
def create_flavor_with_ephemeral(ephem_disk):
- if ephem_disk > 0:
- flavor_name = data_utils.rand_name('eph_flavor')
- else:
- flavor_name = data_utils.rand_name('no_eph_flavor')
flavor_with_eph_disk_id = data_utils.rand_int_id(start=1000)
ram = flavor_base['ram']
vcpus = flavor_base['vcpus']
disk = flavor_base['disk']
- # Create a flavor with ephemeral disk
- flavor = (self.flavor_client.
- create_flavor(name=flavor_name,
- ram=ram, vcpus=vcpus, disk=disk,
- id=flavor_with_eph_disk_id,
- ephemeral=ephem_disk))['flavor']
+ if ephem_disk > 0:
+ # Create a flavor with ephemeral disk
+ flavor_name = data_utils.rand_name('eph_flavor')
+ flavor = self.flavor_client.create_flavor(
+ name=flavor_name, ram=ram, vcpus=vcpus, disk=disk,
+ id=flavor_with_eph_disk_id, ephemeral=ephem_disk)['flavor']
+ else:
+ # Create a flavor without ephemeral disk
+ flavor_name = data_utils.rand_name('no_eph_flavor')
+ flavor = self.flavor_client.create_flavor(
+ name=flavor_name, ram=ram, vcpus=vcpus, disk=disk,
+ id=flavor_with_eph_disk_id)['flavor']
self.addCleanup(flavor_clean_up, flavor['id'])
return flavor['id']
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index dadaaba..6b0c20f 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -276,29 +276,22 @@
@test.idempotent_id('f04f61a9-b7f3-4194-90b2-9bcf660d1bfe')
def test_delete_network_with_subnet(self):
# Creates a network
- name = data_utils.rand_name('network-')
- body = self.networks_client.create_network(name=name)
- network = body['network']
+ network = self.create_network()
net_id = network['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.networks_client.delete_network, net_id)
+ self._delete_network, network)
# Find a cidr that is not in use yet and create a subnet with it
subnet = self.create_subnet(network)
subnet_id = subnet['id']
# Delete network while the subnet still exists
- body = self.networks_client.delete_network(net_id)
+ self.networks_client.delete_network(net_id)
# Verify that the subnet got automatically deleted.
self.assertRaises(lib_exc.NotFound, self.subnets_client.show_subnet,
subnet_id)
- # Since create_subnet adds the subnet to the delete list, and it is
- # actually deleted here - this will create and issue, hence remove
- # it from the list.
- self.subnets.pop()
-
@test.idempotent_id('d2d596e2-8e76-47a9-ac51-d4648009f4d3')
def test_create_delete_subnet_without_gateway(self):
self._create_verify_delete_subnet()
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index 3f45634..a3792b4 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -18,7 +18,7 @@
from tempest.api.orchestration import base
from tempest.common.utils import data_utils
from tempest import config
-from tempest import exceptions
+from tempest.lib import exceptions
from tempest import test
CONF = config.CONF
diff --git a/tempest/api/volume/admin/v2/test_volumes_list.py b/tempest/api/volume/admin/v2/test_volumes_list.py
index 4437803..cdd9df9 100644
--- a/tempest/api/volume/admin/v2/test_volumes_list.py
+++ b/tempest/api/volume/admin/v2/test_volumes_list.py
@@ -29,7 +29,9 @@
def resource_setup(cls):
super(VolumesListAdminV2TestJSON, cls).resource_setup()
# Create 3 test volumes
- cls.volume_list = []
+ # NOTE(zhufl): When using pre-provisioned credentials, the project
+ # may have volumes other than those created below.
+ cls.volume_list = cls.volumes_client.list_volumes()['volumes']
for i in range(3):
volume = cls.create_volume()
# Fetch volume details
@@ -59,5 +61,6 @@
# primary tenant
fetched_tenant_id = [operator.itemgetter(
'os-vol-tenant-attr:tenant_id')(item) for item in fetched_list]
- expected_tenant_id = [self.volumes_client.tenant_id] * 3
+ expected_tenant_id = [self.volumes_client.tenant_id] * \
+ len(self.volume_list)
self.assertEqual(expected_tenant_id, fetched_tenant_id)
diff --git a/tempest/common/dynamic_creds.py b/tempest/common/dynamic_creds.py
index 5c12fd8..2763d16 100644
--- a/tempest/common/dynamic_creds.py
+++ b/tempest/common/dynamic_creds.py
@@ -17,7 +17,7 @@
import six
from tempest import clients
-from tempest.common import cred_client
+from tempest.lib.common import cred_client
from tempest.lib.common import cred_provider
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index c1942d6..92bce5f 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -92,7 +92,7 @@
caller = test_utils.find_test_caller()
if caller:
message = '(%s) %s' % (caller, message)
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
old_status = server_status
old_task_state = task_state
@@ -111,7 +111,7 @@
raise exceptions.BuildErrorException(server_id=server_id)
if int(time.time()) - start_time >= client.build_timeout:
- raise exceptions.TimeoutException
+ raise lib_exc.TimeoutException
time.sleep(client.build_interval)
@@ -163,7 +163,7 @@
caller = test_utils.find_test_caller()
if caller:
message = '(%s) %s' % (caller, message)
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
def wait_for_volume_status(client, volume_id, status):
@@ -186,7 +186,7 @@
'within the required time (%s s).' %
(volume_id, status, volume_status,
client.build_timeout))
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
def wait_for_snapshot_status(client, snapshot_id, status):
@@ -207,7 +207,7 @@
'within the required time (%s s).' %
(snapshot_id, status, snapshot_status,
client.build_timeout))
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
def wait_for_backup_status(client, backup_id, status):
@@ -228,7 +228,7 @@
'(current %s) within the required time (%s s).' %
(backup_id, status, backup_status,
client.build_timeout))
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
def wait_for_bm_node_status(client, node_id, attr, status):
@@ -257,7 +257,7 @@
caller = test_utils.find_test_caller()
if caller:
message = '(%s) %s' % (caller, message)
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
def wait_for_qos_operations(client, qos_id, operation, args=None):
@@ -288,5 +288,5 @@
raise lib_exc.UnprocessableEntity(msg)
if int(time.time()) - start_time >= client.build_timeout:
- raise exceptions.TimeoutException
+ raise lib_exc.TimeoutException
time.sleep(client.build_interval)
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 727d54e..43f919a 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -21,10 +21,6 @@
message = "Invalid service tag"
-class TimeoutException(exceptions.TempestException):
- message = "Request timed out"
-
-
class BuildErrorException(exceptions.TempestException):
message = "Server %(server_id)s failed to build and is in ERROR status"
diff --git a/tempest/lib/api_schema/response/compute/v2_1/parameter_types.py b/tempest/lib/api_schema/response/compute/v2_1/parameter_types.py
index 07cc890..3cc5ca4 100644
--- a/tempest/lib/api_schema/response/compute/v2_1/parameter_types.py
+++ b/tempest/lib/api_schema/response/compute/v2_1/parameter_types.py
@@ -94,3 +94,14 @@
'format': 'data-time'
}
}
+
+power_state = {
+ 'type': 'integer',
+ # 0: NOSTATE
+ # 1: RUNNING
+ # 3: PAUSED
+ # 4: SHUTDOWN
+ # 6: CRASHED
+ # 7: SUSPENDED
+ 'enum': [0, 1, 3, 4, 6, 7]
+}
diff --git a/tempest/lib/api_schema/response/compute/v2_1/servers.py b/tempest/lib/api_schema/response/compute/v2_1/servers.py
index 44497db..63e8467 100644
--- a/tempest/lib/api_schema/response/compute/v2_1/servers.py
+++ b/tempest/lib/api_schema/response/compute/v2_1/servers.py
@@ -170,7 +170,7 @@
# attributes.
'OS-EXT-STS:task_state': {'type': ['string', 'null']},
'OS-EXT-STS:vm_state': {'type': 'string'},
- 'OS-EXT-STS:power_state': {'type': 'integer'},
+ 'OS-EXT-STS:power_state': parameter_types.power_state,
'OS-EXT-SRV-ATTR:host': {'type': ['string', 'null']},
'OS-EXT-SRV-ATTR:instance_name': {'type': 'string'},
'OS-EXT-SRV-ATTR:hypervisor_hostname': {'type': ['string', 'null']},
diff --git a/tempest/lib/api_schema/response/compute/v2_16/servers.py b/tempest/lib/api_schema/response/compute/v2_16/servers.py
index 6868110..3eb658f 100644
--- a/tempest/lib/api_schema/response/compute/v2_16/servers.py
+++ b/tempest/lib/api_schema/response/compute/v2_16/servers.py
@@ -77,7 +77,7 @@
'OS-EXT-AZ:availability_zone': {'type': 'string'},
'OS-EXT-STS:task_state': {'type': ['string', 'null']},
'OS-EXT-STS:vm_state': {'type': 'string'},
- 'OS-EXT-STS:power_state': {'type': 'integer'},
+ 'OS-EXT-STS:power_state': parameter_types.power_state,
'OS-EXT-SRV-ATTR:host': {'type': ['string', 'null']},
'OS-EXT-SRV-ATTR:instance_name': {'type': 'string'},
'OS-EXT-SRV-ATTR:hypervisor_hostname': {'type': ['string', 'null']},
diff --git a/tempest/lib/api_schema/response/compute/v2_3/servers.py b/tempest/lib/api_schema/response/compute/v2_3/servers.py
index ee16333..f24103e 100644
--- a/tempest/lib/api_schema/response/compute/v2_3/servers.py
+++ b/tempest/lib/api_schema/response/compute/v2_3/servers.py
@@ -85,7 +85,7 @@
'OS-EXT-AZ:availability_zone': {'type': 'string'},
'OS-EXT-STS:task_state': {'type': ['string', 'null']},
'OS-EXT-STS:vm_state': {'type': 'string'},
- 'OS-EXT-STS:power_state': {'type': 'integer'},
+ 'OS-EXT-STS:power_state': parameter_types.power_state,
'OS-EXT-SRV-ATTR:host': {'type': ['string', 'null']},
'OS-EXT-SRV-ATTR:instance_name': {'type': 'string'},
'OS-EXT-SRV-ATTR:hypervisor_hostname': {'type': ['string', 'null']},
diff --git a/tempest/common/cred_client.py b/tempest/lib/common/cred_client.py
similarity index 100%
rename from tempest/common/cred_client.py
rename to tempest/lib/common/cred_client.py
diff --git a/tempest/lib/services/compute/agents_client.py b/tempest/lib/services/compute/agents_client.py
index 3f05d3b..169d978 100644
--- a/tempest/lib/services/compute/agents_client.py
+++ b/tempest/lib/services/compute/agents_client.py
@@ -26,8 +26,9 @@
def list_agents(self, **params):
"""List all agent builds.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listbuilds
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listbuilds
"""
url = 'os-agents'
if params:
@@ -40,8 +41,9 @@
def create_agent(self, **kwargs):
"""Create an agent build.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#agentbuild
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#agentbuild
"""
post_body = json.dumps({'agent': kwargs})
resp, body = self.post('os-agents', post_body)
@@ -52,8 +54,9 @@
def delete_agent(self, agent_id):
"""Delete an existing agent build.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteBuild
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteBuild
"""
resp, body = self.delete("os-agents/%s" % agent_id)
self.validate_response(schema.delete_agent, resp, body)
@@ -62,8 +65,9 @@
def update_agent(self, agent_id, **kwargs):
"""Update an agent build.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updatebuild
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#updatebuild
"""
put_body = json.dumps({'para': kwargs})
resp, body = self.put('os-agents/%s' % agent_id, put_body)
diff --git a/tempest/lib/services/compute/aggregates_client.py b/tempest/lib/services/compute/aggregates_client.py
index 7ad14bc..c1a6c8c 100644
--- a/tempest/lib/services/compute/aggregates_client.py
+++ b/tempest/lib/services/compute/aggregates_client.py
@@ -40,8 +40,9 @@
def create_aggregate(self, **kwargs):
"""Create a new aggregate.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createAggregate
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createAggregate
"""
post_body = json.dumps({'aggregate': kwargs})
resp, body = self.post('os-aggregates', post_body)
@@ -53,8 +54,9 @@
def update_aggregate(self, aggregate_id, **kwargs):
"""Update an aggregate.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateAggregate
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#updateAggregate
"""
put_body = json.dumps({'aggregate': kwargs})
resp, body = self.put('os-aggregates/%s' % aggregate_id, put_body)
@@ -84,8 +86,9 @@
def add_host(self, aggregate_id, **kwargs):
"""Add a host to the given aggregate.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#addHost
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#addHost
"""
post_body = json.dumps({'add_host': kwargs})
resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
@@ -97,8 +100,9 @@
def remove_host(self, aggregate_id, **kwargs):
"""Remove a host from the given aggregate.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#removeAggregateHost
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#removeAggregateHost
"""
post_body = json.dumps({'remove_host': kwargs})
resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
@@ -110,8 +114,9 @@
def set_metadata(self, aggregate_id, **kwargs):
"""Replace the aggregate's existing metadata with new metadata.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#addAggregateMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#addAggregateMetadata
"""
post_body = json.dumps({'set_metadata': kwargs})
resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
diff --git a/tempest/lib/services/compute/fixed_ips_client.py b/tempest/lib/services/compute/fixed_ips_client.py
index c25ac2c..682ee86 100644
--- a/tempest/lib/services/compute/fixed_ips_client.py
+++ b/tempest/lib/services/compute/fixed_ips_client.py
@@ -32,8 +32,9 @@
def reserve_fixed_ip(self, fixed_ip, **kwargs):
"""Reserve/Unreserve a fixed IP.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#reserveIP
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#reserveIP
"""
url = "os-fixed-ips/%s/action" % fixed_ip
resp, body = self.post(url, json.dumps(kwargs))
diff --git a/tempest/lib/services/compute/flavors_client.py b/tempest/lib/services/compute/flavors_client.py
index ae1700c..4d1044b 100644
--- a/tempest/lib/services/compute/flavors_client.py
+++ b/tempest/lib/services/compute/flavors_client.py
@@ -30,8 +30,9 @@
def list_flavors(self, detail=False, **params):
"""Lists flavors.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listFlavors
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listFlavors
"""
url = 'flavors'
_schema = schema.list_flavors
@@ -50,8 +51,9 @@
def show_flavor(self, flavor_id):
"""Shows details for a flavor.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#showFlavor
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#showFlavor
"""
resp, body = self.get("flavors/%s" % flavor_id)
body = json.loads(body)
@@ -61,8 +63,9 @@
def create_flavor(self, **kwargs):
"""Create a new flavor or instance type.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createFlavor
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createFlavor
"""
if kwargs.get('ephemeral'):
kwargs['OS-FLV-EXT-DATA:ephemeral'] = kwargs.pop('ephemeral')
@@ -79,8 +82,9 @@
def delete_flavor(self, flavor_id):
"""Delete the given flavor.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteFlavor
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteFlavor
"""
resp, body = self.delete("flavors/{0}".format(flavor_id))
self.validate_response(schema.delete_flavor, resp, body)
@@ -104,8 +108,9 @@
def set_flavor_extra_spec(self, flavor_id, **kwargs):
"""Set extra Specs to the mentioned flavor.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createFlavorExtraSpec
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createFlavorExtraSpec
"""
post_body = json.dumps({'extra_specs': kwargs})
resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
@@ -118,8 +123,9 @@
def list_flavor_extra_specs(self, flavor_id):
"""Get extra Specs details of the mentioned flavor.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listFlavorExtraSpecs
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listFlavorExtraSpecs
"""
resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
body = json.loads(body)
@@ -130,8 +136,9 @@
def show_flavor_extra_spec(self, flavor_id, key):
"""Get extra Specs key-value of the mentioned flavor and key.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#showFlavorExtraSpec
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#showFlavorExtraSpec
"""
resp, body = self.get('flavors/%s/os-extra_specs/%s' % (flavor_id,
key))
@@ -144,8 +151,9 @@
def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
"""Update specified extra Specs of the mentioned flavor and key.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateFlavorExtraSpec
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#updateFlavorExtraSpec
"""
resp, body = self.put('flavors/%s/os-extra_specs/%s' %
(flavor_id, key), json.dumps(kwargs))
@@ -160,8 +168,9 @@
# to keep backwards compatibility.
"""Unset extra Specs from the mentioned flavor.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteFlavorExtraSpec
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteFlavorExtraSpec
"""
resp, body = self.delete('flavors/%s/os-extra_specs/%s' %
(flavor_id, key))
@@ -171,8 +180,9 @@
def list_flavor_access(self, flavor_id):
"""Get flavor access information given the flavor id.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listFlavorAccess
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listFlavorAccess
"""
resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id)
body = json.loads(body)
@@ -183,8 +193,9 @@
def add_flavor_access(self, flavor_id, tenant_id):
"""Add flavor access for the specified tenant.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#addFlavorAccess
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#addFlavorAccess
"""
post_body = {
'addTenantAccess': {
@@ -201,8 +212,9 @@
def remove_flavor_access(self, flavor_id, tenant_id):
"""Remove flavor access from the specified tenant.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#removeFlavorAccess
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#removeFlavorAccess
"""
post_body = {
'removeTenantAccess': {
diff --git a/tempest/lib/services/compute/floating_ips_client.py b/tempest/lib/services/compute/floating_ips_client.py
index 6922c48..744e14c 100644
--- a/tempest/lib/services/compute/floating_ips_client.py
+++ b/tempest/lib/services/compute/floating_ips_client.py
@@ -27,8 +27,9 @@
def list_floating_ips(self, **params):
"""Returns a list of all floating IPs filtered by any parameters.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listfloatingipsObject
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listfloatingipsObject
"""
url = 'os-floating-ips'
if params:
@@ -42,8 +43,9 @@
def show_floating_ip(self, floating_ip_id):
"""Get the details of a floating IP.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#showFloatingIP
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#showFloatingIP
"""
url = "os-floating-ips/%s" % floating_ip_id
resp, body = self.get(url)
@@ -54,8 +56,9 @@
def create_floating_ip(self, **kwargs):
"""Allocate a floating IP to the project.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createFloatingIP
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createFloatingIP
"""
url = 'os-floating-ips'
post_body = json.dumps(kwargs)
@@ -67,8 +70,9 @@
def delete_floating_ip(self, floating_ip_id):
"""Deletes the provided floating IP from the project.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteFloatingIP
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteFloatingIP
"""
url = "os-floating-ips/%s" % floating_ip_id
resp, body = self.delete(url)
diff --git a/tempest/lib/services/compute/security_group_default_rules_client.py b/tempest/lib/services/compute/security_group_default_rules_client.py
index d57c8e0..e2d3c98 100644
--- a/tempest/lib/services/compute/security_group_default_rules_client.py
+++ b/tempest/lib/services/compute/security_group_default_rules_client.py
@@ -26,9 +26,9 @@
def create_security_default_group_rule(self, **kwargs):
"""Create security group default rule.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html
- #createSecGroupDefaultRule
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createSecGroupDefaultRule
"""
post_body = json.dumps({'security_group_default_rule': kwargs})
url = 'os-security-group-default-rules'
diff --git a/tempest/lib/services/compute/security_group_rules_client.py b/tempest/lib/services/compute/security_group_rules_client.py
index c969b81..3121e24 100644
--- a/tempest/lib/services/compute/security_group_rules_client.py
+++ b/tempest/lib/services/compute/security_group_rules_client.py
@@ -26,8 +26,9 @@
def create_security_group_rule(self, **kwargs):
"""Create a new security group rule.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createSecGroupRule
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createSecGroupRule
"""
post_body = json.dumps({'security_group_rule': kwargs})
url = 'os-security-group-rules'
diff --git a/tempest/lib/services/compute/security_groups_client.py b/tempest/lib/services/compute/security_groups_client.py
index 386c214..a247346 100644
--- a/tempest/lib/services/compute/security_groups_client.py
+++ b/tempest/lib/services/compute/security_groups_client.py
@@ -28,8 +28,9 @@
def list_security_groups(self, **params):
"""List all security groups for a user.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listSecGroups
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listSecGroups
"""
url = 'os-security-groups'
@@ -44,8 +45,9 @@
def show_security_group(self, security_group_id):
"""Get the details of a Security Group.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#showSecGroup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#showSecGroup
"""
url = "os-security-groups/%s" % security_group_id
resp, body = self.get(url)
@@ -56,8 +58,9 @@
def create_security_group(self, **kwargs):
"""Create a new security group.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createSecGroup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createSecGroup
"""
post_body = json.dumps({'security_group': kwargs})
resp, body = self.post('os-security-groups', post_body)
@@ -68,8 +71,9 @@
def update_security_group(self, security_group_id, **kwargs):
"""Update a security group.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateSecGroup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#updateSecGroup
"""
post_body = json.dumps({'security_group': kwargs})
resp, body = self.put('os-security-groups/%s' % security_group_id,
@@ -81,8 +85,9 @@
def delete_security_group(self, security_group_id):
"""Delete the provided Security Group.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteSecGroup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteSecGroup
"""
resp, body = self.delete(
'os-security-groups/%s' % security_group_id)
diff --git a/tempest/lib/services/compute/server_groups_client.py b/tempest/lib/services/compute/server_groups_client.py
index e370457..9ba8d38 100644
--- a/tempest/lib/services/compute/server_groups_client.py
+++ b/tempest/lib/services/compute/server_groups_client.py
@@ -26,8 +26,9 @@
def create_server_group(self, **kwargs):
"""Create the server group.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createServerGroup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createServerGroup
"""
post_body = json.dumps({'server_group': kwargs})
resp, body = self.post('os-server-groups', post_body)
diff --git a/tempest/lib/services/compute/servers_client.py b/tempest/lib/services/compute/servers_client.py
index d5902e1..24557d8 100644
--- a/tempest/lib/services/compute/servers_client.py
+++ b/tempest/lib/services/compute/servers_client.py
@@ -92,8 +92,9 @@
def update_server(self, server_id, **kwargs):
"""Update server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateServer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#updateServer
Most parameters except the following are passed to the API without
any changes.
@@ -112,8 +113,9 @@
def show_server(self, server_id):
"""Get server details.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#showServer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#showServer
"""
resp, body = self.get("servers/%s" % server_id)
body = json.loads(body)
@@ -124,8 +126,9 @@
def delete_server(self, server_id):
"""Delete server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteServer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteServer
"""
resp, body = self.delete("servers/%s" % server_id)
self.validate_response(schema.delete_server, resp, body)
@@ -134,10 +137,10 @@
def list_servers(self, detail=False, **params):
"""List servers.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listServers
- and http://developer.openstack.org/
- api-ref-compute-v2.1.html#listDetailServers
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listServers
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listDetailServers
"""
url = 'servers'
@@ -158,8 +161,9 @@
def list_addresses(self, server_id):
"""Lists all addresses for a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#list-ips
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#list-ips
"""
resp, body = self.get("servers/%s/ips" % server_id)
body = json.loads(body)
@@ -188,16 +192,18 @@
def create_backup(self, server_id, **kwargs):
"""Backup a server instance.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createBackup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createBackup
"""
return self.action(server_id, "createBackup", **kwargs)
def change_password(self, server_id, **kwargs):
"""Change the root password for the server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#changePassword
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#changePassword
"""
return self.action(server_id, 'changePassword', **kwargs)
@@ -223,16 +229,18 @@
def reboot_server(self, server_id, **kwargs):
"""Reboot a server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#reboot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#reboot
"""
return self.action(server_id, 'reboot', **kwargs)
def rebuild_server(self, server_id, image_ref, **kwargs):
"""Rebuild a server with a new image.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#rebuild
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#rebuild
Most parameters except the following are passed to the API without
any changes.
@@ -252,8 +260,9 @@
def resize_server(self, server_id, flavor_ref, **kwargs):
"""Change the flavor of a server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resize
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#resize
Most parameters except the following are passed to the API without
any changes.
@@ -267,8 +276,9 @@
def confirm_resize_server(self, server_id, **kwargs):
"""Confirm the flavor change for a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#confirmResize
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#confirmResize
"""
return self.action(server_id, 'confirmResize',
schema.server_actions_confirm_resize,
@@ -277,16 +287,18 @@
def revert_resize_server(self, server_id, **kwargs):
"""Revert a server back to its original flavor.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#revertResize
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#revertResize
"""
return self.action(server_id, 'revertResize', **kwargs)
def list_server_metadata(self, server_id):
"""Lists all metadata for a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listServerMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listServerMetadata
"""
resp, body = self.get("servers/%s/metadata" % server_id)
body = json.loads(body)
@@ -296,8 +308,9 @@
def set_server_metadata(self, server_id, meta, no_metadata_field=False):
"""Sets one or more metadata items for a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createServerMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createServerMetadata
"""
if no_metadata_field:
post_body = ""
@@ -312,8 +325,9 @@
def update_server_metadata(self, server_id, meta):
"""Updates one or more metadata items for a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#updateServerMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#updateServerMetadata
"""
post_body = json.dumps({'metadata': meta})
resp, body = self.post('servers/%s/metadata' % server_id,
@@ -326,8 +340,9 @@
def show_server_metadata_item(self, server_id, key):
"""Shows details for a metadata item, by key, for a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#showServerMetadataItem
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#showServerMetadataItem
"""
resp, body = self.get("servers/%s/metadata/%s" % (server_id, key))
body = json.loads(body)
@@ -338,8 +353,9 @@
def set_server_metadata_item(self, server_id, key, meta):
"""Sets a metadata item, by key, for a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#setServerMetadataItem
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#setServerMetadataItem
"""
post_body = json.dumps({'meta': meta})
resp, body = self.put('servers/%s/metadata/%s' % (server_id, key),
@@ -352,8 +368,9 @@
def delete_server_metadata_item(self, server_id, key):
"""Deletes a metadata item, by key, from a server.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteServerMetadataItem
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteServerMetadataItem
"""
resp, body = self.delete("servers/%s/metadata/%s" %
(server_id, key))
@@ -364,24 +381,27 @@
def stop_server(self, server_id, **kwargs):
"""Stops a running server and changes its status to SHUTOFF.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#stop
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#stop
"""
return self.action(server_id, 'os-stop', **kwargs)
def start_server(self, server_id, **kwargs):
"""Starts a stopped server and changes its status to ACTIVE.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#start
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#start
"""
return self.action(server_id, 'os-start', **kwargs)
def attach_volume(self, server_id, **kwargs):
"""Attaches a volume to a server instance.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#attachVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#attachVolume
"""
post_body = json.dumps({'volumeAttachment': kwargs})
resp, body = self.post('servers/%s/os-volume_attachments' % server_id,
@@ -402,8 +422,9 @@
def detach_volume(self, server_id, volume_id): # noqa
"""Detaches a volume from a server instance.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteVolumeAttachment
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteVolumeAttachment
"""
resp, body = self.delete('servers/%s/os-volume_attachments/%s' %
(server_id, volume_id))
@@ -413,9 +434,9 @@
def show_volume_attachment(self, server_id, volume_id):
"""Return details about the given volume attachment.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#
- getVolumeAttachmentDetails
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#getVolumeAttachmentDetails
"""
resp, body = self.get('servers/%s/os-volume_attachments/%s' % (
server_id, volume_id))
@@ -426,8 +447,9 @@
def list_volume_attachments(self, server_id):
"""Returns the list of volume attachments for a given instance.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listVolumeAttachments
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listVolumeAttachments
"""
resp, body = self.get('servers/%s/os-volume_attachments' % (
server_id))
@@ -438,8 +460,9 @@
def add_security_group(self, server_id, **kwargs):
"""Add a security group to the server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#addSecurityGroup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#addSecurityGroup
"""
# TODO(oomichi): The api-site doesn't contain this API description.
# So the above should be changed to the api-site link after
@@ -450,8 +473,9 @@
def remove_security_group(self, server_id, **kwargs):
"""Remove a security group from the server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#removeSecurityGroup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#removeSecurityGroup
"""
# TODO(oomichi): The api-site doesn't contain this API description.
# So the above should be changed to the api-site link after
@@ -462,104 +486,117 @@
def live_migrate_server(self, server_id, **kwargs):
"""This should be called with administrator privileges.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#migrateLive
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#migrateLive
"""
return self.action(server_id, 'os-migrateLive', **kwargs)
def migrate_server(self, server_id, **kwargs):
"""Migrate a server to a new host.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#migrate
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#migrate
"""
return self.action(server_id, 'migrate', **kwargs)
def lock_server(self, server_id, **kwargs):
"""Lock the given server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#lock
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#lock
"""
return self.action(server_id, 'lock', **kwargs)
def unlock_server(self, server_id, **kwargs):
"""UNlock the given server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#unlock
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#unlock
"""
return self.action(server_id, 'unlock', **kwargs)
def suspend_server(self, server_id, **kwargs):
"""Suspend the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#suspend
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#suspend
"""
return self.action(server_id, 'suspend', **kwargs)
def resume_server(self, server_id, **kwargs):
"""Un-suspend the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#resume
"""
return self.action(server_id, 'resume', **kwargs)
def pause_server(self, server_id, **kwargs):
"""Pause the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#pause
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#pause
"""
return self.action(server_id, 'pause', **kwargs)
def unpause_server(self, server_id, **kwargs):
"""Un-pause the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#unpause
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#unpause
"""
return self.action(server_id, 'unpause', **kwargs)
def reset_state(self, server_id, **kwargs):
"""Reset the state of a server to active/error.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resetState
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#resetState
"""
return self.action(server_id, 'os-resetState', **kwargs)
def shelve_server(self, server_id, **kwargs):
"""Shelve the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#shelve
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#shelve
"""
return self.action(server_id, 'shelve', **kwargs)
def unshelve_server(self, server_id, **kwargs):
"""Un-shelve the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#unshelve
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#unshelve
"""
return self.action(server_id, 'unshelve', **kwargs)
def shelve_offload_server(self, server_id, **kwargs):
"""Shelve-offload the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#shelveOffload
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#shelveOffload
"""
return self.action(server_id, 'shelveOffload', **kwargs)
def get_console_output(self, server_id, **kwargs):
"""Get console output.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#getConsoleOutput
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#getConsoleOutput
"""
return self.action(server_id, 'os-getConsoleOutput',
schema.get_console_output, **kwargs)
@@ -575,16 +612,18 @@
def rescue_server(self, server_id, **kwargs):
"""Rescue the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#rescue
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#rescue
"""
return self.action(server_id, 'rescue', schema.rescue_server, **kwargs)
def unrescue_server(self, server_id):
"""Unrescue the provided server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#unrescue
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#unrescue
"""
return self.action(server_id, 'unrescue')
@@ -612,40 +651,45 @@
def force_delete_server(self, server_id, **kwargs):
"""Force delete a server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#forceDelete
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#forceDelete
"""
return self.action(server_id, 'forceDelete', **kwargs)
def restore_soft_deleted_server(self, server_id, **kwargs):
"""Restore a soft-deleted server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#restore
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#restore
"""
return self.action(server_id, 'restore', **kwargs)
def reset_network(self, server_id, **kwargs):
"""Reset the Network of a server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#resetNetwork
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#resetNetwork
"""
return self.action(server_id, 'resetNetwork', **kwargs)
def inject_network_info(self, server_id, **kwargs):
"""Inject the Network Info into server.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#injectNetworkInfo
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#injectNetworkInfo
"""
return self.action(server_id, 'injectNetworkInfo', **kwargs)
def get_vnc_console(self, server_id, **kwargs):
"""Get URL of VNC console.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#getVNCConsole
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#getVNCConsole
"""
return self.action(server_id, "os-getVNCConsole",
schema.get_vnc_console, **kwargs)
@@ -653,15 +697,17 @@
def add_fixed_ip(self, server_id, **kwargs):
"""Add a fixed IP to server instance.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#addFixedIp
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#addFixedIp
"""
return self.action(server_id, 'addFixedIp', **kwargs)
def remove_fixed_ip(self, server_id, **kwargs):
"""Remove input fixed IP from input server instance.
- Available params: http://developer.openstack.org/
- api-ref-compute-v2.1.html#removeFixedIp
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#removeFixedIp
"""
return self.action(server_id, 'removeFixedIp', **kwargs)
diff --git a/tempest/lib/services/compute/services_client.py b/tempest/lib/services/compute/services_client.py
index b6dbe28..0dbd1b2 100644
--- a/tempest/lib/services/compute/services_client.py
+++ b/tempest/lib/services/compute/services_client.py
@@ -27,8 +27,9 @@
def list_services(self, **params):
"""Lists all running Compute services for a tenant.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listServices
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listServices
"""
url = 'os-services'
if params:
@@ -42,8 +43,9 @@
def enable_service(self, **kwargs):
"""Enable service on a host.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#enableScheduling
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#enableScheduling
"""
post_body = json.dumps(kwargs)
resp, body = self.put('os-services/enable', post_body)
@@ -54,8 +56,9 @@
def disable_service(self, **kwargs):
"""Disable service on a host.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#disableScheduling
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#disableScheduling
"""
post_body = json.dumps(kwargs)
resp, body = self.put('os-services/disable', post_body)
diff --git a/tempest/lib/services/compute/snapshots_client.py b/tempest/lib/services/compute/snapshots_client.py
index be41957..fde5288 100644
--- a/tempest/lib/services/compute/snapshots_client.py
+++ b/tempest/lib/services/compute/snapshots_client.py
@@ -27,8 +27,9 @@
def create_snapshot(self, volume_id, **kwargs):
"""Create a snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createSnapshot
"""
post_body = {
'volume_id': volume_id
diff --git a/tempest/lib/services/compute/volumes_client.py b/tempest/lib/services/compute/volumes_client.py
index 2787779..b75f22e 100644
--- a/tempest/lib/services/compute/volumes_client.py
+++ b/tempest/lib/services/compute/volumes_client.py
@@ -27,8 +27,9 @@
def list_volumes(self, detail=False, **params):
"""List all the volumes created.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#listVolumes
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#listVolumes
"""
url = 'os-volumes'
@@ -45,8 +46,9 @@
def show_volume(self, volume_id):
"""Return the details of a single volume.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#showVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#showVolume
"""
url = "os-volumes/%s" % volume_id
resp, body = self.get(url)
@@ -57,8 +59,9 @@
def create_volume(self, **kwargs):
"""Create a new Volume.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#createVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#createVolume
"""
post_body = json.dumps({'volume': kwargs})
resp, body = self.post('os-volumes', post_body)
@@ -69,8 +72,9 @@
def delete_volume(self, volume_id):
"""Delete the Specified Volume.
- Available params: see http://developer.openstack.org/
- api-ref-compute-v2.1.html#deleteVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-compute-v2.1.html#deleteVolume
"""
resp, body = self.delete("os-volumes/%s" % volume_id)
self.validate_response(schema.delete_volume, resp, body)
diff --git a/tempest/lib/services/volume/v1/volumes_client.py b/tempest/lib/services/volume/v1/volumes_client.py
index 3df8da4..cc98c91 100644
--- a/tempest/lib/services/volume/v1/volumes_client.py
+++ b/tempest/lib/services/volume/v1/volumes_client.py
@@ -22,7 +22,7 @@
class VolumesClient(rest_client.RestClient):
- """Base client class to send CRUD Volume API requests"""
+ """Client class to send CRUD Volume V1 API requests"""
def _prepare_params(self, params):
"""Prepares params for use in get or _ext_get methods.
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 831be99..dd1adc7 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -1287,7 +1287,7 @@
check_state, timeout, interval):
msg = ("Timed out waiting for node %s to reach %s state(s) %s" %
(node_id, state_attr, target_states))
- raise exceptions.TimeoutException(msg)
+ raise lib_exc.TimeoutException(msg)
def wait_provisioning_state(self, node_id, state, timeout):
self._node_state_timeout(
@@ -1311,7 +1311,7 @@
_get_node, CONF.baremetal.association_timeout, 1):
msg = ('Timed out waiting to get Ironic node by instance id %s'
% instance_id)
- raise exceptions.TimeoutException(msg)
+ raise lib_exc.TimeoutException(msg)
def get_node(self, node_id=None, instance_id=None):
if node_id:
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index b527c3d..125d61a 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -22,9 +22,9 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
-from tempest import exceptions
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
+from tempest.lib import exceptions
from tempest.scenario import manager
from tempest import test
diff --git a/tempest/scenario/test_object_storage_basic_ops.py b/tempest/scenario/test_object_storage_basic_ops.py
index 9ac1e30..1d2b2b6 100644
--- a/tempest/scenario/test_object_storage_basic_ops.py
+++ b/tempest/scenario/test_object_storage_basic_ops.py
@@ -18,23 +18,21 @@
class TestObjectStorageBasicOps(manager.ObjectStorageScenarioTest):
- """Test swift basic ops.
-
- * get swift stat.
- * create container.
- * upload a file to the created container.
- * list container's objects and assure that the uploaded file is present.
- * download the object and check the content
- * delete object from container.
- * list container's objects and assure that the deleted file is gone.
- * delete a container.
- * list containers and assure that the deleted container is gone.
- * change ACL of the container and make sure it works successfully
- """
-
@test.idempotent_id('b920faf1-7b8a-4657-b9fe-9c4512bfb381')
@test.services('object_storage')
def test_swift_basic_ops(self):
+ """Test swift basic ops.
+
+ * get swift stat.
+ * create container.
+ * upload a file to the created container.
+ * list container's objects and assure that the uploaded file is
+ present.
+ * download the object and check the content
+ * delete object from container.
+ * list container's objects and assure that the deleted file is gone.
+ * delete a container.
+ """
self.get_swift_stat()
container_name = self.create_container()
obj_name, obj_data = self.upload_object_to_container(container_name)
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index e031ff7..c66128d 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -119,14 +119,13 @@
@test.services('compute', 'network')
def test_server_basic_ops(self):
keypair = self.create_keypair()
- self.security_group = self._create_security_group()
- security_groups = [{'name': self.security_group['name']}]
+ security_group = self._create_security_group()
self.md = {'meta1': 'data1', 'meta2': 'data2', 'metaN': 'dataN'}
self.instance = self.create_server(
image_id=self.image_ref,
flavor=self.flavor_ref,
key_name=keypair['name'],
- security_groups=security_groups,
+ security_groups=[{'name': security_group['name']}],
config_drive=CONF.compute_feature_enabled.config_drive,
metadata=self.md,
wait_until='ACTIVE')
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 5fd934c..0f2c78c 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -21,7 +21,6 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
-from tempest import exceptions
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
@@ -93,7 +92,7 @@
if not test_utils.call_until_true(_func,
CONF.compute.build_timeout,
CONF.compute.build_interval):
- raise exceptions.TimeoutException
+ raise lib_exc.TimeoutException
@decorators.skip_because(bug="1205344")
@test.idempotent_id('10fd234a-515c-41e5-b092-8323060598c5')
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index ea5dbe5..9fec548 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -178,7 +178,7 @@
'within the required time (%s s).' %
(stack_name, status, stack_status,
self.build_timeout))
- raise exceptions.TimeoutException(message)
+ raise lib_exc.TimeoutException(message)
time.sleep(self.build_interval)
def show_resource_metadata(self, stack_identifier, resource_name):
diff --git a/tempest/test.py b/tempest/test.py
index cc9410f..b75ae48 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -25,12 +25,12 @@
import testtools
from tempest import clients
-from tempest.common import cred_client
from tempest.common import credentials_factory as credentials
from tempest.common import fixed_network
import tempest.common.validation_resources as vresources
from tempest import config
from tempest import exceptions
+from tempest.lib.common import cred_client
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
diff --git a/tempest/tests/cmd/test_account_generator.py b/tempest/tests/cmd/test_account_generator.py
index b3931d1..b08954f 100644
--- a/tempest/tests/cmd/test_account_generator.py
+++ b/tempest/tests/cmd/test_account_generator.py
@@ -146,7 +146,7 @@
identity_version = 2
identity_response = fake_identity._fake_v2_response
- cred_client = 'tempest.common.cred_client.V2CredsClient'
+ cred_client = 'tempest.lib.common.cred_client.V2CredsClient'
dynamic_creds = 'tempest.common.dynamic_creds.DynamicCredentialProvider'
def setUp(self):
@@ -245,7 +245,7 @@
identity_version = 3
identity_response = fake_identity._fake_v3_response
- cred_client = 'tempest.common.cred_client.V3CredsClient'
+ cred_client = 'tempest.lib.common.cred_client.V3CredsClient'
def setUp(self):
self.mock_domains()
@@ -256,7 +256,7 @@
identity_version = 2
identity_response = fake_identity._fake_v2_response
- cred_client = 'tempest.common.cred_client.V2CredsClient'
+ cred_client = 'tempest.lib.common.cred_client.V2CredsClient'
dynamic_creds = 'tempest.common.dynamic_creds.DynamicCredentialProvider'
domain_is_in = False
@@ -338,7 +338,7 @@
identity_version = 3
identity_response = fake_identity._fake_v3_response
- cred_client = 'tempest.common.cred_client.V3CredsClient'
+ cred_client = 'tempest.lib.common.cred_client.V3CredsClient'
domain_is_in = True
def setUp(self):
diff --git a/tempest/tests/common/test_waiters.py b/tempest/tests/common/test_waiters.py
index a826337..b113c04 100644
--- a/tempest/tests/common/test_waiters.py
+++ b/tempest/tests/common/test_waiters.py
@@ -18,6 +18,7 @@
from tempest.common import waiters
from tempest import exceptions
+from tempest.lib import exceptions as lib_exc
from tempest.lib.services.volume.v2 import volumes_client
from tempest.tests import base
import tempest.tests.utils as utils
@@ -43,7 +44,7 @@
time_mock.side_effect = utils.generate_timeout_series(1)
self.client.show_image.return_value = ({'status': 'saving'})
- self.assertRaises(exceptions.TimeoutException,
+ self.assertRaises(lib_exc.TimeoutException,
waiters.wait_for_image_status,
self.client, 'fake_image_id', 'active')
diff --git a/tempest/tests/lib/common/test_cred_client.py b/tempest/tests/lib/common/test_cred_client.py
new file mode 100644
index 0000000..1cb3103
--- /dev/null
+++ b/tempest/tests/lib/common/test_cred_client.py
@@ -0,0 +1,78 @@
+# Copyright 2016 Hewlett Packard Enterprise Development LP
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import mock
+
+from tempest.lib.common import cred_client
+from tempest.tests import base
+
+
+class TestCredClientV2(base.TestCase):
+ def setUp(self):
+ super(TestCredClientV2, self).setUp()
+ self.identity_client = mock.MagicMock()
+ self.projects_client = mock.MagicMock()
+ self.users_client = mock.MagicMock()
+ self.roles_client = mock.MagicMock()
+ self.creds_client = cred_client.V2CredsClient(self.identity_client,
+ self.projects_client,
+ self.users_client,
+ self.roles_client)
+
+ def test_create_project(self):
+ self.projects_client.create_tenant.return_value = {
+ 'tenant': 'a_tenant'
+ }
+ res = self.creds_client.create_project('fake_name', 'desc')
+ self.assertEqual('a_tenant', res)
+ self.projects_client.create_tenant.assert_called_once_with(
+ name='fake_name', description='desc')
+
+ def test_delete_project(self):
+ self.creds_client.delete_project('fake_id')
+ self.projects_client.delete_tenant.assert_called_once_with(
+ 'fake_id')
+
+
+class TestCredClientV3(base.TestCase):
+ def setUp(self):
+ super(TestCredClientV3, self).setUp()
+ self.identity_client = mock.MagicMock()
+ self.projects_client = mock.MagicMock()
+ self.users_client = mock.MagicMock()
+ self.roles_client = mock.MagicMock()
+ self.domains_client = mock.MagicMock()
+ self.domains_client.list_domains.return_value = {
+ 'domains': [{'id': 'fake_domain_id'}]
+ }
+ self.creds_client = cred_client.V3CredsClient(self.identity_client,
+ self.projects_client,
+ self.users_client,
+ self.roles_client,
+ self.domains_client,
+ 'fake_domain')
+
+ def test_create_project(self):
+ self.projects_client.create_project.return_value = {
+ 'project': 'a_tenant'
+ }
+ res = self.creds_client.create_project('fake_name', 'desc')
+ self.assertEqual('a_tenant', res)
+ self.projects_client.create_project.assert_called_once_with(
+ name='fake_name', description='desc', domain_id='fake_domain_id')
+
+ def test_delete_project(self):
+ self.creds_client.delete_project('fake_id')
+ print(self.projects_client.calls)
+ self.projects_client.delete_project.assert_called_once_with(
+ 'fake_id')
diff --git a/tempest/tests/lib/services/network/test_versions_client.py b/tempest/tests/lib/services/network/test_versions_client.py
index ae52c8a..026dc6d 100644
--- a/tempest/tests/lib/services/network/test_versions_client.py
+++ b/tempest/tests/lib/services/network/test_versions_client.py
@@ -35,10 +35,7 @@
"type": "text/html"
}
],
- "status": "CURRENT",
- "updated": "2013-07-23T11:33:21Z",
- "version": "2.0",
- "min_version": "2.0"
+ "status": "CURRENT"
}
}
diff --git a/test-requirements.txt b/test-requirements.txt
index 53efa46..9e3165c 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -5,7 +5,7 @@
# needed for doc build
sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
oslosphinx>=4.7.0 # Apache-2.0
-reno>=1.8.0 # Apache2
+reno>=1.8.0 # Apache-2.0
mock>=2.0 # BSD
-coverage>=3.6 # Apache-2.0
+coverage>=4.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0