Merge "Remove an obselete msg from then optimize a router test case"
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/12.2.0-clients_module-16f3025f515bf9ec.yaml b/releasenotes/notes/12.2.0-clients_module-16f3025f515bf9ec.yaml
index 53741da..484d543 100644
--- a/releasenotes/notes/12.2.0-clients_module-16f3025f515bf9ec.yaml
+++ b/releasenotes/notes/12.2.0-clients_module-16f3025f515bf9ec.yaml
@@ -8,7 +8,7 @@
access service clients defined in Tempest as well as service clients
defined in all loaded plugins.
The new ServiceClients class only exposes for now the service clients
- which are in tempest.lib, i.e. compute, network and image. The remaing
+ which are in tempest.lib, i.e. compute, network and image. The remaining
service clients (identity, volume and object-storage) will be added in
future updates.
deprecations:
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/notes/add-image-clients-af94564fb34ddca6.yaml b/releasenotes/notes/add-image-clients-af94564fb34ddca6.yaml
new file mode 100644
index 0000000..7e40fd4
--- /dev/null
+++ b/releasenotes/notes/add-image-clients-af94564fb34ddca6.yaml
@@ -0,0 +1,9 @@
+---
+features:
+ - |
+ As in the [doc]:
+ http://developer.openstack.org/api-ref/image/v2/metadefs-index.html,
+ there are some apis are not included, add them.
+
+ * namespace_properties_client(v2)
+
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..d9a9ebb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,18 +1,18 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-pbr>=1.6 # Apache-2.0
-cliff>=2.2.0 # Apache-2.0
+pbr>=1.8 # Apache-2.0
+cliff>=2.3.0 # Apache-2.0
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
testtools>=1.4.0 # MIT
paramiko>=2.0 # LGPLv2.1+
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_agents.py b/tempest/api/compute/admin/test_agents.py
index 61359f1..40cb523 100644
--- a/tempest/api/compute/admin/test_agents.py
+++ b/tempest/api/compute/admin/test_agents.py
@@ -90,7 +90,8 @@
body = self.client.create_agent(**self.params_agent)['agent']
self.addCleanup(self.client.delete_agent, body['agent_id'])
agents = self.client.list_agents()['agents']
- self.assertTrue(len(agents) > 0, 'Cannot get any agents.(%s)' % agents)
+ self.assertGreater(len(agents), 0,
+ 'Cannot get any agents.(%s)' % agents)
self.assertIn(body['agent_id'], map(lambda x: x['agent_id'], agents))
@test.idempotent_id('eabadde4-3cd7-4ec4-a4b5-5a936d2d4408')
@@ -108,7 +109,8 @@
agent_id_xen = agent_xen['agent_id']
agents = (self.client.list_agents(hypervisor=agent_xen['hypervisor'])
['agents'])
- self.assertTrue(len(agents) > 0, 'Cannot get any agents.(%s)' % agents)
+ self.assertGreater(len(agents), 0,
+ 'Cannot get any agents.(%s)' % agents)
self.assertIn(agent_id_xen, map(lambda x: x['agent_id'], agents))
self.assertNotIn(body['agent_id'], map(lambda x: x['agent_id'],
agents))
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 3c4e313..85aa301 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -40,6 +40,13 @@
for host in hosts_all if host['service'] == 'compute'])
cls.host = hosts[0]
+ def _create_test_aggregate(self):
+ aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
+ aggregate = (self.client.create_aggregate(name=aggregate_name)
+ ['aggregate'])
+ self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+ return aggregate
+
@test.attr(type=['negative'])
@test.idempotent_id('86a1cb14-da37-4a70-b056-903fd56dfe29')
def test_aggregate_create_as_user(self):
@@ -70,24 +77,16 @@
@test.idempotent_id('9c23a291-b0b1-487b-b464-132e061151b3')
def test_aggregate_create_with_existent_aggregate_name(self):
# creating an aggregate with existent aggregate name is forbidden
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = self.client.create_aggregate(name=aggregate_name)
- self.addCleanup(self.client.delete_aggregate,
- aggregate['aggregate']['id'])
-
+ aggregate = self._create_test_aggregate()
self.assertRaises(lib_exc.Conflict,
self.client.create_aggregate,
- name=aggregate_name)
+ name=aggregate['name'])
@test.attr(type=['negative'])
@test.idempotent_id('cd6de795-c15d-45f1-8d9e-813c6bb72a3d')
def test_aggregate_delete_as_user(self):
# Regular user is not allowed to delete an aggregate.
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = (self.client.create_aggregate(name=aggregate_name)
- ['aggregate'])
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
-
+ aggregate = self._create_test_aggregate()
self.assertRaises(lib_exc.Forbidden,
self.user_client.delete_aggregate,
aggregate['id'])
@@ -103,11 +102,7 @@
@test.idempotent_id('557cad12-34c9-4ff4-95f0-22f0dfbaf7dc')
def test_aggregate_get_details_as_user(self):
# Regular user is not allowed to get aggregate details.
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = (self.client.create_aggregate(name=aggregate_name)
- ['aggregate'])
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
-
+ aggregate = self._create_test_aggregate()
self.assertRaises(lib_exc.Forbidden,
self.user_client.show_aggregate,
aggregate['id'])
@@ -136,12 +131,7 @@
non_exist_host = data_utils.rand_name('nonexist_host')
if non_exist_host not in hosts:
break
-
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = (self.client.create_aggregate(name=aggregate_name)
- ['aggregate'])
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
-
+ aggregate = self._create_test_aggregate()
self.assertRaises(lib_exc.NotFound, self.client.add_host,
aggregate['id'], host=non_exist_host)
@@ -149,11 +139,7 @@
@test.idempotent_id('7324c334-bd13-4c93-8521-5877322c3d51')
def test_aggregate_add_host_as_user(self):
# Regular user is not allowed to add a host to an aggregate.
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = (self.client.create_aggregate(name=aggregate_name)
- ['aggregate'])
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
-
+ aggregate = self._create_test_aggregate()
self.assertRaises(lib_exc.Forbidden,
self.user_client.add_host,
aggregate['id'], host=self.host)
@@ -162,10 +148,7 @@
@test.idempotent_id('19dd44e1-c435-4ee1-a402-88c4f90b5950')
def test_aggregate_add_existent_host(self):
self.useFixture(fixtures.LockFixture('availability_zone'))
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = (self.client.create_aggregate(name=aggregate_name)
- ['aggregate'])
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+ aggregate = self._create_test_aggregate()
self.client.add_host(aggregate['id'], host=self.host)
self.addCleanup(self.client.remove_host, aggregate['id'],
@@ -179,10 +162,8 @@
def test_aggregate_remove_host_as_user(self):
# Regular user is not allowed to remove a host from an aggregate.
self.useFixture(fixtures.LockFixture('availability_zone'))
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = (self.client.create_aggregate(name=aggregate_name)
- ['aggregate'])
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+ aggregate = self._create_test_aggregate()
+
self.client.add_host(aggregate['id'], host=self.host)
self.addCleanup(self.client.remove_host, aggregate['id'],
host=self.host)
@@ -194,11 +175,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('95d6a6fa-8da9-4426-84d0-eec0329f2e4d')
def test_aggregate_remove_nonexistent_host(self):
- non_exist_host = data_utils.rand_name('nonexist_host')
- aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)
- aggregate = (self.client.create_aggregate(name=aggregate_name)
- ['aggregate'])
- self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+ aggregate = self._create_test_aggregate()
self.assertRaises(lib_exc.NotFound, self.client.remove_host,
- aggregate['id'], host=non_exist_host)
+ aggregate['id'], host='nonexist_host')
diff --git a/tempest/api/compute/admin/test_auto_allocate_network.py b/tempest/api/compute/admin/test_auto_allocate_network.py
index ee8ed14..4eb3376 100644
--- a/tempest/api/compute/admin/test_auto_allocate_network.py
+++ b/tempest/api/compute/admin/test_auto_allocate_network.py
@@ -66,7 +66,6 @@
@classmethod
def setup_clients(cls):
super(AutoAllocateNetworkTest, cls).setup_clients()
- cls.servers_client = cls.servers_client
cls.networks_client = cls.os.networks_client
cls.routers_client = cls.os.routers_client
cls.subnets_client = cls.os.subnets_client
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index b0ab9be..7eb4bbf 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -102,11 +102,10 @@
@test.attr(type=['negative'])
@test.idempotent_id('440b9f3f-3c7f-4293-a106-0ceda350f8de')
def test_flavor_unset_nonexistent_key(self):
- nonexistent_key = data_utils.rand_name('flavor_key')
self.assertRaises(lib_exc.NotFound,
self.client.unset_flavor_extra_spec,
self.flavor['id'],
- nonexistent_key)
+ 'nonexistent_key')
@test.attr(type=['negative'])
@test.idempotent_id('329a7be3-54b2-48be-8052-bf2ce4afd898')
diff --git a/tempest/api/compute/admin/test_floating_ips_bulk.py b/tempest/api/compute/admin/test_floating_ips_bulk.py
index e207aed..a4695b0 100644
--- a/tempest/api/compute/admin/test_floating_ips_bulk.py
+++ b/tempest/api/compute/admin/test_floating_ips_bulk.py
@@ -17,6 +17,7 @@
from tempest.api.compute import base
from tempest import config
+from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions
from tempest import test
@@ -54,12 +55,6 @@
raise exceptions.InvalidConfiguration(msg)
return
- def _delete_floating_ips_bulk(self, ip_range):
- try:
- self.client.delete_floating_ips_bulk(ip_range)
- except Exception:
- pass
-
@test.idempotent_id('2c8f145f-8012-4cb8-ac7e-95a587f0e4ab')
@test.services('network')
def test_create_list_delete_floating_ips_bulk(self):
@@ -73,7 +68,8 @@
pool,
interface)
['floating_ips_bulk_create'])
- self.addCleanup(self._delete_floating_ips_bulk, self.ip_range)
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ self.client.delete_floating_ips_bulk, self.ip_range)
self.assertEqual(self.ip_range, body['ip_range'])
ips_list = self.client.list_floating_ips_bulk()['floating_ip_info']
self.assertNotEqual(0, len(ips_list))
diff --git a/tempest/api/compute/admin/test_hosts.py b/tempest/api/compute/admin/test_hosts.py
index 29e1eb8..3797b29 100644
--- a/tempest/api/compute/admin/test_hosts.py
+++ b/tempest/api/compute/admin/test_hosts.py
@@ -28,7 +28,7 @@
@test.idempotent_id('9bfaf98d-e2cb-44b0-a07e-2558b2821e4f')
def test_list_hosts(self):
hosts = self.client.list_hosts()['hosts']
- self.assertTrue(len(hosts) >= 2, str(hosts))
+ self.assertGreaterEqual(len(hosts), 2, str(hosts))
@test.idempotent_id('5dc06f5b-d887-47a2-bb2a-67762ef3c6de')
def test_list_hosts_with_zone(self):
diff --git a/tempest/api/compute/admin/test_hosts_negative.py b/tempest/api/compute/admin/test_hosts_negative.py
index c270829..3821b22 100644
--- a/tempest/api/compute/admin/test_hosts_negative.py
+++ b/tempest/api/compute/admin/test_hosts_negative.py
@@ -13,7 +13,6 @@
# under the License.
from tempest.api.compute import base
-from tempest.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -27,11 +26,13 @@
cls.client = cls.os_adm.hosts_client
cls.non_admin_client = cls.os.hosts_client
- def _get_host_name(self):
- hosts = self.client.list_hosts()['hosts']
- self.assertGreaterEqual(len(hosts), 1)
- hostname = hosts[0]['host_name']
- return hostname
+ @classmethod
+ def resource_setup(cls):
+ super(HostsAdminNegativeTestJSON, cls).resource_setup()
+ hosts = cls.client.list_hosts()['hosts']
+ if not hosts:
+ raise lib_exc.NotFound("no host found")
+ cls.hostname = hosts[0]['host_name']
@test.attr(type=['negative'])
@test.idempotent_id('dd032027-0210-4d9c-860e-69b1b8deed5f')
@@ -42,27 +43,22 @@
@test.attr(type=['negative'])
@test.idempotent_id('e75b0a1a-041f-47a1-8b4a-b72a6ff36d3f')
def test_show_host_detail_with_nonexistent_hostname(self):
- nonexitent_hostname = data_utils.rand_name('rand_hostname')
self.assertRaises(lib_exc.NotFound,
- self.client.show_host, nonexitent_hostname)
+ self.client.show_host, 'nonexistent_hostname')
@test.attr(type=['negative'])
@test.idempotent_id('19ebe09c-bfd4-4b7c-81a2-e2e0710f59cc')
def test_show_host_detail_with_non_admin_user(self):
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.show_host,
- hostname)
+ self.hostname)
@test.attr(type=['negative'])
@test.idempotent_id('e40c72b1-0239-4ed6-ba21-81a184df1f7c')
def test_update_host_with_non_admin_user(self):
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.update_host,
- hostname,
+ self.hostname,
status='enable',
maintenance_mode='enable')
@@ -70,11 +66,9 @@
@test.idempotent_id('fbe2bf3e-3246-4a95-a59f-94e4e298ec77')
def test_update_host_with_invalid_status(self):
# 'status' can only be 'enable' or 'disable'
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.BadRequest,
self.client.update_host,
- hostname,
+ self.hostname,
status='invalid',
maintenance_mode='enable')
@@ -82,11 +76,9 @@
@test.idempotent_id('ab1e230e-5e22-41a9-8699-82b9947915d4')
def test_update_host_with_invalid_maintenance_mode(self):
# 'maintenance_mode' can only be 'enable' or 'disable'
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.BadRequest,
self.client.update_host,
- hostname,
+ self.hostname,
status='enable',
maintenance_mode='invalid')
@@ -94,73 +86,57 @@
@test.idempotent_id('0cd85f75-6992-4a4a-b1bd-d11e37fd0eee')
def test_update_host_without_param(self):
# 'status' or 'maintenance_mode' needed for host update
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.BadRequest,
self.client.update_host,
- hostname)
+ self.hostname)
@test.attr(type=['negative'])
@test.idempotent_id('23c92146-2100-4d68-b2d6-c7ade970c9c1')
def test_update_nonexistent_host(self):
- nonexitent_hostname = data_utils.rand_name('rand_hostname')
-
self.assertRaises(lib_exc.NotFound,
self.client.update_host,
- nonexitent_hostname,
+ 'nonexistent_hostname',
status='enable',
maintenance_mode='enable')
@test.attr(type=['negative'])
@test.idempotent_id('0d981ac3-4320-4898-b674-82b61fbb60e4')
def test_startup_nonexistent_host(self):
- nonexitent_hostname = data_utils.rand_name('rand_hostname')
-
self.assertRaises(lib_exc.NotFound,
self.client.startup_host,
- nonexitent_hostname)
+ 'nonexistent_hostname')
@test.attr(type=['negative'])
@test.idempotent_id('9f4ebb7e-b2ae-4e5b-a38f-0fd1bb0ddfca')
def test_startup_host_with_non_admin_user(self):
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.startup_host,
- hostname)
+ self.hostname)
@test.attr(type=['negative'])
@test.idempotent_id('9e637444-29cf-4244-88c8-831ae82c31b6')
def test_shutdown_nonexistent_host(self):
- nonexitent_hostname = data_utils.rand_name('rand_hostname')
-
self.assertRaises(lib_exc.NotFound,
self.client.shutdown_host,
- nonexitent_hostname)
+ 'nonexistent_hostname')
@test.attr(type=['negative'])
@test.idempotent_id('a803529c-7e3f-4d3c-a7d6-8e1c203d27f6')
def test_shutdown_host_with_non_admin_user(self):
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.shutdown_host,
- hostname)
+ self.hostname)
@test.attr(type=['negative'])
@test.idempotent_id('f86bfd7b-0b13-4849-ae29-0322e83ee58b')
def test_reboot_nonexistent_host(self):
- nonexitent_hostname = data_utils.rand_name('rand_hostname')
-
self.assertRaises(lib_exc.NotFound,
self.client.reboot_host,
- nonexitent_hostname)
+ 'nonexistent_hostname')
@test.attr(type=['negative'])
@test.idempotent_id('02d79bb9-eb57-4612-abf6-2cb38897d2f8')
def test_reboot_host_with_non_admin_user(self):
- hostname = self._get_host_name()
-
self.assertRaises(lib_exc.Forbidden,
self.non_admin_client.reboot_host,
- hostname)
+ self.hostname)
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index 92a9135..55134b1 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -31,7 +31,7 @@
return hypers
def assertHypervisors(self, hypers):
- self.assertTrue(len(hypers) > 0, "No hypervisors found: %s" % hypers)
+ self.assertGreater(len(hypers), 0, "No hypervisors found: %s" % hypers)
@test.idempotent_id('7f0ceacd-c64d-4e96-b8ee-d02943142cc5')
def test_get_hypervisor_list(self):
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index 220ea39..0f35e14 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -122,12 +122,10 @@
@test.attr(type=['negative'])
@test.idempotent_id('19a45cc1-1000-4055-b6d2-28e8b2ec4faa')
def test_search_nonexistent_hypervisor(self):
- nonexistent_hypervisor_name = data_utils.rand_name('test_hypervisor')
-
self.assertRaises(
lib_exc.NotFound,
self.client.search_hypervisor,
- nonexistent_hypervisor_name)
+ 'nonexistent_hypervisor_name')
@test.attr(type=['negative'])
@test.idempotent_id('5b6a6c79-5dc1-4fa5-9c58-9c8085948e74')
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/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 7d97ce2..ce0adb4 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -74,7 +74,8 @@
'ram': 10240, 'floating_ips': 20, 'fixed_ips': 10,
'key_pairs': 200, 'injected_file_path_bytes': 512,
'instances': 20, 'security_group_rules': 20,
- 'cores': 2, 'security_groups': 20}
+ 'cores': 2, 'security_groups': 20,
+ 'server_groups': 20, 'server_group_members': 20}
# Update limits for all quota resources
quota_set = self.adm_client.update_quota_set(
self.demo_tenant_id,
@@ -82,13 +83,6 @@
**new_quota_set)['quota_set']
default_quota_set.pop('id')
- # NOTE(PhilDay) The following is safe as we're not updating these
- # two quota values yet. Once the Nova change to add these is merged
- # and the client updated to support them this can be removed
- if 'server_groups' in default_quota_set:
- default_quota_set.pop('server_groups')
- if 'server_group_members' in default_quota_set:
- default_quota_set.pop('server_group_members')
self.addCleanup(self.adm_client.update_quota_set,
self.demo_tenant_id, **default_quota_set)
for quota in new_quota_set:
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index d6aba5b..015e14d 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -40,6 +40,17 @@
# tenant most of them should be skipped if we can't do that
cls.demo_tenant_id = cls.client.tenant_id
+ def _update_quota(self, quota_item, quota_value):
+ quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
+ ['quota_set'])
+ default_quota_value = quota_set[quota_item]
+
+ self.adm_client.update_quota_set(self.demo_tenant_id,
+ force=True,
+ **{quota_item: quota_value})
+ self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
+ **{quota_item: default_quota_value})
+
@test.attr(type=['negative'])
@test.idempotent_id('733abfe8-166e-47bb-8363-23dbd7ff3476')
def test_update_quota_normal_user(self):
@@ -54,17 +65,7 @@
@test.idempotent_id('91058876-9947-4807-9f22-f6eb17140d9b')
def test_create_server_when_cpu_quota_is_full(self):
# Disallow server creation when tenant's vcpu quota is full
- quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
- ['quota_set'])
- default_vcpu_quota = quota_set['cores']
- vcpu_quota = 0 # Set the quota to zero to conserve resources
-
- self.adm_client.update_quota_set(self.demo_tenant_id,
- force=True,
- cores=vcpu_quota)
-
- self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
- cores=default_vcpu_quota)
+ self._update_quota('cores', 0)
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
self.create_test_server)
@@ -72,17 +73,7 @@
@test.idempotent_id('6fdd7012-584d-4327-a61c-49122e0d5864')
def test_create_server_when_memory_quota_is_full(self):
# Disallow server creation when tenant's memory quota is full
- quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
- ['quota_set'])
- default_mem_quota = quota_set['ram']
- mem_quota = 0 # Set the quota to zero to conserve resources
-
- self.adm_client.update_quota_set(self.demo_tenant_id,
- force=True,
- ram=mem_quota)
-
- self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
- ram=default_mem_quota)
+ self._update_quota('ram', 0)
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
self.create_test_server)
@@ -90,16 +81,7 @@
@test.idempotent_id('7c6be468-0274-449a-81c3-ac1c32ee0161')
def test_create_server_when_instances_quota_is_full(self):
# Once instances quota limit is reached, disallow server creation
- quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
- ['quota_set'])
- default_instances_quota = quota_set['instances']
- instances_quota = 0 # Set quota to zero to disallow server creation
-
- self.adm_client.update_quota_set(self.demo_tenant_id,
- force=True,
- instances=instances_quota)
- self.addCleanup(self.adm_client.update_quota_set, self.demo_tenant_id,
- instances=default_instances_quota)
+ self._update_quota('instances', 0)
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
self.create_test_server)
@@ -109,22 +91,10 @@
@test.services('network')
def test_security_groups_exceed_limit(self):
# Negative test: Creation Security Groups over limit should FAIL
-
- quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
- ['quota_set'])
- default_sg_quota = quota_set['security_groups']
-
# Set the quota to number of used security groups
sg_quota = self.limits_client.show_limits()['limits']['absolute'][
'totalSecurityGroupsUsed']
-
- self.adm_client.update_quota_set(self.demo_tenant_id,
- force=True,
- security_groups=sg_quota)
-
- self.addCleanup(self.adm_client.update_quota_set,
- self.demo_tenant_id,
- security_groups=default_sg_quota)
+ self._update_quota('security_groups', sg_quota)
# Check we cannot create anymore
# A 403 Forbidden or 413 Overlimit (old behaviour) exception
@@ -141,19 +111,7 @@
def test_security_groups_rules_exceed_limit(self):
# Negative test: Creation of Security Group Rules should FAIL
# when we reach limit maxSecurityGroupRules
-
- quota_set = (self.adm_client.show_quota_set(self.demo_tenant_id)
- ['quota_set'])
- default_sg_rules_quota = quota_set['security_group_rules']
- sg_rules_quota = 0 # Set the quota to zero to conserve resources
-
- self.adm_client.update_quota_set(self.demo_tenant_id,
- force=True,
- security_group_rules=sg_rules_quota)
-
- self.addCleanup(self.adm_client.update_quota_set,
- self.demo_tenant_id,
- security_group_rules=default_sg_rules_quota)
+ self._update_quota('security_group_rules', 0)
s_name = data_utils.rand_name('securitygroup')
s_description = data_utils.rand_name('description')
diff --git a/tempest/api/compute/admin/test_volumes_negative.py b/tempest/api/compute/admin/test_volumes_negative.py
new file mode 100644
index 0000000..b9dac6f
--- /dev/null
+++ b/tempest/api/compute/admin/test_volumes_negative.py
@@ -0,0 +1,61 @@
+# Copyright 2016 NEC Corporation. All rights reserved.
+#
+# 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.
+
+from tempest.api.compute import base
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest.lib import exceptions as lib_exc
+from tempest import test
+
+CONF = config.CONF
+
+
+class VolumesAdminNegativeTest(base.BaseV2ComputeAdminTest):
+
+ @classmethod
+ def skip_checks(cls):
+ super(VolumesAdminNegativeTest, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
+ raise cls.skipException(skip_msg)
+
+ @classmethod
+ def setup_clients(cls):
+ super(VolumesAdminNegativeTest, cls).setup_clients()
+ cls.servers_admin_client = cls.os_adm.servers_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(VolumesAdminNegativeTest, cls).resource_setup()
+ cls.server = cls.create_test_server(wait_until='ACTIVE')
+
+ @test.idempotent_id('309b5ecd-0585-4a7e-a36f-d2b2bf55259d')
+ def test_update_attached_volume_with_nonexistent_volume_in_uri(self):
+ volume = self.create_volume()
+ nonexistent_volume = data_utils.rand_uuid()
+ self.assertRaises(lib_exc.NotFound,
+ self.servers_admin_client.update_attached_volume,
+ self.server['id'], nonexistent_volume,
+ volumeId=volume['id'])
+
+ @test.idempotent_id('7dcac15a-b107-46d3-a5f6-cb863f4e454a')
+ def test_update_attached_volume_with_nonexistent_volume_in_body(self):
+ volume = self.create_volume()
+ self.attach_volume(self.server, volume)
+
+ nonexistent_volume = data_utils.rand_uuid()
+ self.assertRaises(lib_exc.BadRequest,
+ self.servers_admin_client.update_attached_volume,
+ self.server['id'], volume['id'],
+ volumeId=nonexistent_volume)
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index b738e82..d8294f7 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -365,7 +365,7 @@
return address['addr']
raise exceptions.ServerUnreachable(server_id=server['id'])
else:
- raise exceptions.InvalidConfiguration()
+ raise lib_exc.InvalidConfiguration()
def setUp(self):
super(BaseV2ComputeTest, self).setUp()
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
index f71f046..31cf39c 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
@@ -23,7 +23,6 @@
class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
- server_id = None
@classmethod
def setup_clients(cls):
@@ -38,15 +37,14 @@
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
# Generating a nonexistent floatingIP id
- cls.floating_ip_ids = []
body = cls.client.list_floating_ips()['floating_ips']
- for i in range(len(body)):
- cls.floating_ip_ids.append(body[i]['id'])
+ floating_ip_ids = [floating_ip['id'] for floating_ip in body]
while True:
- cls.non_exist_id = data_utils.rand_int_id(start=999)
if CONF.service_available.neutron:
cls.non_exist_id = data_utils.rand_uuid()
- if cls.non_exist_id not in cls.floating_ip_ids:
+ else:
+ cls.non_exist_id = data_utils.rand_int_id(start=999)
+ if cls.non_exist_id not in floating_ip_ids:
break
@test.attr(type=['negative'])
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 999233d..26d4efe 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -20,7 +20,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
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/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index 154d717..a06f4a7 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -38,7 +38,6 @@
def setup_clients(cls):
super(ImagesTestJSON, cls).setup_clients()
cls.client = cls.compute_images_client
- cls.servers_client = cls.servers_client
@test.idempotent_id('aa06b52b-2db5-4807-b218-9441f75d74e3')
def test_delete_saving_image(self):
diff --git a/tempest/api/compute/images/test_images_negative.py b/tempest/api/compute/images/test_images_negative.py
index 8db094d..7035401 100644
--- a/tempest/api/compute/images/test_images_negative.py
+++ b/tempest/api/compute/images/test_images_negative.py
@@ -39,7 +39,6 @@
def setup_clients(cls):
super(ImagesNegativeTestJSON, cls).setup_clients()
cls.client = cls.compute_images_client
- cls.servers_client = cls.servers_client
@test.attr(type=['negative'])
@test.idempotent_id('6cd5a89d-5b47-46a7-93bc-3916f0d84973')
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 6c417f1..19e2880 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -45,35 +45,18 @@
super(ImagesOneServerTestJSON, cls).setup_clients()
cls.client = cls.compute_images_client
- @classmethod
- def resource_setup(cls):
- super(ImagesOneServerTestJSON, cls).resource_setup()
- server = cls.create_test_server(wait_until='ACTIVE')
- cls.server_id = server['id']
-
def _get_default_flavor_disk_size(self, flavor_id):
flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
return flavor['disk']
- @classmethod
- def _rebuild_server_when_fails(cls, server_id):
- try:
- waiters.wait_for_server_status(cls.servers_client,
- server_id, 'ACTIVE')
- except Exception:
- LOG.exception('server %s timed out to become ACTIVE. rebuilding'
- % server_id)
- # Rebuild server if cannot reach the ACTIVE state
- # Usually it means the server had a serious accident
- cls.server_id = cls.rebuild_server(server_id)
-
@test.idempotent_id('3731d080-d4c5-4872-b41a-64d0d0021314')
def test_create_delete_image(self):
+ server_id = self.create_test_server(wait_until='ACTIVE')['id']
# Create a new image
name = data_utils.rand_name('image')
meta = {'image_type': 'test'}
- body = self.client.create_image(self.server_id, name=name,
+ body = self.client.create_image(server_id, name=name,
metadata=meta)
image_id = data_utils.parse_image_id(body.response['location'])
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
@@ -98,10 +81,11 @@
# Verify the image was deleted correctly
self.client.delete_image(image_id)
self.client.wait_for_resource_deletion(image_id)
- self.addCleanup(self._rebuild_server_when_fails, self.server_id)
@test.idempotent_id('3b7c6fe4-dfe7-477c-9243-b06359db51e6')
def test_create_image_specify_multibyte_character_image_name(self):
+ server_id = self.create_test_server(wait_until='ACTIVE')['id']
+
# prefix character is:
# http://www.fileformat.info/info/unicode/char/1F4A9/index.htm
@@ -109,7 +93,6 @@
# #1370954 in glance which will 500 if mysql is used as the
# backend and it attempts to store a 4 byte utf-8 character
utf8_name = data_utils.rand_name('\xe2\x82\xa1')
- body = self.client.create_image(self.server_id, name=utf8_name)
+ body = self.client.create_image(server_id, name=utf8_name)
image_id = data_utils.parse_image_id(body.response['location'])
self.addCleanup(self.client.delete_image, image_id)
- self.addCleanup(self._rebuild_server_when_fails, self.server_id)
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index be6f615..562a508 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -57,8 +57,8 @@
self.assertEqual(key_name, k_name,
"The created keypair name is not equal "
"to the requested name")
- self.assertTrue(private_key is not None,
- "Field private_key is empty or not found.")
+ self.assertIsNotNone(private_key,
+ "Field private_key is empty or not found.")
@test.idempotent_id('a4233d5d-52d8-47cc-9a25-e1864527e3df')
def test_get_keypair_detail(self):
@@ -72,8 +72,8 @@
"The created keypair name is not equal "
"to requested name")
public_key = keypair_detail['public_key']
- self.assertTrue(public_key is not None,
- "Field public_key is empty or not found.")
+ self.assertIsNotNone(public_key,
+ "Field public_key is empty or not found.")
@test.idempotent_id('39c90c6a-304a-49dd-95ec-2366129def05')
def test_keypair_create_with_pub_key(self):
@@ -89,7 +89,7 @@
"XcPojYN56tI0OlrGqojbediJYD0rUsJu4weZpbn8vilb3JuDY+jws"
"snSA8wzBx3A/8y9Pp1B nova@ubuntu")
keypair = self._create_keypair(k_name, pub_key)
- self.assertFalse('private_key' in keypair,
+ self.assertNotIn('private_key', keypair,
"Field private_key is not empty!")
key_name = keypair['name']
self.assertEqual(key_name, k_name,
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index a8c59ca..8342a3e 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
@@ -51,30 +50,6 @@
cls.subnets_client = cls.os.subnets_client
cls.ports_client = cls.os.ports_client
- def wait_for_interface_status(self, server, port_id, status):
- """Waits for an interface to reach a given status."""
- body = (self.interfaces_client.show_interface(server, port_id)
- ['interfaceAttachment'])
- interface_status = body['port_state']
- start = int(time.time())
-
- while(interface_status != status):
- time.sleep(self.build_interval)
- body = (self.interfaces_client.show_interface(server, port_id)
- ['interfaceAttachment'])
- interface_status = body['port_state']
-
- timed_out = int(time.time()) - start >= self.build_timeout
-
- if interface_status != status and timed_out:
- message = ('Interface %s failed to reach %s status '
- '(current %s) within the required time (%s s).' %
- (port_id, status, interface_status,
- self.build_timeout))
- raise exceptions.TimeoutException(message)
-
- return body
-
# TODO(mriedem): move this into a common waiters utility module
def wait_for_port_detach(self, port_id):
"""Waits for the port's device_id to be unset.
@@ -99,7 +74,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
@@ -119,16 +94,16 @@
server = self.create_test_server(wait_until='ACTIVE')
ifs = (self.interfaces_client.list_interfaces(server['id'])
['interfaceAttachments'])
- body = self.wait_for_interface_status(
- server['id'], ifs[0]['port_id'], 'ACTIVE')
+ body = waiters.wait_for_interface_status(
+ self.interfaces_client, server['id'], ifs[0]['port_id'], 'ACTIVE')
ifs[0]['port_state'] = body['port_state']
return server, ifs
def _test_create_interface(self, server):
iface = (self.interfaces_client.create_interface(server['id'])
['interfaceAttachment'])
- iface = self.wait_for_interface_status(
- server['id'], iface['port_id'], 'ACTIVE')
+ iface = waiters.wait_for_interface_status(
+ self.interfaces_client, server['id'], iface['port_id'], 'ACTIVE')
self._check_interface(iface)
return iface
@@ -136,8 +111,8 @@
network_id = ifs[0]['net_id']
iface = self.interfaces_client.create_interface(
server['id'], net_id=network_id)['interfaceAttachment']
- iface = self.wait_for_interface_status(
- server['id'], iface['port_id'], 'ACTIVE')
+ iface = waiters.wait_for_interface_status(
+ self.interfaces_client, server['id'], iface['port_id'], 'ACTIVE')
self._check_interface(iface, network_id=network_id)
return iface
@@ -148,8 +123,8 @@
self.addCleanup(self.ports_client.delete_port, port_id)
iface = self.interfaces_client.create_interface(
server['id'], port_id=port_id)['interfaceAttachment']
- iface = self.wait_for_interface_status(
- server['id'], iface['port_id'], 'ACTIVE')
+ iface = waiters.wait_for_interface_status(
+ self.interfaces_client, server['id'], iface['port_id'], 'ACTIVE')
self._check_interface(iface, port_id=port_id)
return iface
@@ -167,8 +142,8 @@
server['id'], net_id=network_id,
fixed_ips=fixed_ips)['interfaceAttachment']
self.addCleanup(self.ports_client.delete_port, iface['port_id'])
- iface = self.wait_for_interface_status(
- server['id'], iface['port_id'], 'ACTIVE')
+ iface = waiters.wait_for_interface_status(
+ self.interfaces_client, server['id'], iface['port_id'], 'ACTIVE')
self._check_interface(iface, fixed_ip=ip_list[0])
return iface
@@ -197,7 +172,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/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 9077801..0a94d5e 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import logging
-
+from oslo_log import log as logging
from six.moves.urllib import parse as urlparse
import testtools
@@ -131,8 +130,8 @@
server=server,
servers_client=self.client)
new_boot_time = linux_client.get_boot_time()
- self.assertTrue(new_boot_time > boot_time,
- '%s > %s' % (new_boot_time, boot_time))
+ self.assertGreater(new_boot_time, boot_time,
+ '%s > %s' % (new_boot_time, boot_time))
@test.attr(type='smoke')
@test.idempotent_id('2cb1baf6-ac8d-4429-bf0d-ba8a0ba53e32')
@@ -458,8 +457,8 @@
# NOTE: This test tries to get full length console log, and the
# length should be bigger than the one of test_get_console_output.
- self.assertTrue(lines > 10, "Cannot get enough console log length."
- " (lines: %s)" % lines)
+ self.assertGreater(lines, 10, "Cannot get enough console log "
+ "length. (lines: %s)" % lines)
self.wait_for(_check_full_length_console_log)
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index cb66e81..847b7a1 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -23,7 +23,6 @@
def setup_clients(cls):
super(ServerMetadataTestJSON, cls).setup_clients()
cls.client = cls.servers_client
- cls.quotas = cls.quotas_client
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index aae9101..62b8962 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -25,7 +25,6 @@
def setup_clients(cls):
super(ServerMetadataNegativeTestJSON, cls).setup_clients()
cls.client = cls.servers_client
- cls.quotas = cls.quotas_client
@classmethod
def resource_setup(cls):
@@ -134,7 +133,8 @@
# A 403 Forbidden or 413 Overlimit (old behaviour) exception
# will be raised while exceeding metadata items limit for
# tenant.
- quota_set = self.quotas.show_quota_set(self.tenant_id)['quota_set']
+ quota_set = self.quotas_client.show_quota_set(
+ self.tenant_id)['quota_set']
quota_metadata = quota_set['metadata_items']
if quota_metadata == -1:
raise self.skipException("No limit for metadata_items")
diff --git a/tempest/api/compute/volumes/test_volume_snapshots.py b/tempest/api/compute/volumes/test_volume_snapshots.py
index 460c882..01718cc 100644
--- a/tempest/api/compute/volumes/test_volume_snapshots.py
+++ b/tempest/api/compute/volumes/test_volume_snapshots.py
@@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import testtools
+
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest.common import waiters
@@ -39,6 +41,8 @@
cls.snapshots_client = cls.snapshots_extensions_client
@test.idempotent_id('cd4ec87d-7825-450d-8040-6e2068f2da8f')
+ @testtools.skipUnless(CONF.volume_feature_enabled.snapshot,
+ 'Cinder volume snapshots are disabled')
def test_volume_snapshot_create_get_list_delete(self):
volume = self.create_volume()
self.addCleanup(self.delete_volume, volume['id'])
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index d599431..7549d4a 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -54,8 +54,8 @@
self.assertEqual(volume['displayName'], v_name,
"The created volume name is not equal "
"to the requested name")
- self.assertTrue(volume['id'] is not None,
- "Field volume id is empty or not found.")
+ self.assertIsNotNone(volume['id'],
+ "Field volume id is empty or not found.")
# Wait for Volume status to become ACTIVE
waiters.wait_for_volume_status(self.client, volume['id'], 'available')
# GET Volume
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index c60fcca..7d76731 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+from oslo_log import log as logging
+
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest.common import waiters
@@ -20,6 +22,7 @@
from tempest import test
CONF = config.CONF
+LOG = logging.getLogger(__name__)
class VolumesTestJSON(base.BaseV2ComputeTest):
@@ -59,21 +62,16 @@
volume = cls.client.show_volume(volume['id'])['volume']
cls.volume_list.append(volume)
cls.volume_id_list.append(volume['id'])
- except Exception:
+ except Exception as exc:
+ LOG.exception(exc)
if cls.volume_list:
# We could not create all the volumes, though we were able
# to create *some* of the volumes. This is typically
# because the backing file size of the volume group is
- # too small. So, here, we clean up whatever we did manage
- # to create and raise a SkipTest
+ # too small.
for volume in cls.volume_list:
cls.delete_volume(volume['id'])
- msg = ("Failed to create ALL necessary volumes to run "
- "test. This typically means that the backing file "
- "size of the nova-volumes group is too small to "
- "create the 3 volumes needed by this test case")
- raise cls.skipException(msg)
- raise
+ raise exc
@classmethod
def resource_cleanup(cls):
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index 5fe4cb3..c4041cb 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -66,7 +66,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('131cb3a1-75cc-4d40-b4c3-1317f64719b0')
- def test_create_volume_with_out_passing_size(self):
+ def test_create_volume_without_passing_size(self):
# Negative: Should not be able to create volume without passing size
# in request
v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
diff --git a/tempest/api/identity/admin/v2/test_services.py b/tempest/api/identity/admin/v2/test_services.py
index 3ed51f0..7973a03 100644
--- a/tempest/api/identity/admin/v2/test_services.py
+++ b/tempest/api/identity/admin/v2/test_services.py
@@ -38,7 +38,7 @@
service_data = self.services_client.create_service(
name=name, type=s_type,
description=description)['OS-KSADM:service']
- self.assertFalse(service_data['id'] is None)
+ self.assertIsNotNone(service_data['id'])
self.addCleanup(self._del_service, service_data['id'])
# Verifying response body of create service
self.assertIn('id', service_data)
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 1cc3fa2..812c436 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -141,6 +141,7 @@
cls.client = cls.os.image_client_v2
cls.namespaces_client = cls.os.namespaces_client
cls.resource_types_client = cls.os.resource_types_client
+ cls.namespace_properties_client = cls.os.namespace_properties_client
cls.schemas_client = cls.os.schemas_client
def create_namespace(cls, namespace_name=None, visibility='public',
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index 7d52695..9fbdcd7 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -238,7 +238,7 @@
def test_index_max_size(self):
images_list = self.client.list_images(size_max=42)['images']
for image in images_list:
- self.assertTrue(image['size'] <= 42)
+ self.assertLessEqual(image['size'], 42)
result_set = set(map(lambda x: x['id'], images_list))
self.assertTrue(self.size42_set <= result_set)
self.assertFalse(self.created_set - self.size42_set <= result_set)
@@ -261,7 +261,7 @@
top_size = images_list[0]['size'] # We have non-zero sized images
for image in images_list:
size = image['size']
- self.assertTrue(size <= top_size)
+ self.assertLessEqual(size, top_size)
top_size = size
self.assertEqual(image['status'], 'active')
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index 6f8d239..42912f0 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -129,7 +129,6 @@
class ListImagesTest(base.BaseV2ImageTest):
- """Here we test the listing of image information"""
@classmethod
def resource_setup(cls):
@@ -157,23 +156,49 @@
"""
size = random.randint(1024, 4096)
image_file = six.BytesIO(data_utils.random_bytes(size))
+ tags = [data_utils.rand_name('tag'), data_utils.rand_name('tag')]
image = cls.create_image(container_format=container_format,
disk_format=disk_format,
- visibility='private')
+ visibility='private',
+ tags=tags)
cls.client.store_image_file(image['id'], data=image_file)
+ # Keep the data of one test image so it can be used to filter lists
+ cls.test_data = image
+ cls.test_data['size'] = size
return image['id']
+
+class ListUserImagesTest(ListImagesTest):
+ """Here we test the listing of image information"""
+
def _list_by_param_value_and_assert(self, params):
"""Perform list action with given params and validates result."""
-
+ # Retrieve the list of images that meet the filter
images_list = self.client.list_images(params=params)['images']
# Validating params of fetched images
+ msg = 'No images were found that met the filter criteria.'
+ self.assertNotEmpty(images_list, msg)
for image in images_list:
for key in params:
msg = "Failed to list images by %s" % key
self.assertEqual(params[key], image[key], msg)
+ def _list_sorted_by_image_size_and_assert(self, params, desc=False):
+ """Validate an image list that has been sorted by size
+
+ Perform list action with given params and validates the results are
+ sorted by image size in either ascending or descending order.
+ """
+ # Retrieve the list of images that meet the filter
+ images_list = self.client.list_images(params=params)['images']
+ # Validate that the list was fetched sorted accordingly
+ msg = 'No images were found that met the filter criteria.'
+ self.assertNotEmpty(images_list, msg)
+ sorted_list = [image['size'] for image in images_list]
+ msg = 'The list of images was not sorted correctly.'
+ self.assertEqual(sorted(sorted_list, reverse=desc), sorted_list, msg)
+
@test.idempotent_id('1e341d7a-90a9-494c-b143-2cdf2aeb6aee')
def test_list_no_params(self):
# Simple test to see all fixture images returned
@@ -185,8 +210,8 @@
@test.idempotent_id('9959ca1d-1aa7-4b7a-a1ea-0fff0499b37e')
def test_list_images_param_container_format(self):
- # Test to get all images with container_format='bare'
- params = {"container_format": "bare"}
+ # Test to get all images with a specific container_format
+ params = {"container_format": self.test_data['container_format']}
self._list_by_param_value_and_assert(params)
@test.idempotent_id('4a4735a7-f22f-49b6-b0d9-66e1ef7453eb')
@@ -224,9 +249,10 @@
image_size_list = map(lambda x: x['size'], images_list)
for image_size in image_size_list:
- self.assertTrue(image_size >= params['size_min'] and
- image_size <= params['size_max'],
- "Failed to get images by size_min and size_max")
+ self.assertGreaterEqual(image_size, params['size_min'],
+ "Failed to get images by size_min")
+ self.assertLessEqual(image_size, params['size_max'],
+ "Failed to get images by size_max")
@test.idempotent_id('7fc9e369-0f58-4d05-9aa5-0969e2d59d15')
def test_list_images_param_status(self):
@@ -253,6 +279,37 @@
params = {"owner": image['owner']}
self._list_by_param_value_and_assert(params)
+ @test.idempotent_id('55c8f5f5-bfed-409d-a6d5-4caeda985d7b')
+ def test_list_images_param_name(self):
+ # Test to get images by name
+ params = {'name': self.test_data['name']}
+ self._list_by_param_value_and_assert(params)
+
+ @test.idempotent_id('aa8ac4df-cff9-418b-8d0f-dd9c67b072c9')
+ def test_list_images_param_tag(self):
+ # Test to get images matching a tag
+ params = {'tag': self.test_data['tags'][0]}
+ images_list = self.client.list_images(params=params)['images']
+ # Validating properties of fetched images
+ self.assertNotEmpty(images_list)
+ for image in images_list:
+ msg = ("The image {image_name} does not have the expected tag "
+ "{expected_tag} among its tags: {observerd_tags}."
+ .format(image_name=image['name'],
+ expected_tag=self.test_data['tags'][0],
+ observerd_tags=image['tags']))
+ self.assertIn(self.test_data['tags'][0], image['tags'], msg)
+
+ @test.idempotent_id('eeadce49-04e0-43b7-aec7-52535d903e7a')
+ def test_list_images_param_sort(self):
+ params = {'sort': 'size:desc'}
+ self._list_sorted_by_image_size_and_assert(params, desc=True)
+
+ @test.idempotent_id('9faaa0c2-c3a5-43e1-8f61-61c54b409a49')
+ def test_list_images_param_sort_key_dir(self):
+ params = {'sort_key': 'size', 'sort_dir': 'desc'}
+ self._list_sorted_by_image_size_and_assert(params, desc=True)
+
@test.idempotent_id('622b925c-479f-4736-860d-adeaf13bc371')
def test_get_image_schema(self):
# Test to get image schema
@@ -266,3 +323,32 @@
schema = "images"
body = self.schemas_client.show_schema(schema)
self.assertEqual("images", body['name'])
+
+
+class ListSharedImagesTest(ListImagesTest):
+ """Here we test the listing of a shared image information"""
+
+ credentials = ['primary', 'alt']
+
+ @classmethod
+ def setup_clients(cls):
+ super(ListSharedImagesTest, cls).setup_clients()
+ cls.image_member_client = cls.os.image_member_client_v2
+ cls.alt_img_client = cls.os_alt.image_client_v2
+
+ @test.idempotent_id('3fa50be4-8e38-4c02-a8db-7811bb780122')
+ def test_list_images_param_member_status(self):
+ # Share one of the images created with the alt user
+ self.image_member_client.create_image_member(
+ image_id=self.test_data['id'],
+ member=self.alt_img_client.tenant_id)
+ # Update the info on the test data so it remains accurate
+ self.test_data['updated_at'] = self.client.show_image(
+ self.test_data['id'])['updated_at']
+ # As an image consumer you need to provide the member_status parameter
+ # along with the visibility=shared parameter in order for it to show
+ # results
+ params = {'member_status': 'pending', 'visibility': 'shared'}
+ fetched_images = self.alt_img_client.list_images(params)['images']
+ self.assertEqual(1, len(fetched_images))
+ self.assertEqual(self.test_data['id'], fetched_images[0]['id'])
diff --git a/tempest/api/image/v2/test_images_metadefs_namespace_properties.py b/tempest/api/image/v2/test_images_metadefs_namespace_properties.py
new file mode 100644
index 0000000..7113db4
--- /dev/null
+++ b/tempest/api/image/v2/test_images_metadefs_namespace_properties.py
@@ -0,0 +1,57 @@
+# 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.
+
+from tempest.api.image import base
+from tempest.common.utils import data_utils
+from tempest import test
+
+
+class MetadataNamespacePropertiesTest(base.BaseV2ImageTest):
+ """Test the Metadata definition namespace property basic functionality"""
+
+ @test.idempotent_id('b1a3765e-3a5d-4f6d-a3a7-3ca3476ae768')
+ def test_basic_meta_def_namespace_property(self):
+ # Get the available resource types and use one resource_type
+ body = self.resource_types_client.list_resource_types()
+ resource_name = body['resource_types'][0]['name']
+ enum = ["xen", "qemu", "kvm", "lxc", "uml", "vmware", "hyperv"]
+ # Create a namespace
+ namespace = self.create_namespace()
+ # Create resource type association
+ body = self.resource_types_client.create_resource_type_association(
+ namespace['namespace'], name=resource_name)
+ # Create a property
+ property_title = data_utils.rand_name('property')
+ body = self.namespace_properties_client.create_namespace_property(
+ namespace=namespace['namespace'], title=property_title,
+ name=resource_name, type="string", enum=enum)
+ self.assertEqual(property_title, body['title'])
+ # Show namespace property
+ body = self.namespace_properties_client.show_namespace_properties(
+ namespace['namespace'], resource_name)
+ self.assertEqual(resource_name, body['name'])
+ # Update namespace property
+ update_property_title = data_utils.rand_name('update-property')
+ body = self.namespace_properties_client.update_namespace_properties(
+ namespace['namespace'], resource_name,
+ title=update_property_title, type="string",
+ enum=enum, name=resource_name)
+ self.assertEqual(update_property_title, body['title'])
+ # Delete namespace property
+ self.namespace_properties_client.delete_namespace_property(
+ namespace['namespace'], resource_name)
+ # List namespace properties and validate deletion
+ namespace_property = [
+ namespace_property['title'] for namespace_property in
+ self.namespace_properties_client.list_namespace_properties(
+ namespace['namespace'])['properties']]
+ self.assertNotIn(update_property_title, namespace_property)
diff --git a/tempest/api/network/admin/test_routers_dvr.py b/tempest/api/network/admin/test_routers_dvr.py
index 7de3760..aaac921 100644
--- a/tempest/api/network/admin/test_routers_dvr.py
+++ b/tempest/api/network/admin/test_routers_dvr.py
@@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import testtools
+
from tempest.api.network import base_routers as base
from tempest.common.utils import data_utils
from tempest import test
@@ -80,6 +82,8 @@
self.assertFalse(router['router']['distributed'])
@test.idempotent_id('acd43596-c1fb-439d-ada8-31ad48ae3c2e')
+ @testtools.skipUnless(test.is_extension_enabled('l3-ha', 'network'),
+ 'HA routers are not available.')
def test_centralized_router_update_to_dvr(self):
"""Test centralized router update
@@ -94,15 +98,22 @@
attribute will be set to True
"""
name = data_utils.rand_name('router')
+ tenant_id = self.routers_client.tenant_id
# router needs to be in admin state down in order to be upgraded to DVR
# l3ha routers are not upgradable to dvr, make it explicitly non ha
router = self.admin_routers_client.create_router(name=name,
distributed=False,
admin_state_up=False,
- ha=False)
+ ha=False,
+ tenant_id=tenant_id)
+ router_id = router['router']['id']
self.addCleanup(self.admin_routers_client.delete_router,
- router['router']['id'])
+ router_id)
self.assertFalse(router['router']['distributed'])
router = self.admin_routers_client.update_router(
- router['router']['id'], distributed=True)
+ router_id, distributed=True)
self.assertTrue(router['router']['distributed'])
+ show_body = self.admin_routers_client.show_router(router_id)
+ self.assertTrue(show_body['router']['distributed'])
+ show_body = self.routers_client.show_router(router_id)
+ self.assertNotIn('distributed', show_body['router'])
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index dadaaba..d2056c4 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -27,39 +27,11 @@
CONF = config.CONF
-class NetworksTest(base.BaseNetworkTest):
- """Tests the following operations in the Neutron API:
-
- create a network for a project
- list project's networks
- show a project network details
- create a subnet for a project
- list project's subnets
- show a project subnet details
- network update
- subnet update
- delete a network also deletes its subnets
- list external networks
-
- All subnet tests are run once with ipv4 and once with ipv6.
-
- v2.0 of the Neutron API is assumed. It is also assumed that the following
- options are defined in the [network] section of etc/tempest.conf:
-
- project_network_cidr with a block of cidr's from which smaller blocks
- can be allocated for project ipv4 subnets
-
- project_network_v6_cidr is the equivalent for ipv6 subnets
-
- project_network_mask_bits with the mask bits to be used to partition
- the block defined by project_network_cidr
-
- project_network_v6_mask_bits is the equivalent for ipv6 subnets
- """
+class BaseNetworkTestResources(base.BaseNetworkTest):
@classmethod
def resource_setup(cls):
- super(NetworksTest, cls).resource_setup()
+ super(BaseNetworkTestResources, cls).resource_setup()
cls.network = cls.create_network()
cls.name = cls.network['name']
cls.subnet = cls._create_subnet_with_last_subnet_block(cls.network,
@@ -171,6 +143,37 @@
self.networks.pop()
self.subnets.pop()
+
+class NetworksTest(BaseNetworkTestResources):
+ """Tests the following operations in the Neutron API:
+
+ create a network for a project
+ list project's networks
+ show a project network details
+ create a subnet for a project
+ list project's subnets
+ show a project subnet details
+ network update
+ subnet update
+ delete a network also deletes its subnets
+ list external networks
+
+ All subnet tests are run once with ipv4 and once with ipv6.
+
+ v2.0 of the Neutron API is assumed. It is also assumed that the following
+ options are defined in the [network] section of etc/tempest.conf:
+
+ project_network_cidr with a block of cidr's from which smaller blocks
+ can be allocated for project ipv4 subnets
+
+ project_network_v6_cidr is the equivalent for ipv6 subnets
+
+ project_network_mask_bits with the mask bits to be used to partition
+ the block defined by project_network_cidr
+
+ project_network_v6_mask_bits is the equivalent for ipv6 subnets
+ """
+
@test.attr(type='smoke')
@test.idempotent_id('0e269138-0da6-4efc-a46d-578161e7b221')
def test_create_update_delete_network_subnet(self):
@@ -276,29 +279,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()
@@ -566,7 +562,9 @@
'Subnet are not in the same network')
-class NetworksIpV6TestAttrs(NetworksIpV6Test):
+class NetworksIpV6TestAttrs(BaseNetworkTestResources):
+
+ _ip_version = 6
@classmethod
def skip_checks(cls):
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 6a3f18e..e989b69 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -380,35 +380,3 @@
class RoutersIpV6Test(RoutersTest):
_ip_version = 6
-
-
-class DvrRoutersTest(base.BaseRouterTest):
-
- @classmethod
- def skip_checks(cls):
- super(DvrRoutersTest, cls).skip_checks()
- if not test.is_extension_enabled('dvr', 'network'):
- msg = "DVR extension not enabled."
- raise cls.skipException(msg)
-
- @test.idempotent_id('141297aa-3424-455d-aa8d-f2d95731e00a')
- def test_create_distributed_router(self):
- name = data_utils.rand_name('router')
- create_body = self.admin_routers_client.create_router(
- name=name, distributed=True)
- self.addCleanup(self._delete_router,
- create_body['router']['id'],
- self.admin_routers_client)
- self.assertTrue(create_body['router']['distributed'])
-
- @test.idempotent_id('644d7a4a-01a1-4b68-bb8d-0c0042cb1729')
- def test_convert_centralized_router(self):
- router = self._create_router()
- self.assertNotIn('distributed', router)
- update_body = self.admin_routers_client.update_router(router['id'],
- distributed=True)
- self.assertTrue(update_body['router']['distributed'])
- show_body = self.admin_routers_client.show_router(router['id'])
- self.assertTrue(show_body['router']['distributed'])
- show_body = self.routers_client.show_router(router['id'])
- self.assertNotIn('distributed', show_body['router'])
diff --git a/tempest/api/object_storage/test_account_bulk.py b/tempest/api/object_storage/test_account_bulk.py
index 7292ee9..a75ed98 100644
--- a/tempest/api/object_storage/test_account_bulk.py
+++ b/tempest/api/object_storage/test_account_bulk.py
@@ -66,7 +66,7 @@
self.assertNotIn(container_name, body)
@test.idempotent_id('a407de51-1983-47cc-9f14-47c2b059413c')
- @test.requires_ext(extension='bulk', service='object')
+ @test.requires_ext(extension='bulk_upload', service='object')
def test_extract_archive(self):
# Test bulk operation of file upload with an archived file
filepath, container_name, object_name = self._create_archive()
@@ -102,7 +102,7 @@
self.assertIn(object_name, [c['name'] for c in contents_list])
@test.idempotent_id('c075e682-0d2a-43b2-808d-4116200d736d')
- @test.requires_ext(extension='bulk', service='object')
+ @test.requires_ext(extension='bulk_delete', service='object')
def test_bulk_delete(self):
# Test bulk operation of deleting multiple files
filepath, container_name, object_name = self._create_archive()
@@ -129,7 +129,7 @@
self._check_contents_deleted(container_name)
@test.idempotent_id('dbea2bcb-efbb-4674-ac8a-a5a0e33d1d79')
- @test.requires_ext(extension='bulk', service='object')
+ @test.requires_ext(extension='bulk_delete', service='object')
def test_bulk_delete_by_POST(self):
# Test bulk operation of deleting multiple files
filepath, container_name, object_name = self._create_archive()
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index 33e5852..eda4568 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -121,7 +121,7 @@
self.assertHeaders(resp, 'Account', 'GET')
self.assertIsNotNone(container_list)
self.assertEqual(container_list.tag, 'account')
- self.assertTrue('name' in container_list.keys())
+ self.assertIn('name', container_list.keys())
self.assertEqual(container_list.find(".//container").tag, 'container')
self.assertEqual(container_list.find(".//name").tag, 'name')
self.assertEqual(container_list.find(".//count").tag, 'count')
@@ -209,7 +209,8 @@
self.account_client.list_account_containers(params=params)
self.assertHeaders(resp, 'Account', 'GET')
- self.assertTrue(len(container_list) <= limit, str(container_list))
+ self.assertLessEqual(len(container_list), limit,
+ str(container_list))
@test.idempotent_id('888a3f0e-7214-4806-8e50-5e0c9a69bb5e')
def test_list_containers_with_limit_and_end_marker(self):
diff --git a/tempest/api/object_storage/test_container_services.py b/tempest/api/object_storage/test_container_services.py
index dbe8b4a..9ce1b18 100644
--- a/tempest/api/object_storage/test_container_services.py
+++ b/tempest/api/object_storage/test_container_services.py
@@ -205,7 +205,7 @@
self.assertIsNotNone(object_list)
self.assertEqual(object_list.tag, 'container')
- self.assertTrue('name' in object_list.keys())
+ self.assertIn('name', object_list.keys())
self.assertEqual(object_list.find(".//object").tag, 'object')
self.assertEqual(object_list.find(".//name").tag, 'name')
self.assertEqual(object_list.find(".//hash").tag, 'hash')
diff --git a/tempest/api/object_storage/test_container_services_negative.py b/tempest/api/object_storage/test_container_services_negative.py
index 7049db0..e6c53ec 100644
--- a/tempest/api/object_storage/test_container_services_negative.py
+++ b/tempest/api/object_storage/test_container_services_negative.py
@@ -92,47 +92,39 @@
def test_get_metadata_headers_with_invalid_container_name(self):
# Attempts to retrieve metadata headers with an invalid
# container name.
- invalid_name = data_utils.rand_name(name="TestInvalidContainer")
-
self.assertRaises(exceptions.NotFound,
self.container_client.list_container_metadata,
- invalid_name)
+ 'invalid_container_name')
@test.attr(type=["negative"])
@test.idempotent_id('125a24fa-90a7-4cfc-b604-44e49d788390')
def test_update_metadata_with_nonexistent_container_name(self):
# Attempts to update metadata using a nonexistent container name.
- nonexistent_name = data_utils.rand_name(
- name="TestNonexistentContainer")
metadata = {'animal': 'penguin'}
self.assertRaises(exceptions.NotFound,
self.container_client.update_container_metadata,
- nonexistent_name, metadata)
+ 'nonexistent_container_name', metadata)
@test.attr(type=["negative"])
@test.idempotent_id('65387dbf-a0e2-4aac-9ddc-16eb3f1f69ba')
def test_delete_with_nonexistent_container_name(self):
# Attempts to delete metadata using a nonexistent container name.
- nonexistent_name = data_utils.rand_name(
- name="TestNonexistentContainer")
metadata = {'animal': 'penguin'}
self.assertRaises(exceptions.NotFound,
self.container_client.delete_container_metadata,
- nonexistent_name, metadata)
+ 'nonexistent_container_name', metadata)
@test.attr(type=["negative"])
@test.idempotent_id('14331d21-1e81-420a-beea-19cb5e5207f5')
def test_list_all_container_objects_with_nonexistent_container(self):
# Attempts to get a listing of all objects on a container
# that doesn't exist.
- nonexistent_name = data_utils.rand_name(
- name="TestNonexistentContainer")
params = {'limit': 9999, 'format': 'json'}
self.assertRaises(exceptions.NotFound,
self.container_client.list_container_contents,
- nonexistent_name, params)
+ 'nonexistent_container_name', params)
@test.attr(type=["negative"])
@test.idempotent_id('86b2ab08-92d5-493d-acd2-85f0c848819e')
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index 3f45634..bffcb64 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -10,15 +10,13 @@
# License for the specific language governing permissions and limitations
# under the License.
-
-import logging
-
import netaddr
+from oslo_log import log as logging
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/orchestration/stacks/test_nova_keypair_resources.py b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
index 160bf6f..16d8180 100644
--- a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
+++ b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
@@ -83,7 +83,7 @@
output_map['KeyPairDontSavePrivate_PublicKey'])
self.assertIn(u'KeyPairDontSavePrivate_PrivateKey', output_map)
private_key = output_map['KeyPairDontSavePrivate_PrivateKey']
- self.assertTrue(len(private_key) == 0)
+ self.assertEqual(0, len(private_key))
class NovaKeyPairResourcesAWSTest(NovaKeyPairResourcesYAMLTest):
diff --git a/tempest/api/orchestration/stacks/test_templates_negative.py b/tempest/api/orchestration/stacks/test_templates_negative.py
index 24e10dd..f8245c1 100644
--- a/tempest/api/orchestration/stacks/test_templates_negative.py
+++ b/tempest/api/orchestration/stacks/test_templates_negative.py
@@ -27,7 +27,7 @@
Type: AWS::IAM::User
"""
- invalid_template_url = 'http://www.example.com/template.yaml'
+ invalid_template_url = 'http:///template.yaml'
@classmethod
def resource_setup(cls):
@@ -57,4 +57,4 @@
}
"""
- invalid_template_url = 'http://www.example.com/template.template'
+ invalid_template_url = 'http:///template.template'
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index 120dbb1..5703313 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -129,7 +129,7 @@
volume1_host = volume['os-vol-host-attr:host']
msg = ("multi-backend reporting incorrect values for volume %s" %
volume_id)
- self.assertTrue(len(volume1_host.split("@")) > 1, msg)
+ self.assertGreater(len(volume1_host.split("@")), 1, msg)
def _test_backend_name_distinction(self, volume_id_list):
# this test checks that the volumes created at setUp don't
diff --git a/tempest/api/volume/admin/test_volume_hosts.py b/tempest/api/volume/admin/test_volume_hosts.py
index b58c525..f6de9a6 100644
--- a/tempest/api/volume/admin/test_volume_hosts.py
+++ b/tempest/api/volume/admin/test_volume_hosts.py
@@ -22,8 +22,8 @@
@test.idempotent_id('d5f3efa2-6684-4190-9ced-1c2f526352ad')
def test_list_hosts(self):
hosts = self.admin_hosts_client.list_hosts()['hosts']
- self.assertTrue(len(hosts) >= 2, "No. of hosts are < 2,"
- "response of list hosts is: % s" % hosts)
+ self.assertGreaterEqual(len(hosts), 2, "No. of hosts are < 2,"
+ "response of list hosts is: % s" % hosts)
class VolumeHostsAdminV1TestsJSON(VolumeHostsAdminV2TestsJSON):
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index 99f0a6b..3098cab 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -51,8 +51,7 @@
'size': CONF.volume.volume_size}
# Create volume
- volume = self.volumes_client.create_volume(**params)['volume']
- self.addCleanup(self.delete_volume, self.volumes_client, volume['id'])
+ volume = self.create_volume(**params)
self.assertEqual(volume_types[0]['name'], volume["volume_type"])
self.assertEqual(volume[self.name_field], vol_name,
"The created volume name is not equal "
@@ -102,8 +101,8 @@
self.assertEqual(description, body['description'],
"The created volume_type_description name is "
"not equal to the requested name")
- self.assertTrue(body['id'] is not None,
- "Field volume_type id is empty or not found.")
+ self.assertIsNotNone(body['id'],
+ "Field volume_type id is empty or not found.")
fetched_volume_type = self.admin_volume_types_client.show_volume_type(
body['id'])['volume_type']
self.assertEqual(name, fetched_volume_type['name'],
diff --git a/tempest/api/volume/admin/v2/test_volume_type_access.py b/tempest/api/volume/admin/v2/test_volume_type_access.py
index 91ff5af..80dbf12 100644
--- a/tempest/api/volume/admin/v2/test_volume_type_access.py
+++ b/tempest/api/volume/admin/v2/test_volume_type_access.py
@@ -16,7 +16,6 @@
import operator
from tempest.api.volume import base
-from tempest.common import waiters
from tempest import config
from tempest.lib import exceptions as lib_exc
from tempest import test
@@ -52,13 +51,7 @@
project=self.volumes_client.tenant_id)
# Creating a volume from primary tenant
- volume = self.volumes_client.create_volume(
- volume_type=volume_type['id'],
- size=CONF.volume.volume_size)['volume']
- self.addCleanup(self.delete_volume, self.volumes_client, volume['id'])
- waiters.wait_for_volume_status(self.volumes_client, volume['id'],
- 'available')
-
+ volume = self.create_volume(volume_type=volume_type['id'])
# Validating the created volume is based on the volume type
self.assertEqual(volume_type['name'], volume['volume_type'])
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/api/volume/admin/v3/test_user_messages.py b/tempest/api/volume/admin/v3/test_user_messages.py
index 39a5dfa..257a434 100755
--- a/tempest/api/volume/admin/v3/test_user_messages.py
+++ b/tempest/api/volume/admin/v3/test_user_messages.py
@@ -15,9 +15,7 @@
from tempest.api.volume.v3 import base
from tempest.common.utils import data_utils
-from tempest.common import waiters
from tempest import config
-from tempest import exceptions
from tempest import test
CONF = config.CONF
@@ -47,21 +45,11 @@
'vendor_name': bad_vendor}
vol_type_name = data_utils.rand_name(
self.__class__.__name__ + '-volume-type')
- bogus_type = self.admin_volume_types_client.create_volume_type(
- name=vol_type_name,
- extra_specs=extra_specs)['volume_type']
- self.addCleanup(self.admin_volume_types_client.delete_volume_type,
- bogus_type['id'])
+ bogus_type = self.create_volume_type(
+ name=vol_type_name, extra_specs=extra_specs)
params = {'volume_type': bogus_type['id'],
'size': CONF.volume.volume_size}
- volume = self.volumes_client.create_volume(**params)['volume']
- self.addCleanup(self.delete_volume, self.volumes_client, volume['id'])
- try:
- waiters.wait_for_volume_status(self.volumes_client, volume['id'],
- 'error')
- except exceptions.VolumeBuildErrorException:
- # Error state is expected and desired
- pass
+ volume = self.create_volume(wait_until="error", **params)
messages = self.messages_client.list_messages()['messages']
message_id = None
for message in messages:
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index b9aeb99..f32c84a 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -108,11 +108,20 @@
super(BaseVolumeTest, cls).resource_cleanup()
@classmethod
- def create_volume(cls, **kwargs):
- """Wrapper utility that returns a test volume."""
+ def create_volume(cls, wait_until='available', **kwargs):
+ """Wrapper utility that returns a test volume.
+
+ :param wait_until: wait till volume status.
+ """
if 'size' not in kwargs:
kwargs['size'] = CONF.volume.volume_size
+ if 'imageRef' in kwargs:
+ image = cls.compute_images_client.show_image(
+ kwargs['imageRef'])['image']
+ min_disk = image.get('minDisk')
+ kwargs['size'] = max(kwargs['size'], min_disk)
+
name_field = cls.special_fields['name_field']
if name_field not in kwargs:
name = data_utils.rand_name(cls.__name__ + '-Volume')
@@ -120,8 +129,8 @@
volume = cls.volumes_client.create_volume(**kwargs)['volume']
cls.volumes.append(volume)
- waiters.wait_for_volume_status(cls.volumes_client,
- volume['id'], 'available')
+ waiters.wait_for_volume_status(cls.volumes_client, volume['id'],
+ wait_until)
return volume
@classmethod
@@ -148,6 +157,18 @@
client.delete_volume(volume_id)
client.wait_for_resource_deletion(volume_id)
+ def attach_volume(self, server_id, volume_id):
+ """Attachs a volume to a server"""
+ self.servers_client.attach_volume(
+ server_id, volumeId=volume_id,
+ device='/dev/%s' % CONF.compute.volume_device_name)
+ waiters.wait_for_volume_status(self.volumes_client,
+ volume_id, 'in-use')
+ self.addCleanup(waiters.wait_for_volume_status, self.volumes_client,
+ volume_id, 'available')
+ self.addCleanup(self.servers_client.detach_volume, server_id,
+ self.volume_origin['id'])
+
@classmethod
def clear_volumes(cls):
for volume in cls.volumes:
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 07f799b..51de2be 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -54,8 +54,8 @@
self.assertEqual(volume[self.name_field], v_name,
"The created volume name is not equal "
"to the requested name")
- self.assertTrue(volume['id'] is not None,
- "Field volume id is empty or not found.")
+ self.assertIsNotNone(volume['id'],
+ "Field volume id is empty or not found.")
# Get Volume information
fetched_volume = self.client.show_volume(volume['id'])['volume']
self.assertEqual(v_name,
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
index fda0dda..6ed6b9c 100644
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -62,7 +62,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('9387686f-334f-4d31-a439-33494b9e2683')
- def test_create_volume_with_out_passing_size(self):
+ def test_create_volume_without_passing_size(self):
# Should not be able to create volume without passing size
# in request
v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 3c05d3e..3c7a2c8 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -12,7 +12,6 @@
from tempest.api.volume import base
from tempest.common.utils import data_utils
-from tempest.common import waiters
from tempest import config
from tempest import test
@@ -46,21 +45,53 @@
# Create a snapshot when volume status is in-use
# Create a test instance
server = self.create_server(wait_until='ACTIVE')
- self.servers_client.attach_volume(
- server['id'], volumeId=self.volume_origin['id'],
- device='/dev/%s' % CONF.compute.volume_device_name)
- waiters.wait_for_volume_status(self.volumes_client,
- self.volume_origin['id'], 'in-use')
- self.addCleanup(waiters.wait_for_volume_status, self.volumes_client,
- self.volume_origin['id'], 'available')
- self.addCleanup(self.servers_client.detach_volume, server['id'],
- self.volume_origin['id'])
+ self.attach_volume(server['id'], self.volume_origin['id'])
+
# Snapshot a volume even if it's attached to an instance
snapshot = self.create_snapshot(self.volume_origin['id'],
force=True)
# Delete the snapshot
self.cleanup_snapshot(snapshot)
+ @test.idempotent_id('8567b54c-4455-446d-a1cf-651ddeaa3ff2')
+ @test.services('compute')
+ def test_snapshot_delete_with_volume_in_use(self):
+ # Create a test instance
+ server = self.create_server(wait_until='ACTIVE')
+ self.attach_volume(server['id'], self.volume_origin['id'])
+
+ # Snapshot a volume attached to an instance
+ snapshot1 = self.create_snapshot(self.volume_origin['id'], force=True)
+ snapshot2 = self.create_snapshot(self.volume_origin['id'], force=True)
+ snapshot3 = self.create_snapshot(self.volume_origin['id'], force=True)
+
+ # Delete the snapshots. Some snapshot implementations can take
+ # different paths according to order they are deleted.
+ self.cleanup_snapshot(snapshot1)
+ self.cleanup_snapshot(snapshot3)
+ self.cleanup_snapshot(snapshot2)
+
+ @test.idempotent_id('5210a1de-85a0-11e6-bb21-641c676a5d61')
+ @test.services('compute')
+ def test_snapshot_create_offline_delete_online(self):
+
+ # Create a snapshot while it is not attached
+ snapshot1 = self.create_snapshot(self.volume_origin['id'])
+
+ # Create a server and attach it
+ server = self.create_server(wait_until='ACTIVE')
+ self.attach_volume(server['id'], self.volume_origin['id'])
+
+ # Now that the volume is attached, create another snapshots
+ snapshot2 = self.create_snapshot(self.volume_origin['id'], force=True)
+ snapshot3 = self.create_snapshot(self.volume_origin['id'], force=True)
+
+ # Delete the snapshots. Some snapshot implementations can take
+ # different paths according to order they are deleted.
+ self.cleanup_snapshot(snapshot3)
+ self.cleanup_snapshot(snapshot1)
+ self.cleanup_snapshot(snapshot2)
+
@test.idempotent_id('2a8abbe4-d871-46db-b049-c41f5af8216e')
def test_snapshot_create_get_list_update_delete(self):
# Create a snapshot
diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py
index 60a35b0..03996af 100644
--- a/tempest/api/volume/v2/test_volumes_list.py
+++ b/tempest/api/volume/v2/test_volumes_list.py
@@ -73,11 +73,13 @@
val0 = fetched_volume[0][sort_key]
val1 = fetched_volume[1][sort_key]
if sort_dir == 'asc':
- self.assertTrue(val0 < val1,
- "%s < %s" % (val0, val1))
+ self.assertLess(val0, val1,
+ "list is not in asc order with sort_key: %s."
+ " %s" % (sort_key, fetched_volume))
elif sort_dir == 'desc':
- self.assertTrue(val0 > val1,
- "%s > %s" % (val0, val1))
+ self.assertGreater(val0, val1,
+ "list is not in desc order with sort_key: "
+ "%s. %s" % (sort_key, fetched_volume))
_list_details_with_multiple_params()
_list_details_with_multiple_params(sort_dir='desc')
diff --git a/tempest/api/volume/v3/base.py b/tempest/api/volume/v3/base.py
index c31c83c..31fc1eb 100644
--- a/tempest/api/volume/v3/base.py
+++ b/tempest/api/volume/v3/base.py
@@ -44,7 +44,7 @@
@classmethod
def setup_clients(cls):
super(VolumesV3Test, cls).setup_clients()
- cls.messages_client = cls.os.volume_messages_client
+ cls.messages_client = cls.os.volume_v3_messages_client
def setUp(self):
super(VolumesV3Test, self).setUp()
@@ -52,7 +52,8 @@
self.request_microversion))
-class VolumesV3AdminTest(VolumesV3Test):
+class VolumesV3AdminTest(VolumesV3Test,
+ base.BaseVolumeAdminTest):
"""Base test case class for all v3 Volume Admin API tests."""
credentials = ['primary', 'admin']
@@ -60,5 +61,5 @@
@classmethod
def setup_clients(cls):
super(VolumesV3AdminTest, cls).setup_clients()
- cls.admin_messages_client = cls.os_adm.volume_messages_client
+ cls.admin_messages_client = cls.os_adm.volume_v3_messages_client
cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client
diff --git a/tempest/clients.py b/tempest/clients.py
index be6bc02..6ded9e7 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -19,7 +19,6 @@
from tempest.common import negative_rest_client
from tempest import config
-from tempest import exceptions
from tempest.lib import auth
from tempest.lib import exceptions as lib_exc
from tempest.lib.services import clients
@@ -142,6 +141,8 @@
self.namespaces_client = self.image_v2.NamespacesClient()
self.resource_types_client = self.image_v2.ResourceTypesClient()
self.schemas_client = self.image_v2.SchemasClient()
+ self.namespace_properties_client = \
+ self.image_v2.NamespacePropertiesClient()
def _set_compute_clients(self):
self.agents_client = self.compute.AgentsClient()
@@ -280,52 +281,33 @@
# Mandatory parameters (always defined)
params = self.parameters['volume']
- self.volume_qos_client = volume.v1.QosSpecsClient(self.auth_provider,
- **params)
- self.volume_qos_v2_client = volume.v2.QosSpecsClient(
+ self.volume_qos_client = self.volume_v1.QosSpecsClient()
+ self.volume_qos_v2_client = self.volume_v2.QosSpecsClient()
+ self.volume_services_client = self.volume_v1.ServicesClient()
+ self.volume_services_v2_client = self.volume_v2.ServicesClient()
+ self.backups_client = self.volume_v1.BackupsClient()
+ self.backups_v2_client = self.volume_v2.BackupsClient()
+ self.encryption_types_client = self.volume_v1.EncryptionTypesClient()
+ self.encryption_types_v2_client = \
+ self.volume_v2.EncryptionTypesClient()
+ self.snapshots_client = self.volume_v1.SnapshotsClient()
+ self.snapshots_v2_client = self.volume_v2.SnapshotsClient()
+ self.volumes_client = self.volume_v1.VolumesClient()
+ self.volumes_v2_client = self.volume_v2.VolumesClient()
+ self.volume_v3_messages_client = volume.v3.MessagesClient(
self.auth_provider, **params)
- self.volume_services_client = volume.v1.ServicesClient(
- self.auth_provider, **params)
- self.volume_services_v2_client = volume.v2.ServicesClient(
- self.auth_provider, **params)
- self.backups_client = volume.v1.BackupsClient(self.auth_provider,
- **params)
- self.backups_v2_client = volume.v2.BackupsClient(self.auth_provider,
- **params)
- self.encryption_types_client = volume.v1.EncryptionTypesClient(
- self.auth_provider, **params)
- self.encryption_types_v2_client = volume.v2.EncryptionTypesClient(
- self.auth_provider, **params)
- self.snapshots_client = volume.v1.SnapshotsClient(self.auth_provider,
- **params)
- self.snapshots_v2_client = volume.v2.SnapshotsClient(
- self.auth_provider, **params)
- self.volumes_client = volume.v1.VolumesClient(self.auth_provider,
- **params)
- self.volumes_v2_client = volume.v2.VolumesClient(self.auth_provider,
- **params)
- self.volume_messages_client = volume.v3.MessagesClient(
- self.auth_provider, **params)
- self.volume_types_client = volume.v1.TypesClient(self.auth_provider,
- **params)
- self.volume_types_v2_client = volume.v2.TypesClient(self.auth_provider,
- **params)
- self.volume_hosts_client = volume.v1.HostsClient(self.auth_provider,
- **params)
- self.volume_hosts_v2_client = volume.v2.HostsClient(self.auth_provider,
- **params)
- self.volume_quotas_client = volume.v1.QuotasClient(self.auth_provider,
- **params)
- self.volume_quotas_v2_client = volume.v2.QuotasClient(
- self.auth_provider, **params)
- self.volumes_extension_client = volume.v1.ExtensionsClient(
- self.auth_provider, **params)
- self.volumes_v2_extension_client = volume.v2.ExtensionsClient(
- self.auth_provider, **params)
+ self.volume_types_client = self.volume_v1.TypesClient()
+ self.volume_types_v2_client = self.volume_v2.TypesClient()
+ self.volume_hosts_client = self.volume_v1.HostsClient()
+ self.volume_hosts_v2_client = self.volume_v2.HostsClient()
+ self.volume_quotas_client = self.volume_v1.QuotasClient()
+ self.volume_quotas_v2_client = self.volume_v2.QuotasClient()
+ self.volumes_extension_client = self.volume_v1.ExtensionsClient()
+ self.volumes_v2_extension_client = self.volume_v2.ExtensionsClient()
self.volume_availability_zone_client = \
- volume.v1.AvailabilityZoneClient(self.auth_provider, **params)
+ self.volume_v1.AvailabilityZoneClient()
self.volume_v2_availability_zone_client = \
- volume.v2.AvailabilityZoneClient(self.auth_provider, **params)
+ self.volume_v2.AvailabilityZoneClient()
def _set_object_storage_clients(self):
# Mandatory parameters (always defined)
@@ -350,7 +332,7 @@
# kwargs for auth provider match the common ones used by service clients
default_params = config.service_client_config()
if credentials is None:
- raise exceptions.InvalidCredentials(
+ raise lib_exc.InvalidCredentials(
'Credentials must be specified')
auth_provider_class, auth_url = get_auth_provider_class(
credentials)
diff --git a/tempest/cmd/main.py b/tempest/cmd/main.py
index 641d11c..1090c41 100644
--- a/tempest/cmd/main.py
+++ b/tempest/cmd/main.py
@@ -11,11 +11,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-import logging
import sys
from cliff import app
from cliff import commandmanager
+from oslo_log import log as logging
from pbr import version
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..981a922 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):
@@ -176,7 +176,7 @@
time.sleep(client.build_interval)
body = client.show_volume(volume_id)['volume']
volume_status = body['status']
- if volume_status == 'error':
+ if volume_status == 'error' and status != 'error':
raise exceptions.VolumeBuildErrorException(volume_id=volume_id)
if volume_status == 'error_restoring':
raise exceptions.VolumeRestoreErrorException(volume_id=volume_id)
@@ -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,30 @@
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)
+
+
+def wait_for_interface_status(client, server, port_id, status):
+ """Waits for an interface to reach a given status."""
+ body = (client.show_interface(server, port_id)
+ ['interfaceAttachment'])
+ interface_status = body['port_state']
+ start = int(time.time())
+
+ while(interface_status != status):
+ time.sleep(client.build_interval)
+ body = (client.show_interface(server, port_id)
+ ['interfaceAttachment'])
+ interface_status = body['port_state']
+
+ timed_out = int(time.time()) - start >= client.build_timeout
+
+ if interface_status != status and timed_out:
+ message = ('Interface %s failed to reach %s status '
+ '(current %s) within the required time (%s s).' %
+ (port_id, status, interface_status,
+ client.build_timeout))
+ raise lib_exc.TimeoutException(message)
+
+ return body
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/clients.py b/tempest/lib/services/clients.py
index adf666b..2e5c457 100644
--- a/tempest/lib/services/clients.py
+++ b/tempest/lib/services/clients.py
@@ -25,6 +25,7 @@
from tempest.lib.services import compute
from tempest.lib.services import image
from tempest.lib.services import network
+from tempest.lib.services import volume
LOG = logging.getLogger(__name__)
@@ -40,7 +41,9 @@
'compute': compute,
'image.v1': image.v1,
'image.v2': image.v2,
- 'network': network
+ 'network': network,
+ 'volume.v1': volume.v1,
+ 'volume.v2': volume.v2
}
@@ -49,8 +52,7 @@
# NOTE(andreaf) This list will exists only as long the remain clients
# are migrated to tempest.lib, and it will then be deleted without
# deprecation or advance notice
- return set(['identity.v2', 'identity.v3', 'object-storage', 'volume.v1',
- 'volume.v2', 'volume.v3'])
+ return set(['identity.v2', 'identity.v3', 'object-storage', 'volume.v3'])
def available_modules():
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/tenant_usages_client.py b/tempest/lib/services/compute/tenant_usages_client.py
index 5a748c7..d0eb1c9 100644
--- a/tempest/lib/services/compute/tenant_usages_client.py
+++ b/tempest/lib/services/compute/tenant_usages_client.py
@@ -24,6 +24,12 @@
class TenantUsagesClient(base_compute_client.BaseComputeClient):
def list_tenant_usages(self, **params):
+ """List Tenant Usage For All Tenants.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/compute/#list-tenant-usage-for-all-tenants
+ """
url = 'os-simple-tenant-usage'
if params:
url += '?%s' % urllib.urlencode(params)
@@ -34,6 +40,12 @@
return rest_client.ResponseBody(resp, body)
def show_tenant_usage(self, tenant_id, **params):
+ """Show Usage Details For Tenant.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/compute/#show-usage-details-for-tenant
+ """
url = 'os-simple-tenant-usage/%s' % tenant_id
if params:
url += '?%s' % urllib.urlencode(params)
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/image/v2/__init__.py b/tempest/lib/services/image/v2/__init__.py
index 32bad8b..d359d4b 100644
--- a/tempest/lib/services/image/v2/__init__.py
+++ b/tempest/lib/services/image/v2/__init__.py
@@ -15,10 +15,12 @@
from tempest.lib.services.image.v2.image_members_client import \
ImageMembersClient
from tempest.lib.services.image.v2.images_client import ImagesClient
+from tempest.lib.services.image.v2.namespace_properties_client import \
+ NamespacePropertiesClient
from tempest.lib.services.image.v2.namespaces_client import NamespacesClient
from tempest.lib.services.image.v2.resource_types_client import \
ResourceTypesClient
from tempest.lib.services.image.v2.schemas_client import SchemasClient
-__all__ = ['ImageMembersClient', 'ImagesClient', 'NamespacesClient',
- 'ResourceTypesClient', 'SchemasClient']
+__all__ = ['ImageMembersClient', 'ImagesClient', 'NamespacePropertiesClient',
+ 'NamespacesClient', 'ResourceTypesClient', 'SchemasClient']
diff --git a/tempest/lib/services/image/v2/namespace_properties_client.py b/tempest/lib/services/image/v2/namespace_properties_client.py
new file mode 100644
index 0000000..1236b2b
--- /dev/null
+++ b/tempest/lib/services/image/v2/namespace_properties_client.py
@@ -0,0 +1,91 @@
+# Copyright 2016 EasyStack.
+# All Rights Reserved.
+#
+# 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.
+
+from oslo_serialization import jsonutils as json
+
+from tempest.lib.common import rest_client
+
+
+class NamespacePropertiesClient(rest_client.RestClient):
+ api_version = "v2"
+
+ def list_namespace_properties(self, namespace):
+ """Lists property definitions in a namespace.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/image/v2/metadefs-index.html#list-properties
+ """
+ url = 'metadefs/namespaces/%s/properties' % namespace
+ resp, body = self.get(url)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def create_namespace_property(self, namespace, **kwargs):
+ """Creates a property definition in a namespace.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/image/v2/metadefs-index.html#create-property
+ """
+ url = 'metadefs/namespaces/%s/properties' % namespace
+ data = json.dumps(kwargs)
+ resp, body = self.post(url, data)
+ self.expected_success(201, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def show_namespace_properties(self, namespace, property_name):
+ """Shows the definition for a property.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/image/v2/metadefs-index.html#show-property-definition
+ """
+ url = 'metadefs/namespaces/%s/properties/%s' % (namespace,
+ property_name)
+ resp, body = self.get(url)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def update_namespace_properties(self, namespace, property_name, **kwargs):
+ """Updates a property definition.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/image/v2/metadefs-index.html#update-property-definition
+ """
+ url = 'metadefs/namespaces/%s/properties/%s' % (namespace,
+ property_name)
+ data = json.dumps(kwargs)
+ resp, body = self.put(url, data)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def delete_namespace_property(self, namespace, property_name):
+ """Removes a property definition from a namespace.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/image/v2/metadefs-index.html#remove-property-definition
+ """
+ url = 'metadefs/namespaces/%s/properties/%s' % (namespace,
+ property_name)
+ resp, _ = self.delete(url)
+ self.expected_success(204, resp.status)
+ return rest_client.ResponseBody(resp)
diff --git a/tempest/lib/services/volume/__init__.py b/tempest/lib/services/volume/__init__.py
index e69de29..11da06c 100644
--- a/tempest/lib/services/volume/__init__.py
+++ b/tempest/lib/services/volume/__init__.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# 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.
+
+from tempest.lib.services.volume import v1
+from tempest.lib.services.volume import v2
+
+__all__ = ['v1', 'v2']
diff --git a/tempest/lib/services/volume/v1/__init__.py b/tempest/lib/services/volume/v1/__init__.py
index e69de29..9c98542 100644
--- a/tempest/lib/services/volume/v1/__init__.py
+++ b/tempest/lib/services/volume/v1/__init__.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# 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.
+
+from tempest.lib.services.volume.v1.availability_zone_client \
+ import AvailabilityZoneClient
+from tempest.lib.services.volume.v1.backups_client import BackupsClient
+from tempest.lib.services.volume.v1.encryption_types_client import \
+ EncryptionTypesClient
+from tempest.lib.services.volume.v1.extensions_client import ExtensionsClient
+from tempest.lib.services.volume.v1.hosts_client import HostsClient
+from tempest.lib.services.volume.v1.qos_client import QosSpecsClient
+from tempest.lib.services.volume.v1.quotas_client import QuotasClient
+from tempest.lib.services.volume.v1.services_client import ServicesClient
+from tempest.lib.services.volume.v1.snapshots_client import SnapshotsClient
+from tempest.lib.services.volume.v1.types_client import TypesClient
+from tempest.lib.services.volume.v1.volumes_client import VolumesClient
+
+__all__ = ['AvailabilityZoneClient', 'BackupsClient', 'EncryptionTypesClient',
+ 'ExtensionsClient', 'HostsClient', 'QosSpecsClient', 'QuotasClient',
+ 'ServicesClient', 'SnapshotsClient', 'TypesClient', 'VolumesClient']
diff --git a/tempest/lib/services/volume/v1/backups_client.py b/tempest/lib/services/volume/v1/backups_client.py
index 2728c67..8677913 100644
--- a/tempest/lib/services/volume/v1/backups_client.py
+++ b/tempest/lib/services/volume/v1/backups_client.py
@@ -26,8 +26,9 @@
def create_backup(self, **kwargs):
"""Creates a backup of volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createBackup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/block-storage/v2/#create-backup
"""
post_body = json.dumps({'backup': kwargs})
resp, body = self.post('backups', post_body)
@@ -38,8 +39,9 @@
def restore_backup(self, backup_id, **kwargs):
"""Restore volume from backup.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#restoreBackup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/block-storage/v2/#restore-backup
"""
post_body = json.dumps({'restore': kwargs})
resp, body = self.post('backups/%s/restore' % (backup_id), post_body)
diff --git a/tempest/lib/services/volume/v1/qos_client.py b/tempest/lib/services/volume/v1/qos_client.py
index 65ae274..e247b7b 100644
--- a/tempest/lib/services/volume/v1/qos_client.py
+++ b/tempest/lib/services/volume/v1/qos_client.py
@@ -41,8 +41,9 @@
def create_qos(self, **kwargs):
"""Create a QoS Specification.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createQoSSpec
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/block-storage/v2/#create-qos-specification
"""
post_body = json.dumps({'qos_specs': kwargs})
resp, body = self.post('qos-specs', post_body)
@@ -76,8 +77,9 @@
def set_qos_key(self, qos_id, **kwargs):
"""Set the specified keys/values of QoS specification.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#setQoSKey
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref/block-storage/v2/#set-keys-in-qos-specification
"""
put_body = json.dumps({"qos_specs": kwargs})
resp, body = self.put('qos-specs/%s' % qos_id, put_body)
diff --git a/tempest/lib/services/volume/v1/snapshots_client.py b/tempest/lib/services/volume/v1/snapshots_client.py
index 1881078..2cf1555 100644
--- a/tempest/lib/services/volume/v1/snapshots_client.py
+++ b/tempest/lib/services/volume/v1/snapshots_client.py
@@ -25,8 +25,9 @@
def list_snapshots(self, detail=False, **params):
"""List all the snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#listSnapshots
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#listSnapshots
"""
url = 'snapshots'
if detail:
@@ -42,8 +43,9 @@
def show_snapshot(self, snapshot_id):
"""Returns the details of a single snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#showSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#showSnapshot
"""
url = "snapshots/%s" % snapshot_id
resp, body = self.get(url)
@@ -54,8 +56,9 @@
def create_snapshot(self, **kwargs):
"""Creates a new snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#createSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#createSnapshot
"""
post_body = json.dumps({'snapshot': kwargs})
resp, body = self.post('snapshots', post_body)
@@ -66,8 +69,9 @@
def delete_snapshot(self, snapshot_id):
"""Delete Snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#deleteSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#deleteSnapshot
"""
resp, body = self.delete("snapshots/%s" % snapshot_id)
self.expected_success(202, resp.status)
@@ -117,9 +121,9 @@
def update_snapshot(self, snapshot_id, **kwargs):
"""Updates a snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#
- updateSnapshotMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#updateSnapshotMetadata
"""
put_body = json.dumps({'snapshot': kwargs})
resp, body = self.put('snapshots/%s' % snapshot_id, put_body)
@@ -130,9 +134,9 @@
def show_snapshot_metadata(self, snapshot_id):
"""Get metadata of the snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#
- showSnapshotMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#showSnapshotMetadata
"""
url = "snapshots/%s/metadata" % snapshot_id
resp, body = self.get(url)
@@ -143,9 +147,9 @@
def update_snapshot_metadata(self, snapshot_id, **kwargs):
"""Update metadata for the snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#
- updateSnapshotMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#updateSnapshotMetadata
"""
put_body = json.dumps(kwargs)
url = "snapshots/%s/metadata" % snapshot_id
diff --git a/tempest/lib/services/volume/v1/types_client.py b/tempest/lib/services/volume/v1/types_client.py
index dce728d..2b696e5 100644
--- a/tempest/lib/services/volume/v1/types_client.py
+++ b/tempest/lib/services/volume/v1/types_client.py
@@ -38,8 +38,9 @@
def list_volume_types(self, **params):
"""List all the volume_types created.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#listVolumeTypes
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#listVolumeTypes
"""
url = 'types'
if params:
@@ -53,8 +54,9 @@
def show_volume_type(self, volume_type_id):
"""Returns the details of a single volume_type.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#showVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#showVolumeType
"""
url = "types/%s" % volume_type_id
resp, body = self.get(url)
@@ -65,8 +67,9 @@
def create_volume_type(self, **kwargs):
"""Create volume type.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#createVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#createVolumeType
"""
post_body = json.dumps({'volume_type': kwargs})
resp, body = self.post('types', post_body)
@@ -77,8 +80,9 @@
def delete_volume_type(self, volume_type_id):
"""Deletes the Specified Volume_type.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v1.html#deleteVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v1.html#deleteVolumeType
"""
resp, body = self.delete("types/%s" % volume_type_id)
self.expected_success(202, resp.status)
@@ -131,8 +135,9 @@
def update_volume_type(self, volume_type_id, **kwargs):
"""Updates volume type name, description, and/or is_public.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#updateVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateVolumeType
"""
put_body = json.dumps({'volume_type': kwargs})
resp, body = self.put('types/%s' % volume_type_id, put_body)
@@ -148,9 +153,9 @@
extra_spec_name: Name of the extra spec to be updated.
extra_spec: A dictionary of with key as extra_spec_name and the
updated value.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#
- updateVolumeTypeExtraSpecs
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateVolumeTypeExtraSpecs
"""
url = "types/%s/extra_specs/%s" % (volume_type_id, extra_spec_name)
put_body = json.dumps(extra_specs)
diff --git a/tempest/lib/services/volume/v1/volumes_client.py b/tempest/lib/services/volume/v1/volumes_client.py
index 3df8da4..242befc 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.
@@ -61,8 +61,9 @@
def create_volume(self, **kwargs):
"""Creates a new Volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createVolume
"""
post_body = json.dumps({'volume': kwargs})
resp, body = self.post('volumes', post_body)
@@ -73,8 +74,9 @@
def update_volume(self, volume_id, **kwargs):
"""Updates the Specified Volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#updateVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateVolume
"""
put_body = json.dumps({'volume': kwargs})
resp, body = self.put('volumes/%s' % volume_id, put_body)
@@ -100,8 +102,9 @@
def attach_volume(self, volume_id, **kwargs):
"""Attaches a volume to a given instance on a given mountpoint.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#attachVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#attachVolume
"""
post_body = json.dumps({'os-attach': kwargs})
url = 'volumes/%s/action' % (volume_id)
@@ -156,8 +159,9 @@
def extend_volume(self, volume_id, **kwargs):
"""Extend a volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#extendVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#extendVolume
"""
post_body = json.dumps({'os-extend': kwargs})
url = 'volumes/%s/action' % (volume_id)
@@ -168,8 +172,9 @@
def reset_volume_status(self, volume_id, **kwargs):
"""Reset the Specified Volume's Status.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#resetVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#resetVolume
"""
post_body = json.dumps({'os-reset_status': kwargs})
resp, body = self.post('volumes/%s/action' % volume_id, post_body)
@@ -179,8 +184,9 @@
def create_volume_transfer(self, **kwargs):
"""Create a volume transfer.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createVolumeTransfer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createVolumeTransfer
"""
post_body = json.dumps({'transfer': kwargs})
resp, body = self.post('os-volume-transfer', post_body)
@@ -199,8 +205,9 @@
def list_volume_transfers(self, **params):
"""List all the volume transfers created.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#listVolumeTransfer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#listVolumeTransfer
"""
url = 'os-volume-transfer'
if params:
@@ -219,8 +226,9 @@
def accept_volume_transfer(self, transfer_id, **kwargs):
"""Accept a volume transfer.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#acceptVolumeTransfer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#acceptVolumeTransfer
"""
url = 'os-volume-transfer/%s/accept' % transfer_id
post_body = json.dumps({'accept': kwargs})
diff --git a/tempest/lib/services/volume/v2/__init__.py b/tempest/lib/services/volume/v2/__init__.py
index e69de29..f547d7d 100644
--- a/tempest/lib/services/volume/v2/__init__.py
+++ b/tempest/lib/services/volume/v2/__init__.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# 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.
+
+from tempest.lib.services.volume.v2.availability_zone_client \
+ import AvailabilityZoneClient
+from tempest.lib.services.volume.v2.backups_client import BackupsClient
+from tempest.lib.services.volume.v2.encryption_types_client import \
+ EncryptionTypesClient
+from tempest.lib.services.volume.v2.extensions_client import ExtensionsClient
+from tempest.lib.services.volume.v2.hosts_client import HostsClient
+from tempest.lib.services.volume.v2.qos_client import QosSpecsClient
+from tempest.lib.services.volume.v2.quotas_client import QuotasClient
+from tempest.lib.services.volume.v2.services_client import ServicesClient
+from tempest.lib.services.volume.v2.snapshots_client import SnapshotsClient
+from tempest.lib.services.volume.v2.types_client import TypesClient
+from tempest.lib.services.volume.v2.volumes_client import VolumesClient
+
+__all__ = ['AvailabilityZoneClient', 'BackupsClient', 'EncryptionTypesClient',
+ 'ExtensionsClient', 'HostsClient', 'QosSpecsClient', 'QuotasClient',
+ 'ServicesClient', 'SnapshotsClient', 'TypesClient', 'VolumesClient']
diff --git a/tempest/lib/services/volume/v2/backups_client.py b/tempest/lib/services/volume/v2/backups_client.py
index 61f865d..ab5eefd 100644
--- a/tempest/lib/services/volume/v2/backups_client.py
+++ b/tempest/lib/services/volume/v2/backups_client.py
@@ -26,8 +26,9 @@
def create_backup(self, **kwargs):
"""Creates a backup of volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createBackup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createBackup
"""
post_body = json.dumps({'backup': kwargs})
resp, body = self.post('backups', post_body)
@@ -38,8 +39,9 @@
def restore_backup(self, backup_id, **kwargs):
"""Restore volume from backup.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#restoreBackup
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#restoreBackup
"""
post_body = json.dumps({'restore': kwargs})
resp, body = self.post('backups/%s/restore' % (backup_id), post_body)
diff --git a/tempest/lib/services/volume/v2/snapshots_client.py b/tempest/lib/services/volume/v2/snapshots_client.py
index c84e557..dd0f407 100644
--- a/tempest/lib/services/volume/v2/snapshots_client.py
+++ b/tempest/lib/services/volume/v2/snapshots_client.py
@@ -25,8 +25,9 @@
def list_snapshots(self, detail=False, **params):
"""List all the snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#listSnapshots
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#listSnapshots
"""
url = 'snapshots'
if detail:
@@ -42,8 +43,9 @@
def show_snapshot(self, snapshot_id):
"""Returns the details of a single snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#showSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#showSnapshot
"""
url = "snapshots/%s" % snapshot_id
resp, body = self.get(url)
@@ -54,8 +56,9 @@
def create_snapshot(self, **kwargs):
"""Creates a new snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createSnapshot
"""
post_body = json.dumps({'snapshot': kwargs})
resp, body = self.post('snapshots', post_body)
@@ -66,8 +69,9 @@
def update_snapshot(self, snapshot_id, **kwargs):
"""Updates a snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#updateSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateSnapshot
"""
put_body = json.dumps({'snapshot': kwargs})
resp, body = self.put('snapshots/%s' % snapshot_id, put_body)
@@ -78,8 +82,9 @@
def delete_snapshot(self, snapshot_id):
"""Delete Snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#deleteSnapshot
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#deleteSnapshot
"""
resp, body = self.delete("snapshots/%s" % snapshot_id)
self.expected_success(202, resp.status)
@@ -129,9 +134,9 @@
def show_snapshot_metadata(self, snapshot_id):
"""Get metadata of the snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#
- showSnapshotMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#showSnapshotMetadata
"""
url = "snapshots/%s/metadata" % snapshot_id
resp, body = self.get(url)
@@ -142,9 +147,9 @@
def update_snapshot_metadata(self, snapshot_id, **kwargs):
"""Update metadata for the snapshot.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#
- updateSnapshotMetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateSnapshotMetadata
"""
put_body = json.dumps(kwargs)
url = "snapshots/%s/metadata" % snapshot_id
diff --git a/tempest/lib/services/volume/v2/types_client.py b/tempest/lib/services/volume/v2/types_client.py
index d399e99..7a0d6d0 100644
--- a/tempest/lib/services/volume/v2/types_client.py
+++ b/tempest/lib/services/volume/v2/types_client.py
@@ -39,8 +39,9 @@
def list_volume_types(self, **params):
"""List all the volume_types created.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#showVolumeTypes
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#showVolumeTypes
"""
url = 'types'
if params:
@@ -54,8 +55,9 @@
def show_volume_type(self, volume_type_id):
"""Returns the details of a single volume_type.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#showVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#showVolumeType
"""
url = "types/%s" % volume_type_id
resp, body = self.get(url)
@@ -66,8 +68,9 @@
def create_volume_type(self, **kwargs):
"""Create volume type.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createVolumeType
"""
post_body = json.dumps({'volume_type': kwargs})
resp, body = self.post('types', post_body)
@@ -78,8 +81,9 @@
def delete_volume_type(self, volume_type_id):
"""Deletes the Specified Volume_type.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#deleteVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#deleteVolumeType
"""
resp, body = self.delete("types/%s" % volume_type_id)
self.expected_success(202, resp.status)
@@ -132,8 +136,9 @@
def update_volume_type(self, volume_type_id, **kwargs):
"""Updates volume type name, description, and/or is_public.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#updateVolumeType
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateVolumeType
"""
put_body = json.dumps({'volume_type': kwargs})
resp, body = self.put('types/%s' % volume_type_id, put_body)
@@ -149,9 +154,9 @@
extra_spec_name: Name of the extra spec to be updated.
extra_spec: A dictionary of with key as extra_spec_name and the
updated value.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#
- updateVolumeTypeExtraSpecs
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateVolumeTypeExtraSpecs
"""
url = "types/%s/extra_specs/%s" % (volume_type_id, extra_spec_name)
put_body = json.dumps(extra_specs)
@@ -163,9 +168,9 @@
def add_type_access(self, volume_type_id, **kwargs):
"""Adds volume type access for the given project.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html
- #createVolumeTypeAccessExt
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createVolumeTypeAccessExt
"""
post_body = json.dumps({'addProjectAccess': kwargs})
url = 'types/%s/action' % volume_type_id
@@ -176,9 +181,9 @@
def remove_type_access(self, volume_type_id, **kwargs):
"""Removes volume type access for the given project.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html
- #removeVolumeTypeAccessExt
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#removeVolumeTypeAccessExt
"""
post_body = json.dumps({'removeProjectAccess': kwargs})
url = 'types/%s/action' % volume_type_id
@@ -189,9 +194,9 @@
def list_type_access(self, volume_type_id):
"""Print access information about the given volume type.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#
- listVolumeTypeAccessExt
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#listVolumeTypeAccessExt
"""
url = 'types/%s/os-volume-type-access' % volume_type_id
resp, body = self.get(url)
diff --git a/tempest/lib/services/volume/v2/volumes_client.py b/tempest/lib/services/volume/v2/volumes_client.py
index b1930e1..1fb5727 100644
--- a/tempest/lib/services/volume/v2/volumes_client.py
+++ b/tempest/lib/services/volume/v2/volumes_client.py
@@ -62,8 +62,9 @@
def create_volume(self, **kwargs):
"""Creates a new Volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createVolume
"""
post_body = json.dumps({'volume': kwargs})
resp, body = self.post('volumes', post_body)
@@ -74,8 +75,9 @@
def update_volume(self, volume_id, **kwargs):
"""Updates the Specified Volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#updateVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#updateVolume
"""
put_body = json.dumps({'volume': kwargs})
resp, body = self.put('volumes/%s' % volume_id, put_body)
@@ -101,8 +103,9 @@
def attach_volume(self, volume_id, **kwargs):
"""Attaches a volume to a given instance on a given mountpoint.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#attachVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#attachVolume
"""
post_body = json.dumps({'os-attach': kwargs})
url = 'volumes/%s/action' % (volume_id)
@@ -157,8 +160,9 @@
def extend_volume(self, volume_id, **kwargs):
"""Extend a volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#extendVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#extendVolume
"""
post_body = json.dumps({'os-extend': kwargs})
url = 'volumes/%s/action' % (volume_id)
@@ -169,8 +173,9 @@
def reset_volume_status(self, volume_id, **kwargs):
"""Reset the Specified Volume's Status.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#resetVolume
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#resetVolume
"""
post_body = json.dumps({'os-reset_status': kwargs})
resp, body = self.post('volumes/%s/action' % volume_id, post_body)
@@ -180,8 +185,9 @@
def create_volume_transfer(self, **kwargs):
"""Create a volume transfer.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#createVolumeTransfer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#createVolumeTransfer
"""
post_body = json.dumps({'transfer': kwargs})
resp, body = self.post('os-volume-transfer', post_body)
@@ -200,8 +206,9 @@
def list_volume_transfers(self, **params):
"""List all the volume transfers created.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#listVolumeTransfer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#listVolumeTransfer
"""
url = 'os-volume-transfer'
if params:
@@ -220,8 +227,9 @@
def accept_volume_transfer(self, transfer_id, **kwargs):
"""Accept a volume transfer.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html#acceptVolumeTransfer
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#acceptVolumeTransfer
"""
url = 'os-volume-transfer/%s/accept' % transfer_id
post_body = json.dumps({'accept': kwargs})
@@ -296,9 +304,9 @@
def update_volume_image_metadata(self, volume_id, **kwargs):
"""Update image metadata for the volume.
- Available params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html
- #setVolumeimagemetadata
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#setVolumeimagemetadata
"""
post_body = json.dumps({'os-set_image_metadata': {'metadata': kwargs}})
url = "volumes/%s/action" % (volume_id)
@@ -329,9 +337,9 @@
def show_backend_capabilities(self, host):
"""Shows capabilities for a storage back end.
- Output params: see http://developer.openstack.org/
- api-ref-blockstorage-v2.html
- #showBackendCapabilities
+ For a full list of available parameters, please refer to the official
+ API reference:
+ http://developer.openstack.org/api-ref-blockstorage-v2.html#showBackendCapabilities
"""
url = 'capabilities/%s' % host
resp, body = self.get(url)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 831be99..73544d9 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -141,6 +141,9 @@
if clients is None:
clients = self.manager
+ if name is None:
+ name = data_utils.rand_name(self.__class__.__name__ + "-server")
+
vnic_type = CONF.network.port_vnic_type
# If vnic_type is configured create port for
@@ -216,6 +219,10 @@
imageRef=None, volume_type=None):
if size is None:
size = CONF.volume.volume_size
+ if imageRef:
+ image = self.compute_images_client.show_image(imageRef)['image']
+ min_disk = image.get('minDisk')
+ size = max(size, min_disk)
if name is None:
name = data_utils.rand_name(self.__class__.__name__ + "-volume")
kwargs = {'display_name': name,
@@ -402,10 +409,14 @@
servers = self.servers_client.list_servers()
servers = servers['servers']
for server in servers:
- console_output = self.servers_client.get_console_output(
- server['id'])['output']
- LOG.debug('Console output for %s\nbody=\n%s',
- server['id'], console_output)
+ try:
+ console_output = self.servers_client.get_console_output(
+ server['id'])['output']
+ LOG.debug('Console output for %s\nbody=\n%s',
+ server['id'], console_output)
+ except lib_exc.NotFound:
+ LOG.debug("Server %s disappeared(deleted) while looking "
+ "for the console log", server['id'])
def _log_net_info(self, exc):
# network debug is called as part of ssh init
@@ -676,11 +687,6 @@
if not CONF.service_available.neutron:
raise cls.skipException('Neutron not available')
- @classmethod
- def resource_setup(cls):
- super(NetworkScenarioTest, cls).resource_setup()
- cls.tenant_id = cls.manager.identity_client.tenant_id
-
def _create_network(self, networks_client=None,
routers_client=None, tenant_id=None,
namestart='network-smoke-',
@@ -1019,7 +1025,7 @@
if sg['tenant_id'] == tenant_id and sg['name'] == 'default'
]
msg = "No default security group for tenant %s." % (tenant_id)
- self.assertTrue(len(sgs) > 0, msg)
+ self.assertGreater(len(sgs), 0, msg)
return sgs[0]
def _create_security_group_rule(self, secgroup=None,
@@ -1287,7 +1293,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 +1317,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_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index 60b030d..0605902 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -35,6 +35,12 @@
"""
@classmethod
+ def setup_clients(cls):
+ super(TestNetworkAdvancedServerOps, cls).setup_clients()
+ cls.admin_servers_client = cls.os_adm.servers_client
+ cls.admin_hosts_client = cls.os_adm.hosts_client
+
+ @classmethod
def skip_checks(cls):
super(TestNetworkAdvancedServerOps, cls).skip_checks()
if not (CONF.network.project_networks_reachable
@@ -94,6 +100,10 @@
'ACTIVE')
self._check_network_connectivity(server, keypair, floating_ip)
+ def _get_host_for_server(self, server_id):
+ body = self.admin_servers_client.show_server(server_id)['server']
+ return body['OS-EXT-SRV-ATTR:host']
+
@test.idempotent_id('61f1aa9a-1573-410e-9054-afa557cab021')
@test.services('compute', 'network')
def test_server_connectivity_stop_start(self):
@@ -184,3 +194,29 @@
self.servers_client.confirm_resize_server(server['id'])
self._wait_server_status_and_check_network_connectivity(
server, keypair, floating_ip)
+
+ @test.idempotent_id('a4858f6c-401e-4155-9a49-d5cd053d1a2f')
+ @testtools.skipUnless(CONF.compute_feature_enabled.cold_migration,
+ 'Cold migration is not available.')
+ @test.services('compute', 'network')
+ def test_server_connectivity_cold_migration(self):
+ if CONF.compute.min_compute_nodes < 2:
+ msg = "Less than 2 compute nodes, skipping multinode tests."
+ raise self.skipException(msg)
+
+ keypair = self.create_keypair()
+ server = self._setup_server(keypair)
+ floating_ip = self._setup_network(server, keypair)
+ src_host = self._get_host_for_server(server['id'])
+ self._wait_server_status_and_check_network_connectivity(
+ server, keypair, floating_ip)
+
+ self.admin_servers_client.migrate_server(server['id'])
+ waiters.wait_for_server_status(self.servers_client, server['id'],
+ 'VERIFY_RESIZE')
+ self.servers_client.confirm_resize_server(server['id'])
+ self._wait_server_status_and_check_network_connectivity(
+ server, keypair, floating_ip)
+ dst_host = self._get_host_for_server(server['id'])
+
+ self.assertNotEqual(src_host, dst_host)
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index b527c3d..af313a5 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -19,12 +19,11 @@
from oslo_log import log as logging
import testtools
-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
@@ -105,8 +104,7 @@
def _setup_network_and_servers(self, **kwargs):
boot_with_port = kwargs.pop('boot_with_port', False)
- self.security_group = \
- self._create_security_group(tenant_id=self.tenant_id)
+ self.security_group = self._create_security_group()
self.network, self.subnet, self.router = self.create_networks(**kwargs)
self.check_networks()
@@ -117,8 +115,7 @@
self.port_id = self._create_port(self.network['id'])['id']
self.ports.append({'port': self.port_id})
- name = data_utils.rand_name('server-smoke')
- server = self._create_server(name, self.network, self.port_id)
+ server = self._create_server(self.network, self.port_id)
self._check_tenant_network_connectivity()
floating_ip = self.create_floating_ip(server)
@@ -152,7 +149,7 @@
self.assertIn(self.router['id'],
seen_router_ids)
- def _create_server(self, name, network, port_id=None):
+ def _create_server(self, network, port_id=None):
keypair = self.create_keypair()
self.keypairs[keypair['name']] = keypair
security_groups = [{'name': self.security_group['name']}]
@@ -161,7 +158,6 @@
network['port'] = port_id
server = self.create_server(
- name=name,
networks=[network],
key_name=keypair['name'],
security_groups=security_groups,
@@ -221,15 +217,14 @@
def _reassociate_floating_ips(self):
floating_ip, server = self.floating_ip_tuple
- name = data_utils.rand_name('new_server-smoke')
# create a new server for the floating ip
- server = self._create_server(name, self.network)
+ server = self._create_server(self.network)
self._associate_floating_ip(floating_ip, server)
self.floating_ip_tuple = Floating_IP_tuple(
floating_ip, server)
def _create_new_network(self, create_gateway=False):
- self.new_net = self._create_network(tenant_id=self.tenant_id)
+ self.new_net = self._create_network()
if create_gateway:
self.new_subnet = self._create_subnet(
network=self.new_net)
@@ -460,8 +455,7 @@
self._check_network_internal_connectivity(network=self.network)
self._check_network_external_connectivity()
self._create_new_network(create_gateway=True)
- name = data_utils.rand_name('server-smoke')
- self._create_server(name, self.new_net)
+ self._create_server(self.new_net)
self._check_network_internal_connectivity(network=self.new_net,
should_connect=False)
router_id = self.router['id']
@@ -689,8 +683,7 @@
# Boot another server with the same port to make sure nothing was
# left around that could cause issues.
- name = data_utils.rand_name('reuse-port')
- server = self._create_server(name, self.network, port['id'])
+ server = self._create_server(self.network, port['id'])
port_list = self._list_ports(device_id=server['id'],
network_id=self.network['id'])
self.assertEqual(1, len(port_list),
@@ -814,8 +807,7 @@
ssh_client = self.get_remote_client(fip['floating_ip_address'],
private_key=private_key)
spoof_nic = ssh_client.get_nic_name_by_mac(spoof_port["mac_address"])
- name = data_utils.rand_name('peer')
- peer = self._create_server(name, self.new_net)
+ peer = self._create_server(self.new_net)
peer_address = peer['addresses'][self.new_net['name']][0]['addr']
self._check_remote_connectivity(ssh_client, dest=peer_address,
nic=spoof_nic, should_succeed=True)
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index 496f07e..6700236 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -63,7 +63,7 @@
def setUp(self):
super(TestGettingAddress, self).setUp()
self.keypair = self.create_keypair()
- self.sec_grp = self._create_security_group(tenant_id=self.tenant_id)
+ self.sec_grp = self._create_security_group()
def prepare_network(self, address6_mode, n_subnets6=1, dualnet=False):
"""Prepare network
@@ -74,15 +74,15 @@
if dualnet - create IPv6 subnets on a different network
:return: list of created networks
"""
- self.network = self._create_network(tenant_id=self.tenant_id)
+ self.network = self._create_network()
if dualnet:
- self.network_v6 = self._create_network(tenant_id=self.tenant_id)
+ self.network_v6 = self._create_network()
sub4 = self._create_subnet(network=self.network,
namestart='sub4',
ip_version=4)
- router = self._get_router(tenant_id=self.tenant_id)
+ router = self._get_router()
self.routers_client.add_router_interface(router['id'],
subnet_id=sub4['id'])
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/services/volume/__init__.py b/tempest/services/volume/__init__.py
index 4d29cdd..c62dd53 100644
--- a/tempest/services/volume/__init__.py
+++ b/tempest/services/volume/__init__.py
@@ -12,8 +12,6 @@
# License for the specific language governing permissions and limitations under
# the License.
-from tempest.services.volume import v1
-from tempest.services.volume import v2
from tempest.services.volume import v3
-__all__ = ['v1', 'v2', 'v3']
+__all__ = ['v3']
diff --git a/tempest/services/volume/v1/__init__.py b/tempest/services/volume/v1/__init__.py
deleted file mode 100644
index 7fb3ed3..0000000
--- a/tempest/services/volume/v1/__init__.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
-#
-# 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.
-
-from tempest.lib.services.volume.v1.availability_zone_client import \
- AvailabilityZoneClient
-from tempest.lib.services.volume.v1.backups_client import BackupsClient
-from tempest.lib.services.volume.v1.encryption_types_client import \
- EncryptionTypesClient
-from tempest.lib.services.volume.v1.extensions_client import ExtensionsClient
-from tempest.lib.services.volume.v1.hosts_client import HostsClient
-from tempest.lib.services.volume.v1.qos_client import QosSpecsClient
-from tempest.lib.services.volume.v1.quotas_client import QuotasClient
-from tempest.lib.services.volume.v1.services_client import ServicesClient
-from tempest.lib.services.volume.v1.snapshots_client import SnapshotsClient
-from tempest.lib.services.volume.v1.types_client import TypesClient
-from tempest.lib.services.volume.v1.volumes_client import VolumesClient
-
-__all__ = ['AvailabilityZoneClient', 'EncryptionTypesClient',
- 'ExtensionsClient', 'HostsClient', 'QuotasClient',
- 'QosSpecsClient', 'ServicesClient',
- 'SnapshotsClient', 'TypesClient', 'BackupsClient',
- 'VolumesClient', ]
diff --git a/tempest/services/volume/v1/json/__init__.py b/tempest/services/volume/v1/json/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/volume/v1/json/__init__.py
+++ /dev/null
diff --git a/tempest/services/volume/v2/__init__.py b/tempest/services/volume/v2/__init__.py
deleted file mode 100644
index 8edaf2a..0000000
--- a/tempest/services/volume/v2/__init__.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
-#
-# 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.
-
-from tempest.lib.services.volume.v2.availability_zone_client import \
- AvailabilityZoneClient
-from tempest.lib.services.volume.v2.backups_client import BackupsClient
-from tempest.lib.services.volume.v2.encryption_types_client import \
- EncryptionTypesClient
-from tempest.lib.services.volume.v2.extensions_client import ExtensionsClient
-from tempest.lib.services.volume.v2.hosts_client import HostsClient
-from tempest.lib.services.volume.v2.qos_client import QosSpecsClient
-from tempest.lib.services.volume.v2.quotas_client import QuotasClient
-from tempest.lib.services.volume.v2.services_client import ServicesClient
-from tempest.lib.services.volume.v2.snapshots_client import SnapshotsClient
-from tempest.lib.services.volume.v2.types_client import TypesClient
-from tempest.lib.services.volume.v2.volumes_client import VolumesClient
-
-__all__ = ['AvailabilityZoneClient', 'BackupsClient', 'EncryptionTypesClient',
- 'ExtensionsClient', 'HostsClient', 'QosSpecsClient', 'QuotasClient',
- 'ServicesClient', 'SnapshotsClient', 'TypesClient',
- 'VolumesClient', ]
diff --git a/tempest/services/volume/v2/json/__init__.py b/tempest/services/volume/v2/json/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/services/volume/v2/json/__init__.py
+++ /dev/null
diff --git a/tempest/test.py b/tempest/test.py
index cc9410f..93fbed3 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
@@ -610,10 +610,10 @@
cred_provider, networks_client, CONF.compute.fixed_network_name)
def assertEmpty(self, list, msg=None):
- self.assertTrue(len(list) == 0, msg)
+ self.assertEqual(0, len(list), msg)
def assertNotEmpty(self, list, msg=None):
- self.assertTrue(len(list) > 0, msg)
+ self.assertGreater(len(list), 0, msg)
call_until_true = debtcollector.moves.moved_function(
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_custom_matchers.py b/tempest/tests/common/test_custom_matchers.py
index 07867fc..1053d86 100644
--- a/tempest/tests/common/test_custom_matchers.py
+++ b/tempest/tests/common/test_custom_matchers.py
@@ -25,11 +25,11 @@
matches = self.matches_matches
mismatches = self.matches_mismatches
for candidate in matches:
- self.assertEqual(None, matcher.match(candidate))
+ self.assertIsNone(matcher.match(candidate))
for candidate in mismatches:
mismatch = matcher.match(candidate)
- self.assertNotEqual(None, mismatch)
- self.assertNotEqual(None, getattr(mismatch, 'describe', None))
+ self.assertIsNotNone(mismatch)
+ self.assertIsNotNone(getattr(mismatch, 'describe', None))
def test__str__(self):
# [(expected, object to __str__)].
diff --git a/tempest/tests/common/test_waiters.py b/tempest/tests/common/test_waiters.py
index a826337..46f9526 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
@@ -36,14 +37,14 @@
waiters.wait_for_image_status(self.client, 'fake_image_id', 'active')
end_time = int(time.time())
# Ensure waiter returns before build_timeout
- self.assertTrue((end_time - start_time) < 10)
+ self.assertLess((end_time - start_time), 10)
def test_wait_for_image_status_timeout(self):
time_mock = self.patch('time.time')
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/tempest/tests/lib/services/volume/v1/test_quotas_client.py b/tempest/tests/lib/services/volume/v1/test_quotas_client.py
new file mode 100644
index 0000000..f9e76af
--- /dev/null
+++ b/tempest/tests/lib/services/volume/v1/test_quotas_client.py
@@ -0,0 +1,96 @@
+# Copyright 2016 NEC Corporation. All rights reserved.
+#
+# 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.
+
+from tempest.lib.services.volume.v1 import quotas_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestQuotasClient(base.BaseServiceTest):
+ FAKE_QUOTAS = {
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+ }
+
+ FAKE_UPDATE_QUOTAS_REQUEST = {
+ "quota_set": {
+ "security_groups": 45
+ }
+ }
+
+ def setUp(self):
+ super(TestQuotasClient, self).setUp()
+ fake_auth = fake_auth_provider.FakeAuthProvider()
+ self.client = quotas_client.QuotasClient(fake_auth,
+ 'volume',
+ 'regionOne')
+
+ def _test_show_default_quota_set(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_default_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_QUOTAS,
+ bytes_body, tenant_id="fake_tenant")
+
+ def _test_show_quota_set(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_QUOTAS,
+ bytes_body, tenant_id="fake_tenant")
+
+ def _test_update_quota_set(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_UPDATE_QUOTAS_REQUEST,
+ bytes_body, tenant_id="fake_tenant")
+
+ def test_show_default_quota_set_with_str_body(self):
+ self._test_show_default_quota_set()
+
+ def test_show_default_quota_set_with_bytes_body(self):
+ self._test_show_default_quota_set(bytes_body=True)
+
+ def test_show_quota_set_with_str_body(self):
+ self._test_show_quota_set()
+
+ def test_show_quota_set_with_bytes_body(self):
+ self._test_show_quota_set(bytes_body=True)
+
+ def test_update_quota_set_with_str_body(self):
+ self._test_update_quota_set()
+
+ def test_update_quota_set_with_bytes_body(self):
+ self._test_update_quota_set(bytes_body=True)
+
+ def test_delete_quota_set(self):
+ self.check_service_client_function(
+ self.client.delete_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.delete',
+ {},
+ tenant_id="fake_tenant")
diff --git a/tempest/tests/lib/services/volume/v1/test_snapshots_client.py b/tempest/tests/lib/services/volume/v1/test_snapshots_client.py
new file mode 100644
index 0000000..49191e3
--- /dev/null
+++ b/tempest/tests/lib/services/volume/v1/test_snapshots_client.py
@@ -0,0 +1,200 @@
+# Copyright 2016 NEC Corporation. All rights reserved.
+#
+# 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.
+
+from tempest.lib.services.volume.v1 import snapshots_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestSnapshotsClient(base.BaseServiceTest):
+ FAKE_CREATE_SNAPSHOT = {
+ "snapshot": {
+ "display_name": "snap-001",
+ "display_description": "Daily backup",
+ "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ "force": True
+ }
+ }
+
+ FAKE_UPDATE_SNAPSHOT_REQUEST = {
+ "metadata": {
+ "key": "v1"
+ }
+ }
+
+ FAKE_INFO_SNAPSHOT = {
+ "snapshot": {
+ "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5",
+ "display_name": "snap-001",
+ "display_description": "Daily backup",
+ "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ "status": "available",
+ "size": 30,
+ "created_at": "2012-02-29T03:50:07Z"
+ }
+ }
+
+ FAKE_LIST_SNAPSHOTS = {
+ "snapshots": [
+ {
+ "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5",
+ "display_name": "snap-001",
+ "display_description": "Daily backup",
+ "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ "status": "available",
+ "size": 30,
+ "created_at": "2012-02-29T03:50:07Z",
+ "metadata": {
+ "contents": "junk"
+ }
+ },
+ {
+ "id": "e479997c-650b-40a4-9dfe-77655818b0d2",
+ "display_name": "snap-002",
+ "display_description": "Weekly backup",
+ "volume_id": "76b8950a-8594-4e5b-8dce-0dfa9c696358",
+ "status": "available",
+ "size": 25,
+ "created_at": "2012-03-19T01:52:47Z",
+ "metadata": {}
+ }
+ ]
+ }
+
+ def setUp(self):
+ super(TestSnapshotsClient, self).setUp()
+ fake_auth = fake_auth_provider.FakeAuthProvider()
+ self.client = snapshots_client.SnapshotsClient(fake_auth,
+ 'volume',
+ 'regionOne')
+
+ def _test_create_snapshot(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.create_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.post',
+ self.FAKE_CREATE_SNAPSHOT,
+ bytes_body)
+
+ def _test_show_snapshot(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_INFO_SNAPSHOT,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5")
+
+ def _test_list_snapshots(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_snapshots,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_LIST_SNAPSHOTS,
+ bytes_body,
+ detail=True)
+
+ def _test_create_snapshot_metadata(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.create_snapshot_metadata,
+ 'tempest.lib.common.rest_client.RestClient.post',
+ self.FAKE_INFO_SNAPSHOT,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5",
+ metadata={"key": "v1"})
+
+ def _test_update_snapshot(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_UPDATE_SNAPSHOT_REQUEST,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5")
+
+ def _test_show_snapshot_metadata(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_snapshot_metadata,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_UPDATE_SNAPSHOT_REQUEST,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5")
+
+ def _test_update_snapshot_metadata(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_snapshot_metadata,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_UPDATE_SNAPSHOT_REQUEST,
+ bytes_body, snapshot_id="cbc36478b0bd8e67e89")
+
+ def _test_update_snapshot_metadata_item(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_snapshot_metadata_item,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_INFO_SNAPSHOT,
+ bytes_body, volume_type_id="cbc36478b0bd8e67e89")
+
+ def test_create_snapshot_with_str_body(self):
+ self._test_create_snapshot()
+
+ def test_create_snapshot_with_bytes_body(self):
+ self._test_create_snapshot(bytes_body=True)
+
+ def test_show_snapshot_with_str_body(self):
+ self._test_show_snapshot()
+
+ def test_show_snapshot_with_bytes_body(self):
+ self._test_show_snapshot(bytes_body=True)
+
+ def test_list_snapshots_with_str_body(self):
+ self._test_list_snapshots()
+
+ def test_list_snapshots_with_bytes_body(self):
+ self._test_list_snapshots(bytes_body=True)
+
+ def test_create_snapshot_metadata_with_str_body(self):
+ self._test_create_snapshot_metadata()
+
+ def test_create_snapshot_metadata_with_bytes_body(self):
+ self._test_create_snapshot_metadata(bytes_body=True)
+
+ def test_update_snapshot_with_str_body(self):
+ self._test_update_snapshot()
+
+ def test_update_snapshot_with_bytes_body(self):
+ self._test_update_snapshot(bytes_body=True)
+
+ def test_show_snapshot_metadata_with_str_body(self):
+ self._test_show_snapshot_metadata()
+
+ def test_show_snapshot_metadata_with_bytes_body(self):
+ self._test_show_snapshot_metadata(bytes_body=True)
+
+ def test_update_snapshot_metadata_with_str_body(self):
+ self._test_update_snapshot_metadata()
+
+ def test_update_snapshot_metadata_with_bytes_body(self):
+ self._test_update_snapshot_metadata(bytes_body=True)
+
+ def test_force_delete_snapshot(self):
+ self.check_service_client_function(
+ self.client.force_delete_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.post',
+ {},
+ snapshot_id="521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ status=202)
+
+ def test_delete_snapshot(self):
+ self.check_service_client_function(
+ self.client.delete_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.delete',
+ {},
+ snapshot_id="521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ status=202)
diff --git a/tempest/tests/lib/services/volume/v2/test_quotas_client.py b/tempest/tests/lib/services/volume/v2/test_quotas_client.py
new file mode 100644
index 0000000..6384350
--- /dev/null
+++ b/tempest/tests/lib/services/volume/v2/test_quotas_client.py
@@ -0,0 +1,86 @@
+# Copyright 2016 NEC Corporation. All rights reserved.
+#
+# 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.
+
+from tempest.lib.services.volume.v2 import quotas_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestQuotasClient(base.BaseServiceTest):
+ FAKE_QUOTAS = {
+ "quota_set": {
+ "gigabytes": 5,
+ "snapshots": 10,
+ "volumes": 20
+ }
+ }
+
+ FAKE_UPDATE_QUOTAS_REQUEST = {
+ "quota_set": {
+ "security_groups": 45
+ }
+ }
+
+ def setUp(self):
+ super(TestQuotasClient, self).setUp()
+ fake_auth = fake_auth_provider.FakeAuthProvider()
+ self.client = quotas_client.QuotasClient(fake_auth,
+ 'volume',
+ 'regionOne')
+
+ def _test_show_default_quota_set(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_default_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_QUOTAS,
+ bytes_body, tenant_id="fake_tenant")
+
+ def _test_show_quota_set(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_QUOTAS,
+ bytes_body, tenant_id="fake_tenant")
+
+ def _test_update_quota_set(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_UPDATE_QUOTAS_REQUEST,
+ bytes_body, tenant_id="fake_tenant")
+
+ def test_show_default_quota_set_with_str_body(self):
+ self._test_show_default_quota_set()
+
+ def test_show_default_quota_set_with_bytes_body(self):
+ self._test_show_default_quota_set(bytes_body=True)
+
+ def test_show_quota_set_with_str_body(self):
+ self._test_show_quota_set()
+
+ def test_show_quota_set_with_bytes_body(self):
+ self._test_show_quota_set(bytes_body=True)
+
+ def test_update_quota_set_with_str_body(self):
+ self._test_update_quota_set()
+
+ def test_update_quota_set_with_bytes_body(self):
+ self._test_update_quota_set(bytes_body=True)
+
+ def test_delete_quota_set(self):
+ self.check_service_client_function(
+ self.client.delete_quota_set,
+ 'tempest.lib.common.rest_client.RestClient.delete',
+ {},
+ tenant_id="fake_tenant")
diff --git a/tempest/tests/lib/services/volume/v2/test_snapshots_client.py b/tempest/tests/lib/services/volume/v2/test_snapshots_client.py
new file mode 100644
index 0000000..7d656f1
--- /dev/null
+++ b/tempest/tests/lib/services/volume/v2/test_snapshots_client.py
@@ -0,0 +1,201 @@
+# Copyright 2016 NEC Corporation. All rights reserved.
+#
+# 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.
+
+from tempest.lib.services.volume.v2 import snapshots_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestSnapshotsClient(base.BaseServiceTest):
+ FAKE_CREATE_SNAPSHOT = {
+ "snapshot": {
+ "display_name": "snap-001",
+ "display_description": "Daily backup",
+ "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ "force": True
+ }
+ }
+
+ FAKE_UPDATE_SNAPSHOT_REQUEST = {
+ "metadata": {
+ "key": "v1"
+ }
+ }
+
+ FAKE_INFO_SNAPSHOT = {
+ "snapshot": {
+ "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5",
+ "display_name": "snap-001",
+ "display_description": "Daily backup",
+ "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ "status": "available",
+ "size": 30,
+ "created_at": "2012-02-29T03:50:07Z"
+ }
+ }
+
+ FAKE_LIST_SNAPSHOTS = {
+ "snapshots": [
+ {
+ "id": "3fbbcccf-d058-4502-8844-6feeffdf4cb5",
+ "display_name": "snap-001",
+ "display_description": "Daily backup",
+ "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ "status": "available",
+ "size": 30,
+ "created_at": "2012-02-29T03:50:07Z",
+ "metadata": {
+ "contents": "junk"
+ }
+ },
+ {
+ "id": "e479997c-650b-40a4-9dfe-77655818b0d2",
+ "display_name": "snap-002",
+ "display_description": "Weekly backup",
+ "volume_id": "76b8950a-8594-4e5b-8dce-0dfa9c696358",
+ "status": "available",
+ "size": 25,
+ "created_at": "2012-03-19T01:52:47Z",
+ "metadata": {}
+ }
+ ]
+ }
+
+ def setUp(self):
+ super(TestSnapshotsClient, self).setUp()
+ fake_auth = fake_auth_provider.FakeAuthProvider()
+ self.client = snapshots_client.SnapshotsClient(fake_auth,
+ 'volume',
+ 'regionOne')
+
+ def _test_create_snapshot(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.create_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.post',
+ self.FAKE_CREATE_SNAPSHOT,
+ bytes_body,
+ status=202)
+
+ def _test_show_snapshot(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_INFO_SNAPSHOT,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5")
+
+ def _test_list_snapshots(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_snapshots,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_LIST_SNAPSHOTS,
+ bytes_body,
+ detail=True)
+
+ def _test_create_snapshot_metadata(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.create_snapshot_metadata,
+ 'tempest.lib.common.rest_client.RestClient.post',
+ self.FAKE_INFO_SNAPSHOT,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5",
+ metadata={"key": "v1"})
+
+ def _test_update_snapshot(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_UPDATE_SNAPSHOT_REQUEST,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5")
+
+ def _test_show_snapshot_metadata(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_snapshot_metadata,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_UPDATE_SNAPSHOT_REQUEST,
+ bytes_body,
+ snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5")
+
+ def _test_update_snapshot_metadata(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_snapshot_metadata,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_UPDATE_SNAPSHOT_REQUEST,
+ bytes_body, snapshot_id="cbc36478b0bd8e67e89")
+
+ def _test_update_snapshot_metadata_item(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.update_snapshot_metadata_item,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ self.FAKE_INFO_SNAPSHOT,
+ bytes_body, volume_type_id="cbc36478b0bd8e67e89")
+
+ def test_create_snapshot_with_str_body(self):
+ self._test_create_snapshot()
+
+ def test_create_snapshot_with_bytes_body(self):
+ self._test_create_snapshot(bytes_body=True)
+
+ def test_show_snapshot_with_str_body(self):
+ self._test_show_snapshot()
+
+ def test_show_snapshot_with_bytes_body(self):
+ self._test_show_snapshot(bytes_body=True)
+
+ def test_list_snapshots_with_str_body(self):
+ self._test_list_snapshots()
+
+ def test_list_snapshots_with_bytes_body(self):
+ self._test_list_snapshots(bytes_body=True)
+
+ def test_create_snapshot_metadata_with_str_body(self):
+ self._test_create_snapshot_metadata()
+
+ def test_create_snapshot_metadata_with_bytes_body(self):
+ self._test_create_snapshot_metadata(bytes_body=True)
+
+ def test_update_snapshot_with_str_body(self):
+ self._test_update_snapshot()
+
+ def test_update_snapshot_with_bytes_body(self):
+ self._test_update_snapshot(bytes_body=True)
+
+ def test_show_snapshot_metadata_with_str_body(self):
+ self._test_show_snapshot_metadata()
+
+ def test_show_snapshot_metadata_with_bytes_body(self):
+ self._test_show_snapshot_metadata(bytes_body=True)
+
+ def test_update_snapshot_metadata_with_str_body(self):
+ self._test_update_snapshot_metadata()
+
+ def test_update_snapshot_metadata_with_bytes_body(self):
+ self._test_update_snapshot_metadata(bytes_body=True)
+
+ def test_force_delete_snapshot(self):
+ self.check_service_client_function(
+ self.client.force_delete_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.post',
+ {},
+ snapshot_id="521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ status=202)
+
+ def test_delete_snapshot(self):
+ self.check_service_client_function(
+ self.client.delete_snapshot,
+ 'tempest.lib.common.rest_client.RestClient.delete',
+ {},
+ snapshot_id="521752a6-acf6-4b2d-bc7a-119f9148cd8c",
+ status=202)
diff --git a/test-requirements.txt b/test-requirements.txt
index 53efa46..475fb16 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,11 +1,11 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-hacking<0.12,>=0.11.0 # Apache-2.0
+hacking<0.13,>=0.12.0 # Apache-2.0
# 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