Merge "Create image using 'owner' parameter"
diff --git a/.zuul.yaml b/.zuul.yaml
index f2ca000..e8b258d 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -10,17 +10,29 @@
vars:
devstack_services:
tempest: true
+ test_results_stage_name: 'test_results'
+ zuul_copy_output:
+ '{{ devstack_base_dir }}/tempest/etc/tempest.conf': 'logs'
+ '{{ devstack_base_dir }}/tempest/etc/accounts.yaml': 'logs'
+ '{{ devstack_base_dir }}/tempest/tempest.log': 'logs'
+ '{{ stage_dir }}/{{ test_results_stage_name }}.subunit': 'logs'
+ '{{ stage_dir }}/{{ test_results_stage_name }}.html': 'logs'
+ '{{ stage_dir }}/stackviz': 'logs'
+ extensions_to_txt:
+ conf: True
+ log: True
+ yaml: True
+ yml: True
run: playbooks/devstack-tempest.yaml
post-run: playbooks/post-tempest.yaml
- job:
name: tempest-full
parent: devstack-tempest
- # This currently only works on the master branch.
- # NOTE(andreaf) Only run on master for now.
- # The negative lookup is redudant but it's a
- # reminder that we don't want the job running there.
- branches: ^(?!driverfixes/)master$
+ # This currently works from stable/queens on.
+ branches:
+ - master
+ - stable/queens
description: |
Base integration test with Neutron networking and py27.
Former names for this job where:
@@ -34,7 +46,9 @@
- job:
name: tempest-full-py3
parent: devstack-tempest
- branches: ^(?!driverfixes/)master$
+ branches:
+ - master
+ - stable/queens
description: |
Base integration test with Neutron networking and py3.
Former names for this job where:
@@ -54,6 +68,16 @@
c-bak: false
- job:
+ name: tempest-full-queens
+ parent: tempest-full
+ override-checkout: stable/queens
+
+- job:
+ name: tempest-full-queens-py3
+ parent: tempest-full-py3
+ override-checkout: stable/queens
+
+- job:
name: tempest-tox-plugin-sanity-check
parent: tox
description: |
@@ -138,7 +162,31 @@
- ^roles/
- ^.zuul.yaml$
- nova-multiattach
+ - tempest-full-queens:
+ irrelevant-files:
+ - ^(test-|)requirements.txt$
+ - ^.*\.rst$
+ - ^doc/.*$
+ - ^etc/.*$
+ - ^releasenotes/.*$
+ - ^setup.cfg$
+ - ^tempest/hacking/.*$
+ - ^tempest/tests/.*$
+ - tempest-full-queens-py3:
+ irrelevant-files:
+ - ^(test-|)requirements.txt$
+ - ^.*\.rst$
+ - ^doc/.*$
+ - ^etc/.*$
+ - ^releasenotes/.*$
+ - ^setup.cfg$
+ - ^tempest/hacking/.*$
+ - ^tempest/tests/.*$
- tempest-tox-plugin-sanity-check
gate:
jobs:
- nova-multiattach
+ periodic-stable:
+ jobs:
+ - tempest-full-queens
+ - tempest-full-queens-py3
diff --git a/doc/requirements.txt b/doc/requirements.txt
index 555b7d2..597b54e 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -1,6 +1,6 @@
# 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.
-openstackdocstheme>=1.17.0 # Apache-2.0
+openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0
sphinx!=1.6.6,>=1.6.2 # BSD
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 0a061b8..c2ea628 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -64,7 +64,7 @@
# openstackdocstheme options
repository_name = 'openstack/tempest'
bug_project = 'tempest'
-bug_tag = ''
+bug_tag = 'doc'
# Must set this variable to include year, month, day, hours, and minutes.
html_last_updated_fmt = '%Y-%m-%d %H:%M'
diff --git a/playbooks/post-tempest.yaml b/playbooks/post-tempest.yaml
index 70dac09..ab7a1bb 100644
--- a/playbooks/post-tempest.yaml
+++ b/playbooks/post-tempest.yaml
@@ -1,23 +1,7 @@
- hosts: all
become: true
- vars:
- logs_root: "{{ devstack_base_dir|default('/opt/stack') }}"
- test_results_stage_name: 'test_results'
roles:
- role: process-test-results
- test_results_dir: '{{ logs_root }}/tempest'
+ test_results_dir: '{{ devstack_base_dir }}/tempest'
tox_envdir: tempest
- role: process-stackviz
- - role: stage-output
- zuul_copy_output:
- { '{{ logs_root }}/tempest/etc/tempest.conf': 'logs',
- '{{ logs_root }}/tempest/etc/accounts.yaml': 'logs',
- '{{ logs_root }}/tempest/tempest.log': 'logs',
- '{{ stage_dir }}/{{ test_results_stage_name }}.subunit': 'logs',
- '{{ stage_dir }}/{{ test_results_stage_name }}.html': 'logs',
- '{{ stage_dir }}/stackviz': 'logs' }
- extensions_to_txt:
- - conf
- - log
- - yaml
- - yml
diff --git a/releasenotes/notes/add-show-encryption-specs-item-api-to-v2-encryption-types-client-290b421cd4bc0c0e.yaml b/releasenotes/notes/add-show-encryption-specs-item-api-to-v2-encryption-types-client-290b421cd4bc0c0e.yaml
new file mode 100644
index 0000000..9e13afc
--- /dev/null
+++ b/releasenotes/notes/add-show-encryption-specs-item-api-to-v2-encryption-types-client-290b421cd4bc0c0e.yaml
@@ -0,0 +1,6 @@
+---
+features:
+ - |
+ Add show encryption specs item API to v2 encryption_types_client library.
+ This feature enables the possibility to show specific encryption specs for
+ a volume type.
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
new file mode 100644
index 0000000..406e282
--- /dev/null
+++ b/releasenotes/notes/add-show-quota-details-api-to-network-quotas-client-3fffd302cc5d335f.yaml
@@ -0,0 +1,7 @@
+---
+features:
+ - |
+ 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
diff --git a/releasenotes/notes/create-mount-config-drive-to-lib-1a6e912b8afbcc7e.yaml b/releasenotes/notes/create-mount-config-drive-to-lib-1a6e912b8afbcc7e.yaml
new file mode 100644
index 0000000..f92cd78
--- /dev/null
+++ b/releasenotes/notes/create-mount-config-drive-to-lib-1a6e912b8afbcc7e.yaml
@@ -0,0 +1,4 @@
+---
+features:
+ - A function has been added to the common library to allow mounting and
+ unmounting of the config drive consistently.
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index 404fd94..b23c59f 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -17,12 +17,12 @@
from tempest.lib import decorators
-class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest):
+class HypervisorAdminTestBase(base.BaseV2ComputeAdminTest):
"""Tests Hypervisors API that require admin privileges"""
@classmethod
def setup_clients(cls):
- super(HypervisorAdminTestJSON, cls).setup_clients()
+ super(HypervisorAdminTestBase, cls).setup_clients()
cls.client = cls.os_admin.hypervisor_client
def _list_hypervisors(self):
@@ -30,6 +30,10 @@
hypers = self.client.list_hypervisors()['hypervisors']
return hypers
+
+class HypervisorAdminTestJSON(HypervisorAdminTestBase):
+ """Tests Hypervisors API that require admin privileges"""
+
@decorators.idempotent_id('7f0ceacd-c64d-4e96-b8ee-d02943142cc5')
def test_get_hypervisor_list(self):
# List of hypervisor and available hypervisors hostname
@@ -53,17 +57,6 @@
self.assertEqual(details['hypervisor_hostname'],
hypers[0]['hypervisor_hostname'])
- @decorators.idempotent_id('e81bba3f-6215-4e39-a286-d52d2f906862')
- def test_get_hypervisor_show_servers(self):
- # Show instances about the specific hypervisors
- hypers = self._list_hypervisors()
- self.assertNotEmpty(hypers, "No hypervisors found.")
-
- hostname = hypers[0]['hypervisor_hostname']
- hypervisors = (self.client.list_servers_on_hypervisor(hostname)
- ['hypervisors'])
- self.assertNotEmpty(hypervisors)
-
@decorators.idempotent_id('797e4f28-b6e0-454d-a548-80cc77c00816')
def test_get_hypervisor_stats(self):
# Verify the stats of the all hypervisor
@@ -110,6 +103,21 @@
has_valid_uptime,
"None of the hypervisors had a valid uptime: %s" % hypers)
+
+class HypervisorAdminUnderV252Test(HypervisorAdminTestBase):
+ max_microversion = '2.52'
+
+ @decorators.idempotent_id('e81bba3f-6215-4e39-a286-d52d2f906862')
+ def test_get_hypervisor_show_servers(self):
+ # Show instances about the specific hypervisors
+ hypers = self._list_hypervisors()
+ self.assertNotEmpty(hypers, "No hypervisors found.")
+
+ hostname = hypers[0]['hypervisor_hostname']
+ hypervisors = (self.client.list_servers_on_hypervisor(hostname)
+ ['hypervisors'])
+ self.assertNotEmpty(hypervisors)
+
@decorators.idempotent_id('d7e1805b-3b14-4a3b-b6fd-50ec6d9f361f')
def test_search_hypervisor(self):
hypers = self._list_hypervisors()
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index 431e823..0056376 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -19,12 +19,12 @@
from tempest.lib import exceptions as lib_exc
-class HypervisorAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
+class HypervisorAdminNegativeTestBase(base.BaseV2ComputeAdminTest):
"""Tests Hypervisors API that require admin privileges"""
@classmethod
def setup_clients(cls):
- super(HypervisorAdminNegativeTestJSON, cls).setup_clients()
+ super(HypervisorAdminNegativeTestBase, cls).setup_clients()
cls.client = cls.os_admin.hypervisor_client
cls.non_adm_client = cls.hypervisor_client
@@ -33,6 +33,10 @@
hypers = self.client.list_hypervisors()['hypervisors']
return hypers
+
+class HypervisorAdminNegativeTestJSON(HypervisorAdminNegativeTestBase):
+ """Tests Hypervisors API that require admin privileges"""
+
@decorators.attr(type=['negative'])
@decorators.idempotent_id('c136086a-0f67-4b2b-bc61-8482bd68989f')
def test_show_nonexistent_hypervisor(self):
@@ -55,27 +59,6 @@
hypers[0]['id'])
@decorators.attr(type=['negative'])
- @decorators.idempotent_id('2a0a3938-832e-4859-95bf-1c57c236b924')
- def test_show_servers_with_non_admin_user(self):
- hypers = self._list_hypervisors()
- self.assertNotEmpty(hypers)
-
- self.assertRaises(
- lib_exc.Forbidden,
- self.non_adm_client.list_servers_on_hypervisor,
- hypers[0]['id'])
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('02463d69-0ace-4d33-a4a8-93d7883a2bba')
- def test_show_servers_with_nonexistent_hypervisor(self):
- nonexistent_hypervisor_id = data_utils.rand_uuid()
-
- self.assertRaises(
- lib_exc.NotFound,
- self.client.list_servers_on_hypervisor,
- nonexistent_hypervisor_id)
-
- @decorators.attr(type=['negative'])
@decorators.idempotent_id('e2b061bb-13f9-40d8-9d6e-d5bf17595849')
def test_get_hypervisor_stats_with_non_admin_user(self):
self.assertRaises(
@@ -119,13 +102,30 @@
lib_exc.Forbidden,
self.non_adm_client.list_hypervisors, detail=True)
+
+class HypervisorAdminNegativeUnderV252Test(HypervisorAdminNegativeTestBase):
+ max_microversion = '2.52'
+
@decorators.attr(type=['negative'])
- @decorators.idempotent_id('19a45cc1-1000-4055-b6d2-28e8b2ec4faa')
- def test_search_nonexistent_hypervisor(self):
+ @decorators.idempotent_id('2a0a3938-832e-4859-95bf-1c57c236b924')
+ def test_show_servers_with_non_admin_user(self):
+ hypers = self._list_hypervisors()
+ self.assertNotEmpty(hypers)
+
+ self.assertRaises(
+ lib_exc.Forbidden,
+ self.non_adm_client.list_servers_on_hypervisor,
+ hypers[0]['id'])
+
+ @decorators.attr(type=['negative'])
+ @decorators.idempotent_id('02463d69-0ace-4d33-a4a8-93d7883a2bba')
+ def test_show_servers_with_nonexistent_hypervisor(self):
+ nonexistent_hypervisor_id = data_utils.rand_uuid()
+
self.assertRaises(
lib_exc.NotFound,
- self.client.search_hypervisor,
- 'nonexistent_hypervisor_name')
+ self.client.list_servers_on_hypervisor,
+ nonexistent_hypervisor_id)
@decorators.attr(type=['negative'])
@decorators.idempotent_id('5b6a6c79-5dc1-4fa5-9c58-9c8085948e74')
@@ -137,3 +137,11 @@
lib_exc.Forbidden,
self.non_adm_client.search_hypervisor,
hypers[0]['hypervisor_hostname'])
+
+ @decorators.attr(type=['negative'])
+ @decorators.idempotent_id('19a45cc1-1000-4055-b6d2-28e8b2ec4faa')
+ def test_search_nonexistent_hypervisor(self):
+ self.assertRaises(
+ lib_exc.NotFound,
+ self.client.search_hypervisor,
+ 'nonexistent_hypervisor_name')
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index 9e897e3..2398cf1 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -158,14 +158,11 @@
self.attach_volume(server, volume, device='/dev/xvdb')
server = self.admin_servers_client.show_server(server_id)['server']
volume_id1 = server["os-extended-volumes:volumes_attached"][0]["id"]
- self._migrate_server_to(server_id, target_host)
- waiters.wait_for_server_status(self.servers_client,
- server_id, 'ACTIVE')
+ self._live_migrate(server_id, target_host, 'ACTIVE')
server = self.admin_servers_client.show_server(server_id)['server']
volume_id2 = server["os-extended-volumes:volumes_attached"][0]["id"]
- self.assertEqual(target_host, self.get_host_for_server(server_id))
self.assertEqual(volume_id1, volume_id2)
@@ -204,10 +201,7 @@
self._verify_console_interaction(server01_id)
self._verify_console_interaction(server02_id)
- self._migrate_server_to(server01_id, host02_id)
- waiters.wait_for_server_status(self.servers_client,
- server01_id, 'ACTIVE')
- self.assertEqual(host02_id, self.get_host_for_server(server01_id))
+ self._live_migrate(server01_id, host02_id, 'ACTIVE')
self._verify_console_interaction(server01_id)
# At this point, both instances have a valid serial console
# connection, which means the ports got updated.
diff --git a/tempest/api/compute/admin/test_servers_on_multinodes.py b/tempest/api/compute/admin/test_servers_on_multinodes.py
index 2e7b07b..18c974a 100644
--- a/tempest/api/compute/admin/test_servers_on_multinodes.py
+++ b/tempest/api/compute/admin/test_servers_on_multinodes.py
@@ -111,3 +111,37 @@
hostnames = list(hosts.values())
self.assertNotEqual(hostnames[0], hostnames[1],
'Servers are on the same host: %s' % hosts)
+
+ @decorators.idempotent_id('9d2e924a-baf4-11e7-b856-fa163e65f5ce')
+ @testtools.skipUnless(
+ compute.is_scheduler_filter_enabled("ServerGroupAffinityFilter"),
+ 'ServerGroupAffinityFilter is not available.')
+ def test_create_server_with_scheduler_hint_group_affinity(self):
+ """Tests the ServerGroupAffinityFilter
+
+ Creates two servers in an affinity server group and
+ asserts the servers are in the group and on same host.
+ """
+ group_id = self.create_test_server_group(policy=['affinity'])['id']
+ hints = {'group': group_id}
+ reservation_id = self.create_test_server(
+ scheduler_hints=hints, wait_until='ACTIVE', min_count=2,
+ return_reservation_id=True)['reservation_id']
+
+ # Get the servers using the reservation_id.
+ servers = self.servers_client.list_servers(
+ detail=True, reservation_id=reservation_id)['servers']
+ self.assertEqual(2, len(servers))
+
+ # Assert the servers are in the group.
+ server_group = self.server_groups_client.show_server_group(
+ group_id)['server_group']
+ hosts = {}
+ for server in servers:
+ self.assertIn(server['id'], server_group['members'])
+ hosts[server['id']] = self._get_host(server['id'])
+
+ # Assert the servers are on same host.
+ hostnames = hosts.values()
+ self.assertEqual(hostnames[0], hostnames[1],
+ 'Servers are on the different hosts: %s' % hosts)
diff --git a/tempest/api/compute/servers/test_device_tagging.py b/tempest/api/compute/servers/test_device_tagging.py
index d857fcb..43046ca 100644
--- a/tempest/api/compute/servers/test_device_tagging.py
+++ b/tempest/api/compute/servers/test_device_tagging.py
@@ -82,7 +82,9 @@
# 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.
- found_devices = [d['tags'][0] for d in md_dict['devices']]
+ # 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')]
self.assertEqual(set(found_devices), set(['port-1', 'port-2',
'net-1', 'net-2-100',
'net-2-200', 'boot',
@@ -262,25 +264,13 @@
# Verify metadata on config drive
if CONF.compute_feature_enabled.config_drive:
- cmd_blkid = 'blkid -t LABEL=config-2 -o device'
LOG.info('Attempting to verify tagged devices in server %s via '
'the config drive.', server['id'])
- dev_name = self.ssh_client.exec_command(cmd_blkid)
- dev_name = dev_name.rstrip()
- try:
- self.ssh_client.exec_command('sudo mount %s /mnt' % dev_name)
- except exceptions.SSHExecCommandFailed:
- # So the command failed, let's try to know why and print some
- # useful information.
- lsblk = self.ssh_client.exec_command('sudo lsblk --fs --ascii')
- LOG.error("Mounting %s on /mnt failed. Right after the "
- "failure 'lsblk' in the guest reported:\n%s",
- dev_name, lsblk)
- raise
-
+ self.ssh_client.mount_config_drive()
cmd_md = 'sudo cat /mnt/openstack/latest/meta_data.json'
md_json = self.ssh_client.exec_command(cmd_md)
self.verify_device_metadata(md_json)
+ self.ssh_client.unmount_config_drive()
class DeviceTaggingTestV2_42(DeviceTaggingTest):
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index c9ee671..2904976 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -167,6 +167,18 @@
server = self.client.show_server(server['id'])['server']
self.assertEqual('2001:2001::3', server['accessIPv6'])
+ @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
+
+ # 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):
min_microversion = '2.47'
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index ca6b03e..97a1f36 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -18,6 +18,7 @@
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
+from tempest.lib import exceptions
CONF = config.CONF
@@ -115,6 +116,26 @@
domains_list = [d['id'] for d in body]
self.assertNotIn(domain['id'], domains_list)
+ @decorators.idempotent_id('d8d318b7-d1b3-4c37-94c5-3c5ba0b121ea')
+ def test_domain_delete_cascades_content(self):
+ # Create a domain with a user and a group in it
+ domain = self.setup_test_domain()
+ user = self.create_test_user(domain_id=domain['id'])
+ group = self.groups_client.create_group(
+ name=data_utils.rand_name('group'),
+ domain_id=domain['id'])['group']
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ self.groups_client.delete_group, group['id'])
+ # Delete the domain
+ self.delete_domain(domain['id'])
+ # Check the domain, its users and groups are gone
+ self.assertRaises(exceptions.NotFound,
+ self.domains_client.show_domain, domain['id'])
+ self.assertRaises(exceptions.NotFound,
+ self.users_client.show_user, user['id'])
+ self.assertRaises(exceptions.NotFound,
+ self.groups_client.show_group, group['id'])
+
@decorators.idempotent_id('036df86e-bb5d-42c0-a7c2-66b9db3a6046')
def test_create_domain_with_disabled_status(self):
# Create domain with enabled status as false
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 7018f2e..ae7b3e4 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -142,16 +142,17 @@
cls.schemas_client = cls.os_primary.schemas_client
cls.versions_client = cls.os_primary.image_versions_client
- def create_namespace(cls, namespace_name=None, visibility='public',
+ def create_namespace(self, namespace_name=None, visibility='public',
description='Tempest', protected=False,
**kwargs):
if not namespace_name:
namespace_name = data_utils.rand_name('test-ns')
kwargs.setdefault('display_name', namespace_name)
- namespace = cls.namespaces_client.create_namespace(
+ namespace = self.namespaces_client.create_namespace(
namespace=namespace_name, visibility=visibility,
description=description, protected=protected, **kwargs)
- cls.addCleanup(cls.namespaces_client.delete_namespace, namespace_name)
+ self.addCleanup(self.namespaces_client.delete_namespace,
+ namespace_name)
return namespace
diff --git a/tempest/api/image/v2/test_images_metadefs_namespace_tags.py b/tempest/api/image/v2/test_images_metadefs_namespace_tags.py
index 69bebfe..482e808 100644
--- a/tempest/api/image/v2/test_images_metadefs_namespace_tags.py
+++ b/tempest/api/image/v2/test_images_metadefs_namespace_tags.py
@@ -49,7 +49,7 @@
# List namespace tags
body = self.namespace_tags_client.list_namespace_tags(
namespace['namespace'])
- self.assertTrue(3, len(body['tags']))
+ self.assertEqual(3, len(body['tags']))
self.assertIn(body['tags'][0]['name'], self.tag_list)
self.assertIn(body['tags'][1]['name'], self.tag_list)
self.assertIn(body['tags'][2]['name'], self.tag_list)
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
index 57a28bf..b1e4a58 100644
--- a/tempest/api/network/admin/test_quotas.py
+++ b/tempest/api/network/admin/test_quotas.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
from tempest.common import identity
from tempest.common import utils
@@ -89,3 +91,15 @@
def test_quotas(self):
new_quotas = {'network': 0, 'port': 0}
self._check_quotas(new_quotas)
+
+ @testtools.skipUnless(utils.is_extension_enabled(
+ 'quota_details', 'network'), 'Quota details extension not enabled.')
+ @decorators.idempotent_id('7b05ec5f-bf44-43cb-b28f-ddd72a824288')
+ def test_show_quota_details(self):
+ # Show quota details for an existing project
+ quota_details = self.admin_quotas_client.show_quota_details(
+ self.admin_quotas_client.tenant_id)['quota']
+ expected_keys = ['used', 'limit', 'reserved']
+ for resource_type in quota_details:
+ for key in expected_keys:
+ self.assertIn(key, quota_details[resource_type])
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index af1024c..1077524 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -161,6 +161,12 @@
'The fetched encryption_type %s is different '
'from the updated encryption_type' % key)
+ # Get encryption specs item
+ key = 'cipher'
+ item = self.admin_encryption_types_client.show_encryption_specs_item(
+ encrypt_type_id, key)
+ self.assertEqual(update_kwargs[key], item[key])
+
# Delete encryption type
self.admin_encryption_types_client.delete_encryption_type(
encrypt_type_id)
diff --git a/tempest/config.py b/tempest/config.py
index 4b7ace2..340a27e 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -104,6 +104,7 @@
secret=True,
deprecated_group='identity'),
cfg.StrOpt('admin_domain_name',
+ default='Default',
help="Admin domain name for authentication (Keystone V3)."
"The same domain applies to user and project",
deprecated_group='identity'),
diff --git a/tempest/lib/common/utils/linux/remote_client.py b/tempest/lib/common/utils/linux/remote_client.py
index 94fab00..8ac1d38 100644
--- a/tempest/lib/common/utils/linux/remote_client.py
+++ b/tempest/lib/common/utils/linux/remote_client.py
@@ -11,6 +11,7 @@
# under the License.
import functools
+import re
import sys
import netaddr
@@ -126,3 +127,27 @@
cmd = 'sudo {cmd} -I {nic}'.format(cmd=cmd, nic=nic)
cmd += ' -c{0} -w{0} -s{1} {2}'.format(count, size, host)
return self.exec_command(cmd)
+
+ def mount_config_drive(self):
+ """Mount the config drive inside a virtual machine
+
+ This method will not unmount the config drive, so unmount_config_drive
+ must be used for cleanup.
+ """
+ cmd_blkid = 'blkid | grep -i config-2'
+ result = self.exec_command(cmd_blkid)
+ dev_name = re.match('([^:]+)', result).group()
+
+ try:
+ self.exec_command('sudo mount %s /mnt' % dev_name)
+ except tempest.lib.exceptions.SSHExecCommandFailed:
+ # So the command failed, let's try to know why and print some
+ # useful information.
+ lsblk = self.exec_command('sudo lsblk --fs --ascii')
+ LOG.error("Mounting %s on /mnt failed. Right after the "
+ "failure 'lsblk' in the guest reported:\n%s",
+ dev_name, lsblk)
+ raise
+
+ def unmount_config_drive(self):
+ self.exec_command('sudo umount /mnt')
diff --git a/tempest/lib/services/network/quotas_client.py b/tempest/lib/services/network/quotas_client.py
index f23af88..e9666de 100644
--- a/tempest/lib/services/network/quotas_client.py
+++ b/tempest/lib/services/network/quotas_client.py
@@ -46,3 +46,8 @@
"""List default quotas for a project."""
uri = '/quotas/%s/default' % tenant_id
return self.show_resource(uri)
+
+ def show_quota_details(self, tenant_id):
+ """Show quota details for a project."""
+ uri = '/quotas/%s/details.json' % tenant_id
+ return self.show_resource(uri)
diff --git a/tempest/lib/services/volume/v2/encryption_types_client.py b/tempest/lib/services/volume/v2/encryption_types_client.py
index 20f3356..b99d1fe 100644
--- a/tempest/lib/services/volume/v2/encryption_types_client.py
+++ b/tempest/lib/services/volume/v2/encryption_types_client.py
@@ -47,6 +47,14 @@
self.expected_success(200, resp.status)
return rest_client.ResponseBody(resp, body)
+ def show_encryption_specs_item(self, volume_type_id, key):
+ """Get the encryption specs item for the specified volume type."""
+ url = "/types/%s/encryption/%s" % (volume_type_id, key)
+ resp, body = self.get(url)
+ body = json.loads(body)
+ self.expected_success(200, resp.status)
+ return rest_client.ResponseBody(resp, body)
+
def create_encryption_type(self, volume_type_id, **kwargs):
"""Create encryption type.
diff --git a/tempest/lib/services/volume/v3/group_types_client.py b/tempest/lib/services/volume/v3/group_types_client.py
index 1b47201..ecbcba1 100644
--- a/tempest/lib/services/volume/v3/group_types_client.py
+++ b/tempest/lib/services/volume/v3/group_types_client.py
@@ -94,7 +94,7 @@
For a full list of available parameters, please refer to the official
API reference:
- https://developer.openstack.org/api-ref/block-storage/v3/#create-group-specs-for-a-group-type
+ https://developer.openstack.org/api-ref/block-storage/v3/#create-or-update-group-specs-for-a-group-type
"""
url = "group_types/%s/group_specs" % group_type_id
post_body = json.dumps({'group_specs': group_specs})
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 06b4b59..06aa531 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -1174,7 +1174,7 @@
LOG.debug("Creating an encryption type for volume type: %s", type_id)
client.create_encryption_type(
type_id, provider=provider, key_size=key_size, cipher=cipher,
- control_location=control_location)['encryption']
+ control_location=control_location)
def create_encrypted_volume(self, encryption_provider, volume_type,
key_size=256, cipher='aes-xts-plain64',
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 0df26ea..2b35e45 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -127,6 +127,7 @@
floating_ip = self.create_floating_ip(server)
# fetch the server again to make sure the addresses were refreshed
# after associating the floating IP
+ server = self.servers_client.show_server(server['id'])['server']
address = self._get_floating_ip_in_server_addresses(
floating_ip, server)
self.assertIsNotNone(
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index 1be8625..1671216 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -14,7 +14,6 @@
# under the License.
import json
-import re
from tempest.common import utils
from tempest.common import waiters
@@ -94,22 +93,13 @@
result = self.servers_client.show_password(self.instance['id'])
self.assertEqual(data, result['password'])
- def _mount_config_drive(self):
- cmd_blkid = 'blkid | grep -i config-2'
- result = self.ssh_client.exec_command(cmd_blkid)
- dev_name = re.match('([^:]+)', result).group()
- self.ssh_client.exec_command('sudo mount %s /mnt' % dev_name)
-
- def _unmount_config_drive(self):
- self.ssh_client.exec_command('sudo umount /mnt')
-
def verify_metadata_on_config_drive(self):
if self.run_ssh and CONF.compute_feature_enabled.config_drive:
# Verify metadata on config_drive
- self._mount_config_drive()
+ self.ssh_client.mount_config_drive()
cmd_md = 'sudo cat /mnt/openstack/latest/meta_data.json'
result = self.ssh_client.exec_command(cmd_md)
- self._unmount_config_drive()
+ self.ssh_client.unmount_config_drive()
result = json.loads(result)
self.assertIn('meta', result)
msg = ('Failed while verifying metadata on config_drive on server.'
@@ -119,10 +109,10 @@
def verify_networkdata_on_config_drive(self):
if self.run_ssh and CONF.compute_feature_enabled.config_drive:
# Verify network data on config_drive
- self._mount_config_drive()
+ self.ssh_client.mount_config_drive()
cmd_md = 'sudo cat /mnt/openstack/latest/network_data.json'
result = self.ssh_client.exec_command(cmd_md)
- self._unmount_config_drive()
+ self.ssh_client.unmount_config_drive()
result = json.loads(result)
self.assertIn('services', result)
self.assertIn('links', result)
diff --git a/tempest/tests/lib/services/network/test_quotas_client.py b/tempest/tests/lib/services/network/test_quotas_client.py
index 5a09911..aa6c1a1 100644
--- a/tempest/tests/lib/services/network/test_quotas_client.py
+++ b/tempest/tests/lib/services/network/test_quotas_client.py
@@ -54,6 +54,46 @@
FAKE_QUOTA_TENANT_ID = "bab7d5c60cd041a0a36f7c4b6e1dd978"
+ FAKE_QUOTA_DETAILS = {
+ "quota": {
+ "rbac_policy": {
+ "used": 4,
+ "limit": 10,
+ "reserved": 0
+ },
+ "subnetpool": {
+ "used": 2,
+ "limit": -1,
+ "reserved": 0
+ },
+ "security_group_rule": {
+ "used": 10,
+ "limit": 100,
+ "reserved": 1
+ },
+ "security_group": {
+ "used": 3,
+ "limit": 10,
+ "reserved": 0
+ },
+ "subnet": {
+ "used": 3,
+ "limit": 100,
+ "reserved": 0
+ },
+ "port": {
+ "used": 21,
+ "limit": 500,
+ "reserved": 3
+ },
+ "network": {
+ "used": 9,
+ "limit": 100,
+ "reserved": 2
+ }
+ }
+ }
+
def setUp(self):
super(TestQuotasClient, self).setUp()
fake_auth = fake_auth_provider.FakeAuthProvider()
@@ -95,6 +135,15 @@
200,
tenant_id=self.FAKE_QUOTA_TENANT_ID)
+ def _test_show_quota_details(self, bytes_body=False):
+ self.check_service_client_function(
+ self.quotas_client.show_quota_details,
+ "tempest.lib.common.rest_client.RestClient.get",
+ self.FAKE_QUOTA_DETAILS,
+ bytes_body,
+ 200,
+ tenant_id=self.FAKE_QUOTA_TENANT_ID)
+
def test_reset_quotas(self):
self.check_service_client_function(
self.quotas_client.reset_quotas,
@@ -126,3 +175,9 @@
def test_update_quotas_with_bytes_body(self):
self._test_update_quotas(bytes_body=True)
+
+ def test_show_quota_details_with_str_body(self):
+ self._test_show_quota_details()
+
+ def test_show_quota_details_with_bytes_body(self):
+ self._test_show_quota_details(bytes_body=True)
diff --git a/tempest/tests/lib/services/volume/v2/test_encryption_types_client.py b/tempest/tests/lib/services/volume/v2/test_encryption_types_client.py
index d029091..8de9fb4 100644
--- a/tempest/tests/lib/services/volume/v2/test_encryption_types_client.py
+++ b/tempest/tests/lib/services/volume/v2/test_encryption_types_client.py
@@ -43,6 +43,10 @@
}
}
+ FAKE_ENCRYPTION_SPECS_ITEM = {
+ "cipher": "aes-xts-plain64"
+ }
+
def setUp(self):
super(TestEncryptionTypesClient, self).setUp()
fake_auth = fake_auth_provider.FakeAuthProvider()
@@ -65,6 +69,13 @@
self.FAKE_INFO_ENCRYPTION_TYPE,
bytes_body, volume_type_id="cbc36478b0bd8e67e89")
+ def _test_show_encryption_specs_item(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_encryption_specs_item,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_ENCRYPTION_SPECS_ITEM,
+ bytes_body, volume_type_id="cbc36478b0bd8e67e89", key="cipher")
+
def test_create_encryption_type_with_str_body(self):
self._test_create_encryption()
@@ -77,6 +88,12 @@
def test_show_encryption_type_with_bytes_body(self):
self._test_show_encryption_type(bytes_body=True)
+ def test_show_encryption_specs_item_with_str_body(self):
+ self._test_show_encryption_specs_item()
+
+ def test_show_encryption_specs_item_with_bytes_body(self):
+ self._test_show_encryption_specs_item(bytes_body=True)
+
def test_delete_encryption_type(self):
self.check_service_client_function(
self.client.delete_encryption_type,