Merge "Adding a note for test case test_volume_boot_pattern()."
diff --git a/releasenotes/notes/16/16.0.0-add-content-type-without-spaces-b2c9b91b257814f3.yaml b/releasenotes/notes/16/16.0.0-add-content-type-without-spaces-b2c9b91b257814f3.yaml
index fc061bc..9ae46fd 100644
--- a/releasenotes/notes/16/16.0.0-add-content-type-without-spaces-b2c9b91b257814f3.yaml
+++ b/releasenotes/notes/16/16.0.0-add-content-type-without-spaces-b2c9b91b257814f3.yaml
@@ -6,4 +6,4 @@
The lack of these additional content-type will cause defcore test
to fail for OpenStack public cloud which uses tomcat module in the
api gateway. The additions are ``application/json;charset=utf-8``,
- ``text/html;charset=utf-8``,``text/plain;charset=utf-8``
\ No newline at end of file
+ ``text/html;charset=utf-8``, ``text/plain;charset=utf-8``
diff --git a/releasenotes/notes/16/16.0.0-add-tempest-run-combine-option-e94c1049ba8985d5.yaml b/releasenotes/notes/16/16.0.0-add-tempest-run-combine-option-e94c1049ba8985d5.yaml
index 73900ca..e9c3694 100644
--- a/releasenotes/notes/16/16.0.0-add-tempest-run-combine-option-e94c1049ba8985d5.yaml
+++ b/releasenotes/notes/16/16.0.0-add-tempest-run-combine-option-e94c1049ba8985d5.yaml
@@ -1,6 +1,6 @@
---
features:
- |
- Adds a new cli option to tempest run, --combine, which is used to indicate
- you want the subunit stream output combined with the previous run's in
- the testr repository
+ Adds a new cli option to tempest run, ``--combine``, which is used
+ to indicate you want the subunit stream output combined with the
+ previous run's in the testr repository
diff --git a/releasenotes/notes/16/16.0.0-remove-deprecated-allow_port_security_disabled-option-d0ffaeb2e7817707.yaml b/releasenotes/notes/16/16.0.0-remove-deprecated-allow_port_security_disabled-option-d0ffaeb2e7817707.yaml
index 9d7102f..5b4a96d 100644
--- a/releasenotes/notes/16/16.0.0-remove-deprecated-allow_port_security_disabled-option-d0ffaeb2e7817707.yaml
+++ b/releasenotes/notes/16/16.0.0-remove-deprecated-allow_port_security_disabled-option-d0ffaeb2e7817707.yaml
@@ -1,5 +1,5 @@
---
upgrade:
- |
- The deprecated config option 'allow_port_security_disabled' from compute_feature_enabled
- group has been removed.
+ The deprecated config option ``allow_port_security_disabled`` from
+ ``compute_feature_enabled`` group has been removed.
diff --git a/releasenotes/notes/16/16.0.0-remove-deprecated-compute-validation-config-options-part-2-5cd17b6e0e6cb8a3.yaml b/releasenotes/notes/16/16.0.0-remove-deprecated-compute-validation-config-options-part-2-5cd17b6e0e6cb8a3.yaml
index b4e4dd1..c8b0ca8 100644
--- a/releasenotes/notes/16/16.0.0-remove-deprecated-compute-validation-config-options-part-2-5cd17b6e0e6cb8a3.yaml
+++ b/releasenotes/notes/16/16.0.0-remove-deprecated-compute-validation-config-options-part-2-5cd17b6e0e6cb8a3.yaml
@@ -8,4 +8,4 @@
- ``compute.ssh_user`` (available as ``validation.image_ssh_user``)
- ``scenario.ssh_user`` (available as ``validation.image_ssh_user``)
- ``compute.network_for_ssh`` (available as ``validation.network_for_ssh``)
- - ``compute.ping_timeout `` (available as ``validation.ping_timeout``)
+ - ``compute.ping_timeout`` (available as ``validation.ping_timeout``)
diff --git a/releasenotes/notes/add-load-list-cmd-35a4a2e6ea0a36fd.yaml b/releasenotes/notes/add-load-list-cmd-35a4a2e6ea0a36fd.yaml
index 403bbad..145e7dd 100644
--- a/releasenotes/notes/add-load-list-cmd-35a4a2e6ea0a36fd.yaml
+++ b/releasenotes/notes/add-load-list-cmd-35a4a2e6ea0a36fd.yaml
@@ -1,7 +1,7 @@
---
features:
- |
- Adds a new cli option to tempest run, --load-list <list-file>
+ Adds a new cli option to tempest run, ``--load-list <list-file>``
to specify target tests to run from a list-file. The list-file
- supports the output format of the tempest run --list-tests
+ supports the output format of the tempest run ``--list-tests``
command.
diff --git a/releasenotes/notes/add-save-state-option-5ea67858cbaca969.yaml b/releasenotes/notes/add-save-state-option-5ea67858cbaca969.yaml
index 8fdf4f0..abd2610 100644
--- a/releasenotes/notes/add-save-state-option-5ea67858cbaca969.yaml
+++ b/releasenotes/notes/add-save-state-option-5ea67858cbaca969.yaml
@@ -1,4 +1,5 @@
---
features:
- |
- Add --save-state option to allow saving state of cloud before tempest run.
+ Add ``--save-state`` option to allow saving state of cloud before
+ tempest run.
diff --git a/releasenotes/notes/add-show-quota-details-api-to-network-quotas-client-3fffd302cc5d335f.yaml b/releasenotes/notes/add-show-quota-details-api-to-network-quotas-client-3fffd302cc5d335f.yaml
index 406e282..6c44ba0 100644
--- a/releasenotes/notes/add-show-quota-details-api-to-network-quotas-client-3fffd302cc5d335f.yaml
+++ b/releasenotes/notes/add-show-quota-details-api-to-network-quotas-client-3fffd302cc5d335f.yaml
@@ -3,5 +3,5 @@
- |
Add extension API show quota details to network quotas_client library.
This feature enables the possibility to show a quota set for a specified
- project that includes the quota’s used, limit and reserved counts for per
- resource
+ project that includes the quota's used, limit and reserved counts per
+ resource.
diff --git a/releasenotes/notes/cli-tests-v3fixes-fb38189cefd64213.yaml b/releasenotes/notes/cli-tests-v3fixes-fb38189cefd64213.yaml
index e3443c8..2a0a86c 100644
--- a/releasenotes/notes/cli-tests-v3fixes-fb38189cefd64213.yaml
+++ b/releasenotes/notes/cli-tests-v3fixes-fb38189cefd64213.yaml
@@ -2,8 +2,8 @@
other:
- |
The CLIClient class, when it calls a command line client, uses
- --os-project-name instead of --os-tenant-name for the project, and
- passes --os-identity-api-version (default empty).
+ ``--os-project-name`` instead of ``--os-tenant-name`` for the
+ project, and passes ``--os-identity-api-version`` (default empty).
All CLI clients still available in supported releases of OpenStack
- which are wrapped by the cmd_with_auth() method support those
+ which are wrapped by the ``cmd_with_auth()`` method support those
switches.
diff --git a/releasenotes/notes/tempest-run-fix-updates-564b41706decbba1.yaml b/releasenotes/notes/tempest-run-fix-updates-564b41706decbba1.yaml
index 265853d..0f9a0f6 100644
--- a/releasenotes/notes/tempest-run-fix-updates-564b41706decbba1.yaml
+++ b/releasenotes/notes/tempest-run-fix-updates-564b41706decbba1.yaml
@@ -1,8 +1,8 @@
---
features:
- |
- Adds a new CLI arg in tempest run, --black-regex, which is a regex to
- exclude the tests that match it.
+ Adds a new CLI arg in tempest run, ``--black-regex``, which is a
+ regex to exclude the tests that match it.
fixes:
- |
Fixes tempest run CLI args mutually exclusive behavior which should not
diff --git a/releasenotes/notes/tempest-workspace-delete-directory-feature-74d6d157a5a05561.yaml b/releasenotes/notes/tempest-workspace-delete-directory-feature-74d6d157a5a05561.yaml
index ec21098..c69ed50 100644
--- a/releasenotes/notes/tempest-workspace-delete-directory-feature-74d6d157a5a05561.yaml
+++ b/releasenotes/notes/tempest-workspace-delete-directory-feature-74d6d157a5a05561.yaml
@@ -1,5 +1,5 @@
---
features:
- |
- Added tempest workspace remove --name <workspace_name> --rmdir
+ Added tempest workspace remove ``--name <workspace_name> --rmdir``
feature to delete the workspace directory as well as entry.
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index b377c0c..d0c1973 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -108,6 +108,35 @@
raise lib_exc.InvalidConfiguration(
'Either api_v1 or api_v2 must be True in '
'[image-feature-enabled].')
+ cls._check_depends_on_nova_network()
+
+ @classmethod
+ def _check_depends_on_nova_network(cls):
+ # Since nova-network APIs were removed from Nova in the Rocky release,
+ # determine, based on the max version from the version document, if
+ # the compute API is >Queens and if so, skip tests that rely on
+ # nova-network.
+ if not getattr(cls, 'depends_on_nova_network', False):
+ return
+ versions = cls.versions_client.list_versions()['versions']
+ # Find the v2.1 version which will tell us our max version for the
+ # compute API we're testing against.
+ for version in versions:
+ if version['id'] == 'v2.1':
+ max_version = api_version_request.APIVersionRequest(
+ version['version'])
+ break
+ else:
+ LOG.warning(
+ 'Unable to determine max v2.1 compute API version: %s',
+ versions)
+ return
+
+ # The max compute API version in Queens is 2.60 so we cap
+ # at that version.
+ queens = api_version_request.APIVersionRequest('2.60')
+ if max_version > queens:
+ raise cls.skipException('nova-network is gone')
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/compute/servers/test_device_tagging.py b/tempest/api/compute/servers/test_device_tagging.py
index 3a85a86..ff8ed61 100644
--- a/tempest/api/compute/servers/test_device_tagging.py
+++ b/tempest/api/compute/servers/test_device_tagging.py
@@ -13,7 +13,6 @@
# under the License.
import json
-import time
from oslo_log import log as logging
@@ -80,9 +79,11 @@
return True
cmd = 'curl %s' % md_url
md_json = ssh_client.exec_command(cmd)
- verify_method(md_json)
- return True
-
+ return verify_method(md_json)
+ # NOTE(gmann) Keep refreshing the metadata info until the metadata
+ # cache is refreshed. For safer side, we will go with wait loop of
+ # build_interval till build_timeout. verify_method() above will return
+ # True if all metadata verification is done as expected.
if not test_utils.call_until_true(get_and_verify_metadata,
CONF.compute.build_timeout,
CONF.compute.build_interval):
@@ -122,16 +123,20 @@
if d['mac'] == self.net_2_200_mac:
self.assertEqual(d['tags'], ['net-2-200'])
- # A hypervisor may present multiple paths to a tagged disk, so
- # there may be duplicated tags in the metadata, use set() to
- # remove duplicated tags.
- # Some hypervisors might report devices with no tags as well.
- found_devices = [d['tags'][0] for d in md_dict['devices']
- if d.get('tags')]
+ # A hypervisor may present multiple paths to a tagged disk, so
+ # there may be duplicated tags in the metadata, use set() to
+ # remove duplicated tags.
+ # Some hypervisors might report devices with no tags as well.
+ found_devices = [d['tags'][0] for d in md_dict['devices']
+ if d.get('tags')]
+ try:
self.assertEqual(set(found_devices), set(['port-1', 'port-2',
'net-1', 'net-2-100',
'net-2-200', 'boot',
'other']))
+ return True
+ except Exception:
+ return False
@decorators.idempotent_id('a2e65a6c-66f1-4442-aaa8-498c31778d96')
@utils.services('network', 'volume', 'image')
@@ -302,12 +307,21 @@
def verify_device_metadata(self, md_json):
md_dict = json.loads(md_json)
- found_devices = [d['tags'][0] for d in md_dict['devices']]
- self.assertItemsEqual(found_devices, ['nic-tag', 'volume-tag'])
+ found_devices = [d['tags'][0] for d in md_dict['devices']
+ if d.get('tags')]
+ try:
+ self.assertItemsEqual(found_devices, ['nic-tag', 'volume-tag'])
+ return True
+ except Exception:
+ return False
def verify_empty_devices(self, md_json):
md_dict = json.loads(md_json)
- self.assertEmpty(md_dict['devices'])
+ try:
+ self.assertEmpty(md_dict['devices'])
+ return True
+ except Exception:
+ return False
@decorators.idempotent_id('3e41c782-2a89-4922-a9d2-9a188c4e7c7c')
@utils.services('network', 'volume', 'image')
@@ -354,10 +368,6 @@
server=server,
servers_client=self.servers_client)
- # NOTE(artom) The newly attached tagged nic won't appear in the
- # metadata until the cache is refreshed. We wait 16 seconds since the
- # default cache expiry is 15 seconds.
- time.sleep(16)
self.verify_metadata_from_api(server, ssh_client,
self.verify_device_metadata)
@@ -370,7 +380,5 @@
waiters.wait_for_interface_detach(self.interfaces_client,
server['id'],
interface['port_id'])
- # NOTE(artom) More waiting until metadata cache is refreshed.
- time.sleep(16)
self.verify_metadata_from_api(server, ssh_client,
self.verify_empty_devices)
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index 90f04ff..5fb1711 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -25,8 +25,12 @@
CONF = config.CONF
+# TODO(mriedem): Remove this test class once the nova queens branch goes into
+# extended maintenance mode.
class VirtualInterfacesTestJSON(base.BaseV2ComputeTest):
+ depends_on_nova_network = True
+
@classmethod
def setup_credentials(cls):
# This test needs a network and a subnet
@@ -50,8 +54,6 @@
# for a given server_id
if CONF.service_available.neutron:
- # TODO(mriedem): After a microversion implements the API for
- # neutron, a 400 should be a failure for nova-network and neutron.
with testtools.ExpectedException(exceptions.BadRequest):
self.client.list_virtual_interfaces(self.server['id'])
else:
diff --git a/tempest/api/compute/servers/test_virtual_interfaces_negative.py b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
index c4e2400..ec4d7a8 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces_negative.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
@@ -20,8 +20,12 @@
from tempest.lib import exceptions as lib_exc
+# TODO(mriedem): Remove this test class once the nova queens branch goes into
+# extended maintenance mode.
class VirtualInterfacesNegativeTestJSON(base.BaseV2ComputeTest):
+ depends_on_nova_network = True
+
@classmethod
def setup_credentials(cls):
# For this test no network resources are needed
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index 375aacb..35eea11 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -59,9 +59,7 @@
volume = self.create_volume()
# Create backup
backup_name = data_utils.rand_name(self.__class__.__name__ + '-Backup')
- backup = (self.create_backup(backup_client=self.admin_backups_client,
- volume_id=volume['id'],
- name=backup_name))
+ backup = self.create_backup(volume_id=volume['id'], name=backup_name)
self.assertEqual(backup_name, backup['name'])
# Export Backup
@@ -103,17 +101,16 @@
self.assertIn(new_id, [b['id'] for b in backups])
# Restore backup
- restore = self.admin_backups_client.restore_backup(
- backup['id'])['restore']
- self.addCleanup(self.admin_volume_client.delete_volume,
+ restore = self.backups_client.restore_backup(backup['id'])['restore']
+ self.addCleanup(self.volumes_client.delete_volume,
restore['volume_id'])
self.assertEqual(backup['id'], restore['backup_id'])
- waiters.wait_for_volume_resource_status(self.admin_volume_client,
+ waiters.wait_for_volume_resource_status(self.volumes_client,
restore['volume_id'],
'available')
# Verify if restored volume is there in volume list
- volumes = self.admin_volume_client.list_volumes()['volumes']
+ volumes = self.volumes_client.list_volumes()['volumes']
self.assertIn(restore['volume_id'], [v['id'] for v in volumes])
waiters.wait_for_volume_resource_status(self.admin_backups_client,
import_backup['id'],
@@ -126,12 +123,10 @@
# Create a backup
backup_name = data_utils.rand_name(
self.__class__.__name__ + '-Backup')
- backup = self.create_backup(backup_client=self.admin_backups_client,
- volume_id=volume['id'],
- name=backup_name)
+ backup = self.create_backup(volume_id=volume['id'], name=backup_name)
self.assertEqual(backup_name, backup['name'])
# Reset backup status to error
self.admin_backups_client.reset_backup_status(backup_id=backup['id'],
status="error")
- waiters.wait_for_volume_resource_status(self.admin_backups_client,
+ waiters.wait_for_volume_resource_status(self.backups_client,
backup['id'], 'error')
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index 4108da5..75e81b7 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -15,6 +15,7 @@
from tempest.api.volume import base
from tempest.common import waiters
+from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
@@ -43,6 +44,9 @@
transfer = self.client.create_volume_transfer(
volume_id=volume['id'])['transfer']
transfer_id = transfer['id']
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ self.client.delete_volume_transfer,
+ transfer_id)
auth_key = transfer['auth_key']
waiters.wait_for_volume_resource_status(
self.volumes_client, volume['id'], 'awaiting-transfer')
@@ -81,6 +85,9 @@
# Create a volume transfer
transfer_id = self.client.create_volume_transfer(
volume_id=volume['id'])['transfer']['id']
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ self.client.delete_volume_transfer,
+ transfer_id)
waiters.wait_for_volume_resource_status(
self.volumes_client, volume['id'], 'awaiting-transfer')
diff --git a/tempest/clients.py b/tempest/clients.py
index 707127c..2a07be9 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -241,32 +241,32 @@
# if only api_v3 is enabled, all these clients should be available
if (CONF.volume_feature_enabled.api_v2 or
CONF.volume_feature_enabled.api_v3):
- self.backups_v2_client = self.volume_v2.BackupsClient()
+ self.backups_v2_client = self.volume_v3.BackupsClient()
self.encryption_types_v2_client = \
- self.volume_v2.EncryptionTypesClient()
+ self.volume_v3.EncryptionTypesClient()
self.snapshot_manage_v2_client = \
- self.volume_v2.SnapshotManageClient()
- self.snapshots_v2_client = self.volume_v2.SnapshotsClient()
+ self.volume_v3.SnapshotManageClient()
+ self.snapshots_v2_client = self.volume_v3.SnapshotsClient()
self.volume_capabilities_v2_client = \
- self.volume_v2.CapabilitiesClient()
- self.volume_manage_v2_client = self.volume_v2.VolumeManageClient()
- self.volume_qos_v2_client = self.volume_v2.QosSpecsClient()
- self.volume_services_v2_client = self.volume_v2.ServicesClient()
- self.volume_types_v2_client = self.volume_v2.TypesClient()
- self.volume_hosts_v2_client = self.volume_v2.HostsClient()
- self.volume_quotas_v2_client = self.volume_v2.QuotasClient()
+ self.volume_v3.CapabilitiesClient()
+ self.volume_manage_v2_client = self.volume_v3.VolumeManageClient()
+ self.volume_qos_v2_client = self.volume_v3.QosSpecsClient()
+ self.volume_services_v2_client = self.volume_v3.ServicesClient()
+ self.volume_types_v2_client = self.volume_v3.TypesClient()
+ self.volume_hosts_v2_client = self.volume_v3.HostsClient()
+ self.volume_quotas_v2_client = self.volume_v3.QuotasClient()
self.volume_quota_classes_v2_client = \
- self.volume_v2.QuotaClassesClient()
+ self.volume_v3.QuotaClassesClient()
self.volume_scheduler_stats_v2_client = \
- self.volume_v2.SchedulerStatsClient()
+ self.volume_v3.SchedulerStatsClient()
self.volume_transfers_v2_client = \
- self.volume_v2.TransfersClient()
+ self.volume_v3.TransfersClient()
self.volume_v2_availability_zone_client = \
- self.volume_v2.AvailabilityZoneClient()
- self.volume_v2_limits_client = self.volume_v2.LimitsClient()
- self.volumes_v2_client = self.volume_v2.VolumesClient()
+ self.volume_v3.AvailabilityZoneClient()
+ self.volume_v2_limits_client = self.volume_v3.LimitsClient()
+ self.volumes_v2_client = self.volume_v3.VolumesClient()
self.volumes_v2_extension_client = \
- self.volume_v2.ExtensionsClient()
+ self.volume_v3.ExtensionsClient()
# Set default client for users that don't need explicit version
self.volumes_client_latest = self.volumes_v2_client
diff --git a/tempest/lib/services/network/agents_client.py b/tempest/lib/services/network/agents_client.py
index 9bdf090..a0f832e 100644
--- a/tempest/lib/services/network/agents_client.py
+++ b/tempest/lib/services/network/agents_client.py
@@ -18,35 +18,62 @@
class AgentsClient(base.BaseNetworkClient):
def update_agent(self, agent_id, **kwargs):
- """Update agent."""
- # TODO(piyush): Current api-site doesn't contain this API description.
- # After fixing the api-site, we need to fix here also for putting the
- # link to api-site.
- # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1526673
+ """Update an agent.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://developer.openstack.org/api-ref/network/v2/#update-agent
+ """
uri = '/agents/%s' % agent_id
return self.update_resource(uri, kwargs)
def show_agent(self, agent_id, **fields):
+ """Show details for an agent.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://developer.openstack.org/api-ref/network/v2/#show-agent-details
+ """
uri = '/agents/%s' % agent_id
return self.show_resource(uri, **fields)
def list_agents(self, **filters):
+ """List all agents.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://developer.openstack.org/api-ref/network/v2/#list-all-agents
+ """
uri = '/agents'
return self.list_resources(uri, **filters)
def list_routers_on_l3_agent(self, agent_id):
+ """List routers that an l3 agent hosts.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://developer.openstack.org/api-ref/network/v2/#list-routers-hosted-by-an-l3-agent
+ """
uri = '/agents/%s/l3-routers' % agent_id
return self.list_resources(uri)
def create_router_on_l3_agent(self, agent_id, **kwargs):
- # TODO(piyush): Current api-site doesn't contain this API description.
- # After fixing the api-site, we need to fix here also for putting the
- # link to api-site.
- # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1526670
+ """Add a router to an l3 agent.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://developer.openstack.org/api-ref/network/v2/#schedule-router-to-an-l3-agent
+ """
uri = '/agents/%s/l3-routers' % agent_id
return self.create_resource(uri, kwargs, expect_empty_body=True)
def delete_router_from_l3_agent(self, agent_id, router_id):
+ """Remove a router to an l3 agent.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://developer.openstack.org/api-ref/network/v2/#remove-l3-router-from-an-l3-agent
+ """
uri = '/agents/%s/l3-routers/%s' % (agent_id, router_id)
return self.delete_resource(uri)