Merge "Use the correct attachment id for multiattach."
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 2a3edf4..59a2f64 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -24,6 +24,7 @@
import os
import subprocess
+import sys
# Build the plugin registry
def build_plugin_registry(app):
@@ -31,16 +32,20 @@
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
subprocess.call(['tools/generate-tempest-plugins-list.sh'], cwd=root_dir)
+def autodoc_skip_member_handler(app, what, name, obj, skip, options):
+ return skip or (what == "class" and not name.startswith("test"))
+
def setup(app):
+ app.connect('autodoc-skip-member', autodoc_skip_member_handler)
if os.getenv('GENERATE_TEMPEST_PLUGIN_LIST', 'true').lower() == 'true':
app.connect('builder-inited', build_plugin_registry)
-
-
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+# sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../../tempest'))
+sys.path.insert(0, os.path.abspath('../../tempest/api'))
# -- General configuration -----------------------------------------------------
@@ -204,3 +209,10 @@
('index', 'doc-tempest.tex', u'Tempest Testing Project',
u'OpenStack Foundation', 'manual'),
]
+
+latex_use_xindy = False
+
+latex_elements = {
+ 'maxlistdepth': 20,
+ 'printindex': '\\footnotesize\\raggedright\\printindex'
+}
diff --git a/doc/source/index.rst b/doc/source/index.rst
index d4dc166..66e68ea 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -56,6 +56,13 @@
supported_version
+Description of Tests
+--------------------
+.. toctree::
+ :maxdepth: 2
+
+ tests/modules
+
For Contributors
================
diff --git a/doc/source/tests/modules.rst b/doc/source/tests/modules.rst
new file mode 100644
index 0000000..026a7a5
--- /dev/null
+++ b/doc/source/tests/modules.rst
@@ -0,0 +1,21 @@
+Description of Tests
+====================
+
+OpenStack Services Integration Tests
+------------------------------------
+.. toctree::
+ :maxdepth: 2
+
+ scenario/modules
+
+OpenStack Services API Tests
+----------------------------
+.. toctree::
+ :maxdepth: 2
+
+ compute/modules
+ identity/modules
+ image/modules
+ network/modules
+ object_storage/modules
+ volume/modules
diff --git a/releasenotes/notes/xenapi_apis-conf-fcca549283e53ed6.yaml b/releasenotes/notes/xenapi_apis-conf-fcca549283e53ed6.yaml
new file mode 100644
index 0000000..4d26210
--- /dev/null
+++ b/releasenotes/notes/xenapi_apis-conf-fcca549283e53ed6.yaml
@@ -0,0 +1,7 @@
+---
+upgrade:
+ - |
+ A number of Compute APIs that only worked with the XenAPI virt driver have
+ been removed in the Compute service. As a result, their corresponding tests
+ are now disabled by default. They can be re-enabled using the new
+ ``[compute_feature_enabled] xenapi_apis`` config option.
diff --git a/tempest/api/compute/admin/test_agents.py b/tempest/api/compute/admin/test_agents.py
index 0414b91..4cc5fdd 100644
--- a/tempest/api/compute/admin/test_agents.py
+++ b/tempest/api/compute/admin/test_agents.py
@@ -13,14 +13,24 @@
# under the License.
from tempest.api.compute import base
+from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
+CONF = config.CONF
+
+# TODO(stephenfin): Remove these tests once the nova Ussuri branch goes EOL
class AgentsAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Compute Agents API"""
@classmethod
+ def skip_checks(cls):
+ super(AgentsAdminTestJSON, cls).skip_checks()
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise cls.skipException('The os-agents API is not supported.')
+
+ @classmethod
def setup_clients(cls):
super(AgentsAdminTestJSON, cls).setup_clients()
cls.client = cls.os_admin.agents_client
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 530c8fb..ab1b49a 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -14,10 +14,13 @@
from tempest.api.compute import base
from tempest.common import waiters
+from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
+CONF = config.CONF
+
class ServersAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Servers API using admin privileges"""
@@ -201,6 +204,10 @@
@decorators.idempotent_id('7a1323b4-a6a2-497a-96cb-76c07b945c71')
def test_reset_network_inject_network_info(self):
"""Test resetting and injecting network info of a server"""
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'The resetNetwork server action is not supported.')
+
# Reset Network of a Server
server = self.create_test_server(wait_until='ACTIVE')
self.client.reset_network(server['id'])
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index 58861a1..9ab75c5 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -28,6 +28,9 @@
flavor = self.flavors_client.show_flavor(self.flavor_ref)['flavor']
flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'],
'name': flavor['name']}
+ # description field is added to the response of list_flavors in 2.55
+ if not self.is_requested_microversion_compatible('2.54'):
+ flavor_min_detail.update({'description': flavor['description']})
self.assertIn(flavor_min_detail, flavors)
@decorators.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')
diff --git a/tempest/api/compute/servers/test_list_servers_negative.py b/tempest/api/compute/servers/test_list_servers_negative.py
index b95db5c..3d55696 100644
--- a/tempest/api/compute/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/servers/test_list_servers_negative.py
@@ -20,6 +20,8 @@
class ListServersNegativeTestJSON(base.BaseV2ComputeTest):
+ """Negative tests of listing servers"""
+
create_default_network = True
@classmethod
@@ -45,7 +47,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('24a26f1a-1ddc-4eea-b0d7-a90cc874ad8f')
def test_list_servers_with_a_deleted_server(self):
- # Verify deleted servers do not show by default in list servers
+ """Test that deleted servers do not show by default in list servers"""
# List servers and verify server not returned
body = self.client.list_servers()
servers = body['servers']
@@ -56,7 +58,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('ff01387d-c7ad-47b4-ae9e-64fa214638fe')
def test_list_servers_by_non_existing_image(self):
- # Listing servers for a non existing image returns empty list
+ """Test listing servers for a non existing image returns empty list"""
body = self.client.list_servers(image='non_existing_image')
servers = body['servers']
self.assertEmpty(servers)
@@ -64,7 +66,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('5913660b-223b-44d4-a651-a0fbfd44ca75')
def test_list_servers_by_non_existing_flavor(self):
- # Listing servers by non existing flavor returns empty list
+ """Test listing servers by non existing flavor returns empty list"""
body = self.client.list_servers(flavor='non_existing_flavor')
servers = body['servers']
self.assertEmpty(servers)
@@ -72,7 +74,12 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('e2c77c4a-000a-4af3-a0bd-629a328bde7c')
def test_list_servers_by_non_existing_server_name(self):
- # Listing servers for a non existent server name returns empty list
+ """Test listing servers for a non existent server name
+
+ Listing servers for a non existent server name should return empty
+ list.
+ """
+
body = self.client.list_servers(name='non_existing_server_name')
servers = body['servers']
self.assertEmpty(servers)
@@ -80,9 +87,13 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('fcdf192d-0f74-4d89-911f-1ec002b822c4')
def test_list_servers_status_non_existing(self):
- # When invalid status is specified, up to microversion 2.37,
- # an empty list is returned, and starting from microversion 2.38,
- # a 400 error is returned in that case.
+ """Test listing servers with non existing status
+
+ When invalid status is specified, up to microversion 2.37,
+ an empty list is returned, and starting from microversion 2.38,
+ a 400 error is returned in that case.
+ """
+
if self.is_requested_microversion_compatible('2.37'):
body = self.client.list_servers(status='non_existing_status')
servers = body['servers']
@@ -94,6 +105,12 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('d47c17fb-eebd-4287-8e95-f20a7e627b18')
def test_list_servers_by_limits_greater_than_actual_count(self):
+ """Test listing servers by limit greater than actual count
+
+ Listing servers by limit greater than actual count should return
+ all servers.
+ """
+
# Gather the complete list of servers in the project for reference
full_list = self.client.list_servers()['servers']
# List servers by specifying a greater value for limit
@@ -104,21 +121,21 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('679bc053-5e70-4514-9800-3dfab1a380a6')
def test_list_servers_by_limits_pass_string(self):
- # Return an error if a string value is passed for limit
+ """Test listing servers by non-integer limit should fail"""
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
limit='testing')
@decorators.attr(type=['negative'])
@decorators.idempotent_id('62610dd9-4713-4ee0-8beb-fd2c1aa7f950')
def test_list_servers_by_limits_pass_negative_value(self):
- # Return an error if a negative value for limit is passed
+ """Test listing servers by negative limit should fail"""
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
limit=-1)
@decorators.attr(type=['negative'])
@decorators.idempotent_id('87d12517-e20a-4c9c-97b6-dd1628d6d6c9')
def test_list_servers_by_changes_since_invalid_date(self):
- # Return an error when invalid date format is passed
+ """Test listing servers by invalid changes-since format should fail"""
params = {'changes-since': '2011/01/01'}
self.assertRaises(lib_exc.BadRequest, self.client.list_servers,
**params)
@@ -126,7 +143,12 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('74745ad8-b346-45b5-b9b8-509d7447fc1f')
def test_list_servers_by_changes_since_future_date(self):
- # Return an empty list when a date in the future is passed.
+ """Test listing servers by a future changes-since date
+
+ Return an empty list when a date in the future is passed as
+ changes-since value.
+ """
+
# updated_at field may haven't been set at the point in the boot
# process where build_request still exists, so add
# {'status': 'ACTIVE'} along with changes-since as filter.
@@ -138,7 +160,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('93055106-2d34-46fe-af68-d9ddbf7ee570')
def test_list_servers_detail_server_is_deleted(self):
- # Server details are not listed for a deleted server
+ """Test listing servers detail should not contain deleted server"""
body = self.client.list_servers(detail=True)
servers = body['servers']
actual = [srv for srv in servers
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index dcadace..10c76bb 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -19,11 +19,15 @@
class MultipleCreateTestJSON(base.BaseV2ComputeTest):
+ """Test creating multiple servers in one request"""
create_default_network = True
@decorators.idempotent_id('61e03386-89c3-449c-9bb1-a06f423fd9d1')
def test_multiple_create(self):
- # Creating server with min_count=2, 2 servers will be created.
+ """Test creating multiple servers in one request
+
+ Creating server with min_count=2, 2 servers will be created.
+ """
tenant_network = self.get_tenant_network()
body, servers = compute.create_test_server(
self.os_primary,
@@ -40,8 +44,12 @@
@decorators.idempotent_id('864777fb-2f1e-44e3-b5b9-3eb6fa84f2f7')
def test_multiple_create_with_reservation_return(self):
- # Creating multiple servers with return_reservation_id=True,
- # reservation_id will be returned.
+ """Test creating multiple servers with return_reservation_id=True
+
+ Creating multiple servers with return_reservation_id=True,
+ reservation_id will be returned.
+ """
+
body = self.create_test_server(wait_until='ACTIVE',
min_count=1,
max_count=2,
diff --git a/tempest/api/compute/servers/test_multiple_create_negative.py b/tempest/api/compute/servers/test_multiple_create_negative.py
index 6bdf83b..3a970dd 100644
--- a/tempest/api/compute/servers/test_multiple_create_negative.py
+++ b/tempest/api/compute/servers/test_multiple_create_negative.py
@@ -19,11 +19,12 @@
class MultipleCreateNegativeTestJSON(base.BaseV2ComputeTest):
+ """Negative tests of creating multiple servers in one request"""
@decorators.attr(type=['negative'])
@decorators.idempotent_id('daf29d8d-e928-4a01-9a8c-b129603f3fc0')
def test_min_count_less_than_one(self):
- # Creating server with min_count=0 should fail.
+ """Test creating server with min_count=0 should fail"""
invalid_min_count = 0
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
min_count=invalid_min_count)
@@ -31,7 +32,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('999aa722-d624-4423-b813-0d1ac9884d7a')
def test_min_count_non_integer(self):
- # Creating server with non-integer min_count should fail.
+ """Test creating server with non-integer min_count should fail"""
invalid_min_count = 2.5
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
min_count=invalid_min_count)
@@ -39,7 +40,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('a6f9c2ab-e060-4b82-b23c-4532cb9390ff')
def test_max_count_less_than_one(self):
- # Creating server with max_count < 1 shoudld fail.
+ """Test creating server with max_count < 1 shoudld fail"""
invalid_max_count = 0
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
max_count=invalid_max_count)
@@ -47,7 +48,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('9c5698d1-d7af-4c80-b971-9d403135eea2')
def test_max_count_non_integer(self):
- # Creating server with non-integer max_count should fail.
+ """Test creating server with non-integer max_count should fail"""
invalid_max_count = 2.5
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
max_count=invalid_max_count)
@@ -55,7 +56,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('476da616-f1ef-4271-a9b1-b9fc87727cdf')
def test_max_count_less_than_min_count(self):
- # Creating server with max_count less than min_count should fail.
+ """Test creating server with max_count < min_count should fail"""
min_count = 3
max_count = 2
self.assertRaises(lib_exc.BadRequest, self.create_test_server,
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index 9d87e1c..9f93e76 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -14,13 +14,26 @@
# under the License.
from tempest.api.compute import base
+from tempest import config
from tempest.lib import decorators
+CONF = config.CONF
+
+# TODO(stephenfin): Remove these tests once the nova Ussuri branch goes EOL
class ServerMetadataTestJSON(base.BaseV2ComputeTest):
+ """Test server metadata"""
+
create_default_network = True
@classmethod
+ def skip_checks(cls):
+ super(ServerMetadataTestJSON, cls).skip_checks()
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise cls.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
+ @classmethod
def setup_clients(cls):
super(ServerMetadataTestJSON, cls).setup_clients()
cls.client = cls.servers_client
@@ -37,7 +50,10 @@
@decorators.idempotent_id('479da087-92b3-4dcf-aeb3-fd293b2d14ce')
def test_list_server_metadata(self):
- # All metadata key/value pairs for a server should be returned
+ """Test listing server metadata
+
+ All metadata key/value pairs for a server should be returned.
+ """
resp_metadata = (self.client.list_server_metadata(self.server['id'])
['metadata'])
@@ -47,7 +63,10 @@
@decorators.idempotent_id('211021f6-21de-4657-a68f-908878cfe251')
def test_set_server_metadata(self):
- # The server's metadata should be replaced with the provided values
+ """Test setting server metadata
+
+ The server's metadata should be replaced with the provided values
+ """
# Create a new set of metadata for the server
req_metadata = {'meta2': 'data2', 'meta3': 'data3'}
self.client.set_server_metadata(self.server['id'], req_metadata)
@@ -60,8 +79,10 @@
@decorators.idempotent_id('344d981e-0c33-4997-8a5d-6c1d803e4134')
def test_update_server_metadata(self):
- # The server's metadata values should be updated to the
- # provided values
+ """Test updating server metadata
+
+ The server's metadata values should be updated to the provided values.
+ """
meta = {'key1': 'alt1', 'key3': 'value3'}
self.client.update_server_metadata(self.server['id'], meta)
@@ -73,8 +94,11 @@
@decorators.idempotent_id('0f58d402-e34a-481d-8af8-b392b17426d9')
def test_update_metadata_empty_body(self):
- # The original metadata should not be lost if empty metadata body is
- # passed
+ """Test updating server metadata to empty values
+
+ The original server metadata should not be lost if empty metadata
+ body is passed.
+ """
meta = {}
self.client.update_server_metadata(self.server['id'], meta)
resp_metadata = (self.client.list_server_metadata(self.server['id'])
@@ -84,15 +108,19 @@
@decorators.idempotent_id('3043c57d-7e0e-49a6-9a96-ad569c265e6a')
def test_get_server_metadata_item(self):
- # The value for a specific metadata key should be returned
+ """Test getting specific server metadata item"""
meta = self.client.show_server_metadata_item(self.server['id'],
'key2')['meta']
self.assertEqual('value2', meta['key2'])
@decorators.idempotent_id('58c02d4f-5c67-40be-8744-d3fa5982eb1c')
def test_set_server_metadata_item(self):
- # The item's value should be updated to the provided value
- # Update the metadata value
+ """Test updating specific server metadata item
+
+ The metadata item's value should be updated to the provided value.
+ """
+
+ # Update the metadata value.
meta = {'nova': 'alt'}
self.client.set_server_metadata_item(self.server['id'], 'nova', meta)
@@ -104,7 +132,10 @@
@decorators.idempotent_id('127642d6-4c7b-4486-b7cd-07265a378658')
def test_delete_server_metadata_item(self):
- # The metadata value/key pair should be deleted from the server
+ """Test deleting server metadata item
+
+ The metadata value/key pair should be deleted from the server.
+ """
self.client.delete_server_metadata_item(self.server['id'], 'key1')
# Verify the metadata item has been removed
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index 5688af1..a697b95 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -14,12 +14,17 @@
# under the License.
from tempest.api.compute import base
+from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
+CONF = config.CONF
+
class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
+ """Negative tests of server metadata"""
+
create_default_network = True
@classmethod
@@ -36,6 +41,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('fe114a8f-3a57-4eff-9ee2-4e14628df049')
def test_server_create_metadata_key_too_long(self):
+ """Test creating server with too long metadata key should fail"""
# Attempt to start a server with a meta-data key that is > 255
# characters
@@ -52,7 +58,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('92431555-4d8b-467c-b95b-b17daa5e57ff')
def test_create_server_metadata_blank_key(self):
- # Blank key should trigger an error.
+ """Test creating server with blank metadata key should fail"""
meta = {'': 'data1'}
self.assertRaises(lib_exc.BadRequest,
self.create_test_server,
@@ -61,6 +67,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('4d9cd7a3-2010-4b41-b8fe-3bbf0b169466')
def test_server_metadata_non_existent_server(self):
+ """Test getting metadata item for a non existent server should fail"""
# GET on a non-existent server should not succeed
non_existent_server_id = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
@@ -71,7 +78,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('f408e78e-3066-4097-9299-3b0182da812e')
def test_list_server_metadata_non_existent_server(self):
- # List metadata on a non-existent server should not succeed
+ """Test listing metadata for a non existent server should fail"""
non_existent_server_id = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
self.client.list_server_metadata,
@@ -80,8 +87,10 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('0025fbd6-a4ba-4cde-b8c2-96805dcfdabc')
def test_wrong_key_passed_in_body(self):
- # Raise BadRequest if key in uri does not match
- # the key passed in body.
+ """Test setting server metadata item with wrong key in body
+
+ Raise BadRequest if key in uri does not match the key passed in body.
+ """
meta = {'testkey': 'testvalue'}
self.assertRaises(lib_exc.BadRequest,
self.client.set_server_metadata_item,
@@ -90,7 +99,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('0df38c2a-3d4e-4db5-98d8-d4d9fa843a12')
def test_set_metadata_non_existent_server(self):
- # Set metadata on a non-existent server should not succeed
+ """Test setting metadata for a non existent server should fail"""
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
non_existent_server_id = data_utils.rand_uuid()
meta = {'meta1': 'data1'}
self.assertRaises(lib_exc.NotFound,
@@ -101,7 +114,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('904b13dc-0ef2-4e4c-91cd-3b4a0f2f49d8')
def test_update_metadata_non_existent_server(self):
- # An update should not happen for a non-existent server
+ """Test updating metadata for a non existent server should fail"""
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
non_existent_server_id = data_utils.rand_uuid()
meta = {'key1': 'value1', 'key2': 'value2'}
self.assertRaises(lib_exc.NotFound,
@@ -112,7 +129,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('a452f38c-05c2-4b47-bd44-a4f0bf5a5e48')
def test_update_metadata_with_blank_key(self):
- # Blank key should trigger an error
+ """Test updating server metadata to blank key should fail"""
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
meta = {'': 'data1'}
self.assertRaises(lib_exc.BadRequest,
self.client.update_server_metadata,
@@ -121,7 +142,14 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('6bbd88e1-f8b3-424d-ba10-ae21c45ada8d')
def test_delete_metadata_non_existent_server(self):
- # Should not be able to delete metadata item from a non-existent server
+ """Test deleting metadata item from a non existent server
+
+ Should not be able to delete metadata item from a non-existent server.
+ """
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
non_existent_server_id = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
self.client.delete_server_metadata_item,
@@ -131,9 +159,15 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('d8c0a210-a5c3-4664-be04-69d96746b547')
def test_metadata_items_limit(self):
- # A 403 Forbidden or 413 Overlimit (old behaviour) exception
- # will be raised while exceeding metadata items limit for
- # tenant.
+ """Test set/update server metadata over limit should fail
+
+ A 403 Forbidden or 413 Overlimit (old behaviour) exception
+ will be raised while exceeding metadata items limit for project.
+ """
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
quota_set = self.quotas_client.show_quota_set(
self.tenant_id)['quota_set']
quota_metadata = quota_set['metadata_items']
@@ -157,8 +191,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('96100343-7fa9-40d8-80fa-d29ef588ce1c')
def test_set_server_metadata_blank_key(self):
- # Raise a bad request error for blank key.
- # set_server_metadata will replace all metadata with new value
+ """Test setting server metadata with blank key should fail"""
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
meta = {'': 'data1'}
self.assertRaises(lib_exc.BadRequest,
self.client.set_server_metadata,
@@ -167,8 +204,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('64a91aee-9723-4863-be44-4c9d9f1e7d0e')
def test_set_server_metadata_missing_metadata(self):
- # Raise a bad request error for a missing metadata field
- # set_server_metadata will replace all metadata with new value
+ """Test setting server metadata without metadata field should fail"""
+ if not CONF.compute_feature_enabled.xenapi_apis:
+ raise self.skipException(
+ 'Metadata is read-only on non-Xen-based deployments.')
+
meta = {'meta1': 'data1'}
self.assertRaises(lib_exc.BadRequest,
self.client.set_server_metadata,
diff --git a/tempest/api/compute/servers/test_server_password.py b/tempest/api/compute/servers/test_server_password.py
index 7b31ede..f61d4fd 100644
--- a/tempest/api/compute/servers/test_server_password.py
+++ b/tempest/api/compute/servers/test_server_password.py
@@ -19,6 +19,8 @@
class ServerPasswordTestJSON(base.BaseV2ComputeTest):
+ """Test server password"""
+
create_default_network = True
@classmethod
@@ -28,8 +30,10 @@
@decorators.idempotent_id('f83b582f-62a8-4f22-85b0-0dee50ff783a')
def test_get_server_password(self):
+ """Test getting password of a server"""
self.servers_client.show_password(self.server['id'])
@decorators.idempotent_id('f8229e8b-b625-4493-800a-bde86ac611ea')
def test_delete_server_password(self):
+ """Test deleting password from a server"""
self.servers_client.delete_password(self.server['id'])
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 3a4bd6d..cc013e3 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -25,6 +25,7 @@
class ServersTestJSON(base.BaseV2ComputeTest):
+ """Test servers API"""
create_default_network = True
@classmethod
@@ -37,8 +38,11 @@
enable_instance_password,
'Instance password not available.')
def test_create_server_with_admin_password(self):
- # If an admin password is provided on server creation, the server's
- # root password should be set to that password.
+ """Test creating server with admin password
+
+ If an admin password is provided on server creation, the server's
+ root password should be set to that password.
+ """
server = self.create_test_server(adminPass='testpassword')
self.addCleanup(self.delete_server, server['id'])
@@ -47,8 +51,7 @@
@decorators.idempotent_id('8fea6be7-065e-47cf-89b8-496e6f96c699')
def test_create_with_existing_server_name(self):
- # Creating a server with a name that already exists is allowed
-
+ """Test creating a server with already existing name is allowed"""
# TODO(sdague): clear out try, we do cleanup one layer up
server_name = data_utils.rand_name(
self.__class__.__name__ + '-server')
@@ -69,8 +72,7 @@
@decorators.idempotent_id('f9e15296-d7f9-4e62-b53f-a04e89160833')
def test_create_specify_keypair(self):
- # Specify a keypair while creating a server
-
+ """Test creating server with keypair"""
key_name = data_utils.rand_name('key')
self.keypairs_client.create_keypair(name=key_name)
self.addCleanup(self.keypairs_client.delete_keypair, key_name)
@@ -97,7 +99,7 @@
@decorators.idempotent_id('5e6ccff8-349d-4852-a8b3-055df7988dd2')
def test_update_server_name(self):
- # The server name should be changed to the provided value
+ """Test updating server name to the provided value"""
server = self.create_test_server(wait_until='ACTIVE')
self.addCleanup(self.delete_server, server['id'])
# Update instance name with non-ASCII characters
@@ -115,7 +117,7 @@
@decorators.idempotent_id('89b90870-bc13-4b73-96af-f9d4f2b70077')
def test_update_access_server_address(self):
- # The server's access addresses should reflect the provided values
+ """Test updating server's access addresses to the provided value"""
server = self.create_test_server(wait_until='ACTIVE')
self.addCleanup(self.delete_server, server['id'])
@@ -132,7 +134,7 @@
@decorators.idempotent_id('38fb1d02-c3c5-41de-91d3-9bc2025a75eb')
def test_create_server_with_ipv6_addr_only(self):
- # Create a server without an IPv4 address(only IPv6 address).
+ """Test creating server with ipv6 address only(no ipv4 address)"""
server = self.create_test_server(accessIPv6='2001:2001::3',
wait_until='ACTIVE')
self.addCleanup(self.delete_server, server['id'])
@@ -142,17 +144,22 @@
@decorators.related_bug('1730756')
@decorators.idempotent_id('defbaca5-d611-49f5-ae21-56ee25d2db49')
def test_create_server_specify_multibyte_character_name(self):
- # prefix character is:
- # http://unicode.org/cldr/utility/character.jsp?a=20A1
+ """Test creating server with multi character name
- # We use a string with 3 byte utf-8 character due to nova
- # will return 400(Bad Request) if we attempt to send a name which has
- # 4 byte utf-8 character.
+ prefix character is:
+ http://unicode.org/cldr/utility/character.jsp?a=20A1
+
+ We use a string with 3 byte utf-8 character due to nova
+ will return 400(Bad Request) if we attempt to send a name which has
+ 4 byte utf-8 character.
+ """
utf8_name = data_utils.rand_name(b'\xe2\x82\xa1'.decode('utf-8'))
self.create_test_server(name=utf8_name, wait_until='ACTIVE')
class ServerShowV247Test(base.BaseV2ComputeTest):
+ """Test servers API with compute microversion greater than 2.46"""
+
min_microversion = '2.47'
max_microversion = 'latest'
@@ -164,12 +171,14 @@
@decorators.idempotent_id('88b0bdb2-494c-11e7-a919-92ebcb67fe33')
def test_show_server(self):
+ """Test getting server detail"""
server = self.create_test_server()
# All fields will be checked by API schema
self.servers_client.show_server(server['id'])
@decorators.idempotent_id('8de397c2-57d0-4b90-aa30-e5d668f21a8b')
def test_update_rebuild_list_server(self):
+ """Test update/rebuild/list server"""
server = self.create_test_server()
# Checking update API response schema
self.servers_client.update_server(server['id'])
@@ -184,6 +193,8 @@
class ServerShowV263Test(base.BaseV2ComputeTest):
+ """Test servers API with compute microversion greater than 2.62"""
+
min_microversion = '2.63'
max_microversion = 'latest'
@@ -195,6 +206,7 @@
'required to test image certificate validation.')
@decorators.idempotent_id('71b8e3d5-11d2-494f-b917-b094a4afed3c')
def test_show_update_rebuild_list_server(self):
+ """Test show/update/rebuild/list server"""
trusted_certs = CONF.compute.certified_image_trusted_certs
server = self.create_test_server(
image_id=CONF.compute.certified_image_ref,
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 6676358..4f85048 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -60,7 +60,8 @@
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
- server = cls.create_test_server()
+ # Wait until the instance is active to avoid the delete racing
+ server = cls.create_test_server(wait_until='ACTIVE')
cls.client.delete_server(server['id'])
waiters.wait_for_server_termination(cls.client, server['id'])
cls.deleted_server_id = server['id']
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index dfd6ca4..b2e02c5 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -28,6 +28,8 @@
# TODO(mriedem): Remove this test class once the nova queens branch goes into
# extended maintenance mode.
class VirtualInterfacesTestJSON(base.BaseV2ComputeTest):
+ """Test virtual interfaces API with compute microversion less than 2.44"""
+
max_microversion = '2.43'
depends_on_nova_network = True
@@ -47,9 +49,7 @@
@decorators.idempotent_id('96c4e2ef-5e4d-4d7f-87f5-fed6dca18016')
@utils.services('network')
def test_list_virtual_interfaces(self):
- # Positive test:Should be able to GET the virtual interfaces list
- # for a given server_id
-
+ """Test listing virtual interfaces of a server"""
if CONF.service_available.neutron:
with testtools.ExpectedException(exceptions.BadRequest):
self.client.list_virtual_interfaces(self.server['id'])
diff --git a/tempest/api/compute/servers/test_virtual_interfaces_negative.py b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
index f6e8bc9..5667281 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces_negative.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
@@ -23,6 +23,12 @@
# TODO(mriedem): Remove this test class once the nova queens branch goes into
# extended maintenance mode.
class VirtualInterfacesNegativeTestJSON(base.BaseV2ComputeTest):
+ """Negative tests of virtual interfaces API
+
+ Negative tests of virtual interfaces API for compute microversion less
+ than 2.44.
+ """
+
max_microversion = '2.43'
depends_on_nova_network = True
@@ -37,8 +43,7 @@
@decorators.idempotent_id('64ebd03c-1089-4306-93fa-60f5eb5c803c')
@utils.services('network')
def test_list_virtual_interfaces_invalid_server_id(self):
- # Negative test: Should not be able to GET virtual interfaces
- # for an invalid server_id
+ """Test listing virtual interfaces of an invalid server should fail"""
invalid_server_id = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
self.servers_client.list_virtual_interfaces,
diff --git a/tempest/api/network/admin/test_floating_ips_admin_actions.py b/tempest/api/network/admin/test_floating_ips_admin_actions.py
index ad7dfb3..a8dae7c 100644
--- a/tempest/api/network/admin/test_floating_ips_admin_actions.py
+++ b/tempest/api/network/admin/test_floating_ips_admin_actions.py
@@ -62,7 +62,7 @@
This test performs below operations:
1. Create couple floating ips for admin and non-admin users.
2. Verify if admin can access all floating ips including other user
- and non-admin user can only access its own floating ips.
+ and non-admin user can only access its own floating ips.
"""
# Create floating ip from admin user
floating_ip_admin = self.admin_floating_ips_client.create_floatingip(
diff --git a/tempest/api/volume/admin/test_backends_capabilities.py b/tempest/api/volume/admin/test_backends_capabilities.py
index 1351704..3c76eca 100644
--- a/tempest/api/volume/admin/test_backends_capabilities.py
+++ b/tempest/api/volume/admin/test_backends_capabilities.py
@@ -20,6 +20,7 @@
class BackendsCapabilitiesAdminTestsJSON(base.BaseVolumeAdminTest):
+ """Test backends capabilities"""
@classmethod
def resource_setup(cls):
@@ -32,14 +33,16 @@
@decorators.idempotent_id('3750af44-5ea2-4cd4-bc3e-56e7e6caf854')
def test_get_capabilities_backend(self):
- # Test backend properties
+ """Test getting backend capabilities"""
# Check response schema
self.admin_capabilities_client.show_backend_capabilities(self.hosts[0])
@decorators.idempotent_id('a9035743-d46a-47c5-9cb7-3c80ea16dea0')
def test_compare_volume_stats_values(self):
- # Test values comparison between show_backend_capabilities
- # to show_pools
+ """Test comparing volume stats values
+
+ Compare volume stats between show_backend_capabilities and show_pools.
+ """
VOLUME_STATS = ('vendor_name',
'volume_backend_name',
'storage_protocol')
diff --git a/tempest/api/volume/admin/test_group_snapshots.py b/tempest/api/volume/admin/test_group_snapshots.py
index c57766e..0a8b56d 100644
--- a/tempest/api/volume/admin/test_group_snapshots.py
+++ b/tempest/api/volume/admin/test_group_snapshots.py
@@ -62,12 +62,26 @@
class GroupSnapshotsTest(BaseGroupSnapshotsTest):
+ """Test group snapshot"""
+
_api_version = 3
min_microversion = '3.14'
max_microversion = 'latest'
@decorators.idempotent_id('1298e537-f1f0-47a3-a1dd-8adec8168897')
def test_group_snapshot_create_show_list_delete(self):
+ """Test create/show/list/delete group snapshot
+
+ 1. Create volume type "volume_type1"
+ 2. Create group type "group_type1"
+ 3. Create group "group1" with "group_type1" and "volume_type1"
+ 4. Create volume "volume1" with "volume_type1" and "group1"
+ 5. Create group snapshot "group_snapshot1" with "group1"
+ 6. Check snapshot created from "volume1" reaches available status
+ 7. Check the created group snapshot "group_snapshot1" is in the list
+ of all group snapshots
+ 8. Delete group snapshot "group_snapshot1"
+ """
# Create volume type
volume_type = self.create_volume_type()
@@ -118,6 +132,18 @@
@decorators.idempotent_id('eff52c70-efc7-45ed-b47a-4ad675d09b81')
def test_create_group_from_group_snapshot(self):
+ """Test creating group from group snapshot
+
+ 1. Create volume type "volume_type1"
+ 2. Create group type "group_type1"
+ 3. Create group "group1" with "group_type1" and "volume_type1"
+ 4. Create volume "volume1" with "volume_type1" and "group1"
+ 5. Create group snapshot "group_snapshot1" with "group1"
+ 6. Check snapshot created from "volume1" reaches available status
+ 7. Create group "group2" from "group_snapshot1"
+ 8. Check the volumes belonging to "group2" reach available status
+ 9. Check "group2" reaches available status
+ """
# Create volume type
volume_type = self.create_volume_type()
@@ -161,6 +187,20 @@
@decorators.idempotent_id('7d7fc000-0b4c-4376-a372-544116d2e127')
@decorators.related_bug('1739031')
def test_delete_group_snapshots_following_updated_volumes(self):
+ """Test deleting group snapshot following updated volumes
+
+ 1. Create volume type "volume_type1"
+ 2. Create group type "group_type1"
+ 3. Create group "group1" with "group_type1" and "volume_type1"
+ 4. Create 2 volumes "volume1" and "volume2"
+ with "volume_type1" and "group1"
+ 5. For each created volume, removing and then adding back to "group1"
+ 6. Create group snapshot "group_snapshot1" with "group1"
+ 7. Check snapshots created from "volume1" and "volume2" reach
+ available status
+ 8. Delete "group_snapshot1"
+ 9. Check snapshots created from "volume1" and "volume2" are deleted
+ """
volume_type = self.create_volume_type()
group_type = self.create_group_type()
@@ -211,6 +251,8 @@
class GroupSnapshotsV319Test(BaseGroupSnapshotsTest):
+ """Test group snapshot with volume microversion greater than 3.18"""
+
_api_version = 3
min_microversion = '3.19'
max_microversion = 'latest'
@@ -218,6 +260,7 @@
@decorators.idempotent_id('3b42c9b9-c984-4444-816e-ca2e1ed30b40')
@decorators.skip_because(bug='1770179')
def test_reset_group_snapshot_status(self):
+ """Test resetting group snapshot status to creating/available/error"""
# Create volume type
volume_type = self.create_volume_type()
diff --git a/tempest/api/volume/admin/test_group_type_specs.py b/tempest/api/volume/admin/test_group_type_specs.py
index c5e6d1a..159c6fb 100644
--- a/tempest/api/volume/admin/test_group_type_specs.py
+++ b/tempest/api/volume/admin/test_group_type_specs.py
@@ -19,12 +19,15 @@
class GroupTypeSpecsTest(base.BaseVolumeAdminTest):
+ """Test group type specs"""
+
_api_version = 3
min_microversion = '3.11'
max_microversion = 'latest'
@decorators.idempotent_id('bb4e30d0-de6e-4f4d-866c-dcc48d023b4e')
def test_group_type_specs_create_show_update_list_delete(self):
+ """Test create/show/update/list/delete group type specs"""
# Create new group type
group_type = self.create_group_type()
diff --git a/tempest/api/volume/admin/test_group_types.py b/tempest/api/volume/admin/test_group_types.py
index 6723207..3993020 100644
--- a/tempest/api/volume/admin/test_group_types.py
+++ b/tempest/api/volume/admin/test_group_types.py
@@ -19,13 +19,15 @@
class GroupTypesTest(base.BaseVolumeAdminTest):
+ """Test group types"""
+
_api_version = 3
min_microversion = '3.11'
max_microversion = 'latest'
@decorators.idempotent_id('dd71e5f9-393e-4d4f-90e9-fa1b8d278864')
def test_group_type_create_list_update_show(self):
- # Create/list/show group type.
+ """Test create/list/update/show group type"""
name = data_utils.rand_name(self.__class__.__name__ + '-group-type')
description = data_utils.rand_name("group-type-description")
group_specs = {"consistent_group_snapshot_enabled": "<is> False"}
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index c5c70d2..a5de987 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -21,6 +21,7 @@
class VolumeMultiBackendTest(base.BaseVolumeAdminTest):
+ """Test volume multi backends"""
@classmethod
def skip_checks(cls):
@@ -78,24 +79,49 @@
@decorators.idempotent_id('c1a41f3f-9dad-493e-9f09-3ff197d477cc')
def test_backend_name_reporting(self):
- # get volume id which created by type without prefix
+ """Test backend name reporting for volume when type is without prefix
+
+ 1. Create volume type, with 'volume_backend_name' as extra spec key
+ 2. Create volume using the created volume type
+ 3. Check 'os-vol-host-attr:host' of the volume info, the value should
+ contain '@' character, like 'cinder@CloveStorage#tecs_backend'
+ """
for volume_id in self.volume_id_list_without_prefix:
self._test_backend_name_reporting_by_volume_id(volume_id)
@decorators.idempotent_id('f38e647f-ab42-4a31-a2e7-ca86a6485215')
def test_backend_name_reporting_with_prefix(self):
- # get volume id which created by type with prefix
+ """Test backend name reporting for volume when type is with prefix
+
+ 1. Create volume type, with 'capabilities:volume_backend_name' as
+ extra spec key
+ 2. Create volume using the created volume type
+ 3. Check 'os-vol-host-attr:host' of the volume info, the value should
+ contain '@' character, like 'cinder@CloveStorage#tecs_backend'
+ """
for volume_id in self.volume_id_list_with_prefix:
self._test_backend_name_reporting_by_volume_id(volume_id)
@decorators.idempotent_id('46435ab1-a0af-4401-8373-f14e66b0dd58')
def test_backend_name_distinction(self):
- # get volume ids which created by type without prefix
+ """Test volume backend distinction when type is without prefix
+
+ 1. For each backend, create volume type with 'volume_backend_name'
+ as extra spec key
+ 2. Create volumes using the created volume types
+ 3. Check 'os-vol-host-attr:host' of each created volume is different.
+ """
self._test_backend_name_distinction(self.volume_id_list_without_prefix)
@decorators.idempotent_id('4236305b-b65a-4bfc-a9d2-69cb5b2bf2ed')
def test_backend_name_distinction_with_prefix(self):
- # get volume ids which created by type without prefix
+ """Test volume backend distinction when type is with prefix
+
+ 1. For each backend, create volume type with
+ 'capabilities:volume_backend_name' as extra spec key
+ 2. Create volumes using the created volume types
+ 3. Check 'os-vol-host-attr:host' of each created volume is different.
+ """
self._test_backend_name_distinction(self.volume_id_list_with_prefix)
def _get_volume_host(self, volume_id):
diff --git a/tempest/api/volume/admin/test_snapshots_actions.py b/tempest/api/volume/admin/test_snapshots_actions.py
index 41849bc..4fca240 100644
--- a/tempest/api/volume/admin/test_snapshots_actions.py
+++ b/tempest/api/volume/admin/test_snapshots_actions.py
@@ -22,6 +22,8 @@
class SnapshotsActionsTest(base.BaseVolumeAdminTest):
+ """Test volume snapshot actions"""
+
@classmethod
def skip_checks(cls):
super(SnapshotsActionsTest, cls).skip_checks()
@@ -65,7 +67,7 @@
@decorators.idempotent_id('3e13ca2f-48ea-49f3-ae1a-488e9180d535')
def test_reset_snapshot_status(self):
- # Reset snapshot status to creating
+ """Test resetting snapshot status to creating"""
status = 'creating'
self.admin_snapshots_client.reset_snapshot_status(
self.snapshot['id'], status)
@@ -74,6 +76,10 @@
@decorators.idempotent_id('41288afd-d463-485e-8f6e-4eea159413eb')
def test_update_snapshot_status(self):
+ """Test updating snapshot
+
+ Update snapshot status to 'error' and progress to '80%'.
+ """
# Reset snapshot status to creating
status = 'creating'
self.admin_snapshots_client.reset_snapshot_status(
@@ -95,20 +101,20 @@
@decorators.idempotent_id('05f711b6-e629-4895-8103-7ca069f2073a')
def test_snapshot_force_delete_when_snapshot_is_creating(self):
- # test force delete when status of snapshot is creating
+ """Test force delete when status of snapshot is creating"""
self._create_reset_and_force_delete_temp_snapshot('creating')
@decorators.idempotent_id('92ce8597-b992-43a1-8868-6316b22a969e')
def test_snapshot_force_delete_when_snapshot_is_deleting(self):
- # test force delete when status of snapshot is deleting
+ """Test force delete when status of snapshot is deleting"""
self._create_reset_and_force_delete_temp_snapshot('deleting')
@decorators.idempotent_id('645a4a67-a1eb-4e8e-a547-600abac1525d')
def test_snapshot_force_delete_when_snapshot_is_error(self):
- # test force delete when status of snapshot is error
+ """Test force delete when status of snapshot is error"""
self._create_reset_and_force_delete_temp_snapshot('error')
@decorators.idempotent_id('bf89080f-8129-465e-9327-b2f922666ba5')
def test_snapshot_force_delete_when_snapshot_is_error_deleting(self):
- # test force delete when status of snapshot is error_deleting
+ """Test force delete when status of snapshot is error_deleting"""
self._create_reset_and_force_delete_temp_snapshot('error_deleting')
diff --git a/tempest/api/volume/admin/test_volume_quota_classes.py b/tempest/api/volume/admin/test_volume_quota_classes.py
index ee52354..f482788 100644
--- a/tempest/api/volume/admin/test_volume_quota_classes.py
+++ b/tempest/api/volume/admin/test_volume_quota_classes.py
@@ -30,6 +30,7 @@
class VolumeQuotaClassesTest(base.BaseVolumeAdminTest):
+ """Test volume quota classes"""
def setUp(self):
# Note(jeremy.zhang): All test cases in this class need to externally
@@ -44,6 +45,7 @@
@decorators.idempotent_id('abb9198e-67d0-4b09-859f-4f4a1418f176')
def test_show_default_quota(self):
+ """Test showing default volume quota class set"""
# response body is validated by schema
default_quotas = self.admin_quota_classes_client.show_quota_class_set(
'default')['quota_class_set']
@@ -51,6 +53,11 @@
@decorators.idempotent_id('a7644c63-2669-467a-b00e-452dd5c5397b')
def test_update_default_quota(self):
+ """Test updating default volume quota class set
+
+ Check current project and new project's default quota are updated
+ to the provided one.
+ """
LOG.debug("Get the current default quota class values")
body = self.admin_quota_classes_client.show_quota_class_set(
'default')['quota_class_set']
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index ecc850e..ebcd3b7 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -23,17 +23,18 @@
class VolumeTypesTest(base.BaseVolumeAdminTest):
+ """Test volume types"""
@decorators.idempotent_id('9d9b28e3-1b2e-4483-a2cc-24aa0ea1de54')
def test_volume_type_list(self):
- # List volume types.
+ """Test listing volume types"""
body = \
self.admin_volume_types_client.list_volume_types()['volume_types']
self.assertIsInstance(body, list)
@decorators.idempotent_id('c03cc62c-f4e9-4623-91ec-64ce2f9c1260')
def test_volume_crud_with_volume_type_and_extra_specs(self):
- # Create/update/get/delete volume with volume_type and extra spec.
+ """Test create/update/get/delete volume with volume_type"""
volume_types = list()
vol_name = data_utils.rand_name(self.__class__.__name__ + '-volume')
proto = CONF.volume.storage_protocol
@@ -80,7 +81,7 @@
@decorators.idempotent_id('4e955c3b-49db-4515-9590-0c99f8e471ad')
def test_volume_type_create_get_delete(self):
- # Create/get volume type.
+ """Test create/get/delete volume type"""
name = data_utils.rand_name(self.__class__.__name__ + '-volume-type')
description = data_utils.rand_name("volume-type-description")
proto = CONF.volume.storage_protocol
@@ -118,7 +119,7 @@
@decorators.idempotent_id('7830abd0-ff99-4793-a265-405684a54d46')
def test_volume_type_encryption_create_get_update_delete(self):
- # Create/get/update/delete encryption type.
+ """Test create/get/update/delete volume encryption type"""
create_kwargs = {'provider': 'LuksEncryptor',
'control_location': 'front-end'}
volume_type_id = self.create_volume_type()['id']
@@ -175,6 +176,7 @@
@decorators.idempotent_id('cf9f07c6-db9e-4462-a243-5933ad65e9c8')
def test_volume_type_update(self):
+ """Test updating volume type details"""
# Create volume type
volume_type = self.create_volume_type()
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
index fe249d6..6b2a278 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
@@ -20,6 +20,7 @@
class ExtraSpecsNegativeTest(base.BaseVolumeAdminTest):
+ """Negative tests of volume type extra specs"""
@classmethod
def resource_setup(cls):
@@ -30,7 +31,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('08961d20-5cbb-4910-ac0f-89ad6dbb2da1')
def test_update_no_body(self):
- # Should not update volume type extra specs with no body
+ """Test updating volume type extra specs with no body should fail"""
self.assertRaises(
lib_exc.BadRequest,
self.admin_volume_types_client.update_volume_type_extra_specs,
@@ -39,7 +40,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('25e5a0ee-89b3-4c53-8310-236f76c75365')
def test_update_nonexistent_extra_spec_id(self):
- # Should not update volume type extra specs with nonexistent id.
+ """Test updating volume type extra specs with non existent name
+
+ Updating volume type extra specs with non existent extra spec name
+ should fail.
+ """
extra_spec = {"spec1": "val2"}
self.assertRaises(
lib_exc.BadRequest,
@@ -50,7 +55,10 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('9bf7a657-b011-4aec-866d-81c496fbe5c8')
def test_update_none_extra_spec_id(self):
- # Should not update volume type extra specs with none id.
+ """Test updating volume type extra specs without name
+
+ Updating volume type extra specs without extra spec name should fail.
+ """
extra_spec = {"spec1": "val2"}
self.assertRaises(
lib_exc.BadRequest,
@@ -60,8 +68,7 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('a77dfda2-9100-448e-9076-ed1711f4bdfc')
def test_update_multiple_extra_spec(self):
- # Should not update volume type extra specs with multiple specs as
- # body.
+ """Test updating multiple volume type extra specs should fail"""
extra_spec = {"spec1": "val2", "spec2": "val1"}
self.assertRaises(
lib_exc.BadRequest,
@@ -72,8 +79,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('49d5472c-a53d-4eab-a4d3-450c4db1c545')
def test_create_nonexistent_type_id(self):
- # Should not create volume type extra spec for nonexistent volume
- # type id.
+ """Test creating volume type extra specs for non existent volume type
+
+ Creating volume type extra specs for non existent volume type should
+ fail.
+ """
extra_specs = {"spec2": "val1"}
self.assertRaises(
lib_exc.NotFound,
@@ -83,7 +93,10 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('c821bdc8-43a4-4bf4-86c8-82f3858d5f7d')
def test_create_none_body(self):
- # Should not create volume type extra spec for none POST body.
+ """Test creating volume type extra spec with none POST body
+
+ Creating volume type extra spec with none POST body should fail.
+ """
self.assertRaises(
lib_exc.BadRequest,
self.admin_volume_types_client.create_volume_type_extra_specs,
@@ -92,7 +105,10 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('bc772c71-1ed4-4716-b945-8b5ed0f15e87')
def test_create_invalid_body(self):
- # Should not create volume type extra spec for invalid POST body.
+ """Test creating volume type extra spec with invalid POST body
+
+ Creating volume type extra spec with invalid POST body should fail.
+ """
self.assertRaises(
lib_exc.BadRequest,
self.admin_volume_types_client.create_volume_type_extra_specs,
@@ -101,8 +117,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('031cda8b-7d23-4246-8bf6-bbe73fd67074')
def test_delete_nonexistent_volume_type_id(self):
- # Should not delete volume type extra spec for nonexistent
- # type id.
+ """Test deleting volume type extra spec for non existent volume type
+
+ Deleting volume type extra spec for non existent volume type should
+ fail.
+ """
self.assertRaises(
lib_exc.NotFound,
self.admin_volume_types_client.delete_volume_type_extra_specs,
@@ -111,7 +130,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('dee5cf0c-cdd6-4353-b70c-e847050d71fb')
def test_list_nonexistent_volume_type_id(self):
- # Should not list volume type extra spec for nonexistent type id.
+ """Test listing volume type extra spec for non existent volume type
+
+ Listing volume type extra spec for non existent volume type should
+ fail.
+ """
self.assertRaises(
lib_exc.NotFound,
self.admin_volume_types_client.list_volume_types_extra_specs,
@@ -120,7 +143,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('9f402cbd-1838-4eb4-9554-126a6b1908c9')
def test_get_nonexistent_volume_type_id(self):
- # Should not get volume type extra spec for nonexistent type id.
+ """Test getting volume type extra spec for non existent volume type
+
+ Getting volume type extra spec for non existent volume type should
+ fail.
+ """
self.assertRaises(
lib_exc.NotFound,
self.admin_volume_types_client.show_volume_type_extra_specs,
@@ -129,8 +156,11 @@
@decorators.attr(type=['negative'])
@decorators.idempotent_id('c881797d-12ff-4f1a-b09d-9f6212159753')
def test_get_nonexistent_extra_spec_name(self):
- # Should not get volume type extra spec for nonexistent extra spec
- # name.
+ """Test getting volume type extra spec for non existent spec name
+
+ Getting volume type extra spec for non existent extra spec name should
+ fail.
+ """
self.assertRaises(
lib_exc.NotFound,
self.admin_volume_types_client.show_volume_type_extra_specs,
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index bd4b3fa..835cc1d 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -26,6 +26,7 @@
class VolumesBackupsAdminTest(base.BaseVolumeAdminTest):
+ """Test volume backups"""
@classmethod
def skip_checks(cls):
@@ -118,6 +119,7 @@
@decorators.idempotent_id('47a35425-a891-4e13-961c-c45deea21e94')
def test_volume_backup_reset_status(self):
+ """Test resetting volume backup status to error"""
# Create a volume
volume = self.create_volume()
# Create a backup
diff --git a/tempest/config.py b/tempest/config.py
index 989b8ef..a632dee 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -598,6 +598,18 @@
help='Does the test environment support attaching a volume to '
'more than one instance? This depends on hypervisor and '
'volume backend/type and compute API version 2.60.'),
+ cfg.BoolOpt('xenapi_apis',
+ default=False,
+ help='Does the test environment support the XenAPI-specific '
+ 'APIs: os-agents, writeable server metadata and the '
+ 'resetNetwork server action? '
+ 'These were removed in Victoria alongside the XenAPI '
+ 'virt driver.',
+ deprecated_for_removal=True,
+ deprecated_reason="On Nova side, XenAPI virt driver and the "
+ "APIs that only worked with that driver "
+ "have been removed and there's nothing to "
+ "test after Ussuri."),
]
diff --git a/tempest/lib/api_schema/response/volume/backups.py b/tempest/lib/api_schema/response/volume/backups.py
index 9e85f5f..cba7981 100644
--- a/tempest/lib/api_schema/response/volume/backups.py
+++ b/tempest/lib/api_schema/response/volume/backups.py
@@ -66,7 +66,7 @@
'properties': {
'id': {'type': 'string', 'format': 'uuid'},
'links': parameter_types.links,
- 'name': {'type': 'string'},
+ 'name': {'type': ['string', 'null']},
# TODO(zhufl): metadata is added in 3.43, we should move it
# to the 3.43 schema file when microversion is supported
# in volume interfaces.
@@ -91,7 +91,7 @@
'properties': {
'id': {'type': 'string', 'format': 'uuid'},
'links': parameter_types.links,
- 'name': {'type': 'string'},
+ 'name': {'type': ['string', 'null']},
'metadata': {'^.+$': {'type': 'string'}}
},
'additionalProperties': False,
diff --git a/tempest/lib/api_schema/response/volume/manage_volume.py b/tempest/lib/api_schema/response/volume/manage_volume.py
new file mode 100644
index 0000000..d3acfd9
--- /dev/null
+++ b/tempest/lib/api_schema/response/volume/manage_volume.py
@@ -0,0 +1,27 @@
+# Copyright 2018 ZTE 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.api_schema.response.volume import volumes
+
+
+manage_volume = {
+ 'status_code': [202],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'volume': volumes.common_show_volume},
+ 'additionalProperties': False,
+ 'required': ['volume']
+ }
+}
diff --git a/tempest/lib/decorators.py b/tempest/lib/decorators.py
index 808e0fb..ebe2d61 100644
--- a/tempest/lib/decorators.py
+++ b/tempest/lib/decorators.py
@@ -124,7 +124,7 @@
def decorator(f):
f = testtools.testcase.attr('id-%s' % id)(f)
if f.__doc__:
- f.__doc__ = 'Test idempotent id: %s\n%s' % (id, f.__doc__)
+ f.__doc__ = 'Test idempotent id: %s\n\n%s' % (id, f.__doc__)
else:
f.__doc__ = 'Test idempotent id: %s' % id
return f
diff --git a/tempest/lib/services/volume/v3/volume_manage_client.py b/tempest/lib/services/volume/v3/volume_manage_client.py
index 85b1b82..f6642c5 100644
--- a/tempest/lib/services/volume/v3/volume_manage_client.py
+++ b/tempest/lib/services/volume/v3/volume_manage_client.py
@@ -15,6 +15,7 @@
from oslo_serialization import jsonutils as json
+from tempest.lib.api_schema.response.volume import manage_volume as schema
from tempest.lib.common import rest_client
@@ -30,6 +31,6 @@
"""
post_body = json.dumps({'volume': kwargs})
resp, body = self.post('os-volume-manage', post_body)
- self.expected_success(202, resp.status)
body = json.loads(body)
+ self.validate_response(schema.manage_volume, resp, body)
return rest_client.ResponseBody(resp, body)
diff --git a/tempest/scenario/test_minbw_allocation_placement.py b/tempest/scenario/test_minbw_allocation_placement.py
index e7085f6..5eab1da 100644
--- a/tempest/scenario/test_minbw_allocation_placement.py
+++ b/tempest/scenario/test_minbw_allocation_placement.py
@@ -124,8 +124,11 @@
resources1='%s:%s' % (self.INGRESS_RESOURCE_CLASS,
self.SMALLEST_POSSIBLE_BW))
if len(alloc_candidates['provider_summaries']) == 0:
- self.fail('No allocation candidates are available for %s:%s' %
- (self.INGRESS_RESOURCE_CLASS, self.SMALLEST_POSSIBLE_BW))
+ # Skip if the backend does not support QoS minimum bandwidth
+ # allocation in Placement API
+ raise self.skipException(
+ 'No allocation candidates are available for %s:%s' %
+ (self.INGRESS_RESOURCE_CLASS, self.SMALLEST_POSSIBLE_BW))
# Just to be sure check with impossible high (placement max_int),
# allocation
diff --git a/tempest/tests/lib/services/volume/v3/test_volume_manage_client.py b/tempest/tests/lib/services/volume/v3/test_volume_manage_client.py
index d4313a2..3d47caf 100644
--- a/tempest/tests/lib/services/volume/v3/test_volume_manage_client.py
+++ b/tempest/tests/lib/services/volume/v3/test_volume_manage_client.py
@@ -54,7 +54,6 @@
}
],
"availability_zone": "nova",
- "os-vol-host-attr:host": "controller1@rbd#rbd",
"encrypted": False,
"updated_at": None,
"replication_status": None,
@@ -62,15 +61,12 @@
"id": "c07cd4a4-b52b-4511-a176-fbaa2011a227",
"size": 0,
"user_id": "142d8663efce464c89811c63e45bd82e",
- "os-vol-tenant-attr:tenant_id": "f21a9c86d7114bf99c711f4874d80474",
- "os-vol-mig-status-attr:migstat": None,
"metadata": {},
"status": "creating",
"description": "volume-manage-description",
"multiattach": False,
"source_volid": None,
"consistencygroup_id": None,
- "os-vol-mig-status-attr:name_id": None,
"name": "volume-managed",
"bootable": "false",
"created_at": "2017-07-11T09:14:01.000000",
diff --git a/tox.ini b/tox.ini
index 0477d6f..031a400 100644
--- a/tox.ini
+++ b/tox.ini
@@ -282,15 +282,31 @@
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
+ sphinx-apidoc -f -o doc/source/tests/compute tempest/api/compute
+ sphinx-apidoc -f -o doc/source/tests/identity tempest/api/identity
+ sphinx-apidoc -f -o doc/source/tests/image tempest/api/image
+ sphinx-apidoc -f -o doc/source/tests/network tempest/api/network
+ sphinx-apidoc -f -o doc/source/tests/object_storage tempest/api/object_storage
+ sphinx-apidoc -f -o doc/source/tests/scenario tempest/scenario
+ sphinx-apidoc -f -o doc/source/tests/volume tempest/api/volume
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
-whitelist_externals = rm
+whitelist_externals =
+ rm
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
whitelist_externals =
+ rm
make
commands =
+ sphinx-apidoc -f -o doc/source/tests/compute tempest/api/compute
+ sphinx-apidoc -f -o doc/source/tests/identity tempest/api/identity
+ sphinx-apidoc -f -o doc/source/tests/image tempest/api/image
+ sphinx-apidoc -f -o doc/source/tests/network tempest/api/network
+ sphinx-apidoc -f -o doc/source/tests/object_storage tempest/api/object_storage
+ sphinx-apidoc -f -o doc/source/tests/scenario tempest/scenario
+ sphinx-apidoc -f -o doc/source/tests/volume tempest/api/volume
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf