Merge "Add glance multistore tests"
diff --git a/.zuul.yaml b/.zuul.yaml
index 9c53ba9..5e3f33a 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -13,6 +13,8 @@
roles: &base_roles
- zuul: opendev.org/openstack/devstack
vars: &base_vars
+ # TODO(gmann): Remove these test skip once nova bug #1882521 is solved
+ tempest_black_regex: "(tempest.api.compute.volumes.test_attach_volume.AttachVolumeMultiAttachTest.test_resize_server_with_multiattached_volume|tempest.api.compute.servers.test_server_rescue_negative.ServerRescueNegativeTestJSON|tempest.api.compute.servers.test_server_rescue.ServerStableDeviceRescueTest.test_stable_device_rescue_disk_virtio_with_volume_attached)"
devstack_services:
tempest: true
devstack_local_conf:
@@ -146,7 +148,7 @@
- job:
name: tempest-full-parallel
- parent: tempest-full
+ parent: tempest-full-py3
voting: false
branches:
- master
@@ -159,8 +161,6 @@
tox_envlist: full-parallel
run_tempest_cleanup: true
run_tempest_dry_cleanup: true
- devstack_localrc:
- USE_PYTHON3: True
- job:
name: tempest-full-py3
@@ -218,6 +218,7 @@
- job:
name: tempest-integrated-compute
parent: devstack-tempest
+ nodeset: openstack-single-node-bionic
branches: ^(?!stable/ocata).*$
description: |
This job runs integration tests for compute. This is
@@ -225,6 +226,7 @@
and Glance related tests. This is meant to be run on Nova gate only.
vars:
tox_envlist: integrated-compute
+ tempest_black_regex: ""
devstack_localrc:
USE_PYTHON3: true
FORCE_CONFIG_DRIVE: true
@@ -341,9 +343,28 @@
- job:
name: tempest-multinode-full
parent: tempest-multinode-full-base
+ nodeset: openstack-two-node-focal
+ # This job runs on Focal from stable/victoria on.
+ branches: ^(?!stable/(ocata|pike|queens|rocky|stein|train|ussuri)).*$
+ vars:
+ devstack_localrc:
+ USE_PYTHON3: False
+ group-vars:
+ subnode:
+ devstack_localrc:
+ USE_PYTHON3: False
+
+- job:
+ name: tempest-multinode-full
+ parent: tempest-multinode-full-base
nodeset: openstack-two-node-bionic
- # This job runs on Bionic from stable/stein on.
- branches: ^(?!stable/(ocata|pike|queens|rocky)).*$
+ # This job runs on Bionic and on python2. This is for stable/stein and stable/train.
+ # This job is prepared to make sure all stable branches from stable/stein till stable/train
+ # will keep running on bionic. This can be removed once stable/train is EOL.
+ branches:
+ - stable/stein
+ - stable/train
+ - stable/ussuri
vars:
devstack_localrc:
USE_PYTHON3: False
@@ -454,16 +475,19 @@
- job:
name: tempest-full-ussuri-py3
parent: tempest-full-py3
+ nodeset: openstack-single-node-bionic
override-checkout: stable/ussuri
- job:
name: tempest-full-train-py3
parent: tempest-full-py3
+ nodeset: openstack-single-node-bionic
override-checkout: stable/train
- job:
name: tempest-full-stein-py3
parent: tempest-full-py3
+ nodeset: openstack-single-node-bionic
override-checkout: stable/stein
- job:
@@ -471,7 +495,7 @@
parent: tox
description: |
Run tempest plugin sanity check script using tox.
- nodeset: ubuntu-bionic
+ nodeset: ubuntu-focal
vars:
tox_envlist: plugin-sanity-check
timeout: 5000
diff --git a/releasenotes/notes/add-keystone-ep-clients-eeefd0904fbbe151.yaml b/releasenotes/notes/add-keystone-ep-clients-eeefd0904fbbe151.yaml
new file mode 100644
index 0000000..2b407ae
--- /dev/null
+++ b/releasenotes/notes/add-keystone-ep-clients-eeefd0904fbbe151.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ Added missing client methods for keystone's OS-ENDPOINT-POLICY and
+ OS-EP-FILTER APIs.
diff --git a/releasenotes/notes/add-keystone-v3-ec2-tests-d959b7d36f0bd7fc.yaml b/releasenotes/notes/add-keystone-v3-ec2-tests-d959b7d36f0bd7fc.yaml
new file mode 100644
index 0000000..ab8d748
--- /dev/null
+++ b/releasenotes/notes/add-keystone-v3-ec2-tests-d959b7d36f0bd7fc.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ Added missing clients and tests for keystone's v3 EC2 API which already
+ existed for keystone v2.
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 282343c..5722f0e 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -192,6 +192,7 @@
cls.os_primary.identity_versions_v3_client
cls.non_admin_app_creds_client = \
cls.os_primary.application_credentials_client
+ cls.non_admin_access_rules_client = cls.os_primary.access_rules_client
class BaseIdentityV3AdminTest(BaseIdentityV3Test):
diff --git a/tempest/api/identity/v3/test_access_rules.py b/tempest/api/identity/v3/test_access_rules.py
new file mode 100644
index 0000000..608eb59
--- /dev/null
+++ b/tempest/api/identity/v3/test_access_rules.py
@@ -0,0 +1,84 @@
+# Copyright 2019 SUSE LLC
+#
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest.api.identity 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 AccessRulesV3Test(base.BaseIdentityV3Test):
+
+ @classmethod
+ def skip_checks(cls):
+ super(AccessRulesV3Test, cls).skip_checks()
+ if not CONF.identity_feature_enabled.access_rules:
+ raise cls.skipException("Application credential access rules are "
+ "not available in this environment")
+
+ @classmethod
+ def resource_setup(cls):
+ super(AccessRulesV3Test, cls).resource_setup()
+ cls.user_id = cls.os_primary.credentials.user_id
+ cls.project_id = cls.os_primary.credentials.project_id
+
+ def setUp(self):
+ super(AccessRulesV3Test, self).setUp()
+ ac = self.non_admin_app_creds_client
+ access_rules = [
+ {
+ "path": "/v2.1/servers/*/ips",
+ "method": "GET",
+ "service": "compute"
+ }
+ ]
+ self.app_cred = ac.create_application_credential(
+ self.user_id,
+ name=data_utils.rand_name('application_credential'),
+ access_rules=access_rules
+ )['application_credential']
+
+ @decorators.idempotent_id('2354c498-5119-4ba5-9f0d-44f16f78fb0e')
+ def test_list_access_rules(self):
+ ar = self.non_admin_access_rules_client.list_access_rules(self.user_id)
+ self.assertEqual(1, len(ar['access_rules']))
+
+ @decorators.idempotent_id('795dd507-ca1e-40e9-ba90-ff0a08689ba4')
+ def test_show_access_rule(self):
+ access_rule_id = self.app_cred['access_rules'][0]['id']
+ self.non_admin_access_rules_client.show_access_rule(
+ self.user_id, access_rule_id)
+
+ @decorators.idempotent_id('278757e9-e193-4bf8-adf2-0b0a229a17d0')
+ def test_delete_access_rule(self):
+ access_rule_id = self.app_cred['access_rules'][0]['id']
+ app_cred_id = self.app_cred['id']
+ self.assertRaises(
+ lib_exc.Forbidden,
+ self.non_admin_access_rules_client.delete_access_rule,
+ self.user_id,
+ access_rule_id)
+ self.non_admin_app_creds_client.delete_application_credential(
+ self.user_id, app_cred_id)
+ ar = self.non_admin_access_rules_client.list_access_rules(self.user_id)
+ self.assertEqual(1, len(ar['access_rules']))
+ self.non_admin_access_rules_client.delete_access_rule(
+ self.user_id, access_rule_id)
+ ar = self.non_admin_access_rules_client.list_access_rules(self.user_id)
+ self.assertEqual(0, len(ar['access_rules']))
diff --git a/tempest/api/identity/v3/test_application_credentials.py b/tempest/api/identity/v3/test_application_credentials.py
index ef1bbdf..77ad720 100644
--- a/tempest/api/identity/v3/test_application_credentials.py
+++ b/tempest/api/identity/v3/test_application_credentials.py
@@ -19,8 +19,11 @@
from oslo_utils import timeutils
from tempest.api.identity import base
+from tempest import config
from tempest.lib import decorators
+CONF = config.CONF
+
class ApplicationCredentialsV3Test(base.BaseApplicationCredentialsV3Test):
"""Test application credentials"""
@@ -65,6 +68,24 @@
expires_str = expires_at.isoformat()
self.assertEqual(expires_str, app_cred['expires_at'])
+ @decorators.idempotent_id('529936eb-aa5d-463d-9f79-01c113d3b88f')
+ def test_create_application_credential_access_rules(self):
+ if not CONF.identity_feature_enabled.access_rules:
+ raise self.skipException("Application credential access rules are "
+ "not available in this environment")
+ access_rules = [
+ {
+ "path": "/v2.1/servers/*/ips",
+ "method": "GET",
+ "service": "compute"
+ }
+ ]
+ app_cred = self.create_application_credential(
+ access_rules=access_rules)
+ access_rule_resp = app_cred['access_rules'][0]
+ access_rule_resp.pop('id')
+ self.assertDictEqual(access_rules[0], access_rule_resp)
+
@decorators.idempotent_id('ff0cd457-6224-46e7-b79e-0ada4964a8a6')
def test_list_application_credentials(self):
"""Test listing application credentials"""
diff --git a/tempest/api/identity/v3/test_ec2_credentials.py b/tempest/api/identity/v3/test_ec2_credentials.py
new file mode 100644
index 0000000..a2cbc4a
--- /dev/null
+++ b/tempest/api/identity/v3/test_ec2_credentials.py
@@ -0,0 +1,113 @@
+# Copyright 2020 SUSE LLC
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest.api.identity import base
+from tempest.common import utils
+from tempest.lib import decorators
+from tempest.lib import exceptions as lib_exc
+
+
+class EC2CredentialsTest(base.BaseIdentityV3Test):
+
+ @classmethod
+ def skip_checks(cls):
+ super(EC2CredentialsTest, cls).skip_checks()
+ if not utils.is_extension_enabled('OS-EC2', 'identity'):
+ msg = "OS-EC2 identity extension not enabled."
+ raise cls.skipException(msg)
+
+ @classmethod
+ def resource_setup(cls):
+ super(EC2CredentialsTest, cls).resource_setup()
+ cls.creds = cls.os_primary.credentials
+
+ @decorators.idempotent_id('b0f55a29-54e5-4166-999d-712347e0c920')
+ def test_create_ec2_credential(self):
+ """Create user ec2 credential."""
+ resp = self.non_admin_users_client.create_user_ec2_credential(
+ self.creds.user_id,
+ tenant_id=self.creds.tenant_id)["credential"]
+ access = resp['access']
+ self.addCleanup(
+ self.non_admin_users_client.delete_user_ec2_credential,
+ self.creds.user_id, access)
+ self.assertNotEmpty(resp['access'])
+ self.assertNotEmpty(resp['secret'])
+ self.assertEqual(self.creds.user_id, resp['user_id'])
+ self.assertEqual(self.creds.tenant_id, resp['tenant_id'])
+
+ @decorators.idempotent_id('897813f0-160c-4fdc-aabc-24ee635ce4a9')
+ def test_list_ec2_credentials(self):
+ """Get the list of user ec2 credentials."""
+ created_creds = []
+ # create first ec2 credentials
+ creds1 = self.non_admin_users_client.create_user_ec2_credential(
+ self.creds.user_id,
+ tenant_id=self.creds.tenant_id)["credential"]
+ created_creds.append(creds1['access'])
+ self.addCleanup(
+ self.non_admin_users_client.delete_user_ec2_credential,
+ self.creds.user_id, creds1['access'])
+
+ # create second ec2 credentials
+ creds2 = self.non_admin_users_client.create_user_ec2_credential(
+ self.creds.user_id,
+ tenant_id=self.creds.tenant_id)["credential"]
+ created_creds.append(creds2['access'])
+ self.addCleanup(
+ self.non_admin_users_client.delete_user_ec2_credential,
+ self.creds.user_id, creds2['access'])
+
+ # get the list of user ec2 credentials
+ resp = self.non_admin_users_client.list_user_ec2_credentials(
+ self.creds.user_id)["credentials"]
+ fetched_creds = [cred['access'] for cred in resp]
+ # created credentials should be in a fetched list
+ missing = [cred for cred in created_creds
+ if cred not in fetched_creds]
+ self.assertEmpty(missing,
+ "Failed to find ec2_credentials %s in fetched list" %
+ ', '.join(cred for cred in missing))
+
+ @decorators.idempotent_id('8b8d1010-5958-48df-a6cd-5e3df72e6bcf')
+ def test_show_ec2_credential(self):
+ """Get the definite user ec2 credential."""
+ resp = self.non_admin_users_client.create_user_ec2_credential(
+ self.creds.user_id,
+ tenant_id=self.creds.tenant_id)["credential"]
+ self.addCleanup(
+ self.non_admin_users_client.delete_user_ec2_credential,
+ self.creds.user_id, resp['access'])
+
+ ec2_creds = self.non_admin_users_client.show_user_ec2_credential(
+ self.creds.user_id, resp['access']
+ )["credential"]
+ for key in ['access', 'secret', 'user_id', 'tenant_id']:
+ self.assertEqual(ec2_creds[key], resp[key])
+
+ @decorators.idempotent_id('9408d61b-8be0-4a8d-9b85-14f61edb456b')
+ def test_delete_ec2_credential(self):
+ """Delete user ec2 credential."""
+ resp = self.non_admin_users_client.create_user_ec2_credential(
+ self.creds.user_id,
+ tenant_id=self.creds.tenant_id)["credential"]
+ access = resp['access']
+ self.non_admin_users_client.delete_user_ec2_credential(
+ self.creds.user_id, access)
+ self.assertRaises(
+ lib_exc.NotFound,
+ self.non_admin_users_client.show_user_ec2_credential,
+ self.creds.user_id,
+ access)
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index c5c30e3..da8ad66 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -28,6 +28,7 @@
class AccountTest(base.BaseObjectTest):
+ """Test account metadata and containers"""
credentials = [['operator', CONF.object_storage.operator_role],
['operator_alt', CONF.object_storage.operator_role]]
@@ -54,7 +55,7 @@
@decorators.attr(type='smoke')
@decorators.idempotent_id('3499406a-ae53-4f8c-b43a-133d4dc6fe3f')
def test_list_containers(self):
- # list of all containers should not be empty
+ """Test listing containers"""
resp, container_list = self.account_client.list_account_containers()
self.assertHeaders(resp, 'Account', 'GET')
@@ -66,11 +67,10 @@
@decorators.idempotent_id('884ec421-fbad-4fcc-916b-0580f2699565')
def test_list_no_containers(self):
- # List request to empty account
+ """Test listing containers for an account without container"""
# To test listing no containers, create new user other than
# the base user of this instance.
-
resp, container_list = \
self.os_operator.account_client.list_account_containers()
@@ -103,7 +103,7 @@
@decorators.idempotent_id('1c7efa35-e8a2-4b0b-b5ff-862c7fd83704')
def test_list_containers_with_format_json(self):
- # list containers setting format parameter to 'json'
+ """Test listing containers setting format parameter to 'json'"""
params = {'format': 'json'}
resp, container_list = self.account_client.list_account_containers(
params=params)
@@ -115,7 +115,7 @@
@decorators.idempotent_id('4477b609-1ca6-4d4b-b25d-ad3f01086089')
def test_list_containers_with_format_xml(self):
- # list containers setting format parameter to 'xml'
+ """Test listing containers setting format parameter to 'xml'"""
params = {'format': 'xml'}
resp, container_list = self.account_client.list_account_containers(
params=params)
@@ -133,13 +133,18 @@
not CONF.object_storage_feature_enabled.discoverability,
'Discoverability function is disabled')
def test_list_extensions(self):
+ """Test listing capabilities"""
resp = self.capabilities_client.list_capabilities()
self.assertThat(resp, custom_matchers.AreAllWellFormatted())
@decorators.idempotent_id('5cfa4ab2-4373-48dd-a41f-a532b12b08b2')
def test_list_containers_with_limit(self):
- # list containers one of them, half of them then all of them
+ """Test listing containers with limit parameter
+
+ Listing containers limited to one of them, half of them, and then all
+ of them.
+ """
for limit in (1, self.containers_count // 2,
self.containers_count):
params = {'limit': limit}
@@ -151,10 +156,11 @@
@decorators.idempotent_id('638f876d-6a43-482a-bbb3-0840bca101c6')
def test_list_containers_with_marker(self):
- # list containers using marker param
- # first expect to get 0 container as we specified last
- # the container as marker
- # second expect to get the bottom half of the containers
+ """Test listing containers with marker parameter
+
+ First expect to get 0 container as we specified the last container
+ as marker, second expect to get the bottom half of the containers.
+ """
params = {'marker': self.containers[-1]}
resp, container_list = \
self.account_client.list_account_containers(params=params)
@@ -172,10 +178,11 @@
@decorators.idempotent_id('5ca164e4-7bde-43fa-bafb-913b53b9e786')
def test_list_containers_with_end_marker(self):
- # list containers using end_marker param
- # first expect to get 0 container as we specified first container as
- # end_marker
- # second expect to get the top half of the containers
+ """Test listing containers with end_marker parameter
+
+ First expect to get 0 container as we specified first container as
+ end_marker, second expect to get the top half of the containers
+ """
params = {'end_marker': self.containers[0]}
resp, container_list = \
self.account_client.list_account_containers(params=params)
@@ -190,7 +197,12 @@
@decorators.idempotent_id('ac8502c2-d4e4-4f68-85a6-40befea2ef5e')
def test_list_containers_with_marker_and_end_marker(self):
- # list containers combining marker and end_marker param
+ """Test listing containers with marker and end_marker parameter
+
+ If we use the first container as marker, and the last container as
+ end_marker, then we should get all containers excluding the first one
+ and the last one.
+ """
params = {'marker': self.containers[0],
'end_marker': self.containers[self.containers_count - 1]}
resp, container_list = self.account_client.list_account_containers(
@@ -200,8 +212,10 @@
@decorators.idempotent_id('f7064ae8-dbcc-48da-b594-82feef6ea5af')
def test_list_containers_with_limit_and_marker(self):
- # list containers combining marker and limit param
- # result are always limitated by the limit whatever the marker
+ """Test listing containers combining marker and limit parameter
+
+ Result are always limited by the limit whatever the marker.
+ """
for marker in random.choice(self.containers):
limit = random.randint(0, self.containers_count - 1)
params = {'marker': marker,
@@ -215,6 +229,10 @@
@decorators.idempotent_id('888a3f0e-7214-4806-8e50-5e0c9a69bb5e')
def test_list_containers_with_limit_and_end_marker(self):
+ """Test listing containers combining end_marker and limit parameter
+
+ Result are always limited by the limit whatever the end_marker.
+ """
# list containers combining limit and end_marker param
limit = random.randint(1, self.containers_count)
params = {'limit': limit,
@@ -227,7 +245,11 @@
@decorators.idempotent_id('8cf98d9c-e3a0-4e44-971b-c87656fdddbd')
def test_list_containers_with_limit_and_marker_and_end_marker(self):
- # list containers combining limit, marker and end_marker param
+ """Test listing containers combining marker and end_marker and limit
+
+ Result are always limited by the limit whatever the marker and the
+ end_marker.
+ """
limit = random.randint(1, self.containers_count)
params = {'limit': limit,
'marker': self.containers[0],
@@ -240,7 +262,7 @@
@decorators.idempotent_id('365e6fc7-1cfe-463b-a37c-8bd08d47b6aa')
def test_list_containers_with_prefix(self):
- # list containers that have a name that starts with a prefix
+ """Test listing containers that have a name starting with a prefix"""
prefix = 'tempest-a'
params = {'prefix': prefix}
resp, container_list = self.account_client.list_account_containers(
@@ -252,7 +274,7 @@
@decorators.idempotent_id('b1811cff-d1ed-4c15-a52e-efd8de41cf34')
def test_list_containers_reverse_order(self):
- # list containers in reverse order
+ """Test listing containers in reverse order"""
_, orig_container_list = self.account_client.list_account_containers()
params = {'reverse': True}
@@ -265,8 +287,7 @@
@decorators.attr(type='smoke')
@decorators.idempotent_id('4894c312-6056-4587-8d6f-86ffbf861f80')
def test_list_account_metadata(self):
- # list all account metadata
-
+ """Test listing account metadata"""
# set metadata to account
metadata = {'test-account-meta1': 'Meta1',
'test-account-meta2': 'Meta2'}
@@ -282,14 +303,14 @@
@decorators.idempotent_id('b904c2e3-24c2-4dba-ad7d-04e90a761be5')
def test_list_no_account_metadata(self):
- # list no account metadata
+ """Test listing account metadata for account without metadata"""
resp, _ = self.account_client.list_account_metadata()
self.assertHeaders(resp, 'Account', 'HEAD')
self.assertNotIn('x-account-meta-', str(resp))
@decorators.idempotent_id('e2a08b5f-3115-4768-a3ee-d4287acd6c08')
def test_update_account_metadata_with_create_metadata(self):
- # add metadata to account
+ """Test adding metadata to account"""
metadata = {'test-account-meta1': 'Meta1'}
resp, _ = self.account_client.create_update_or_delete_account_metadata(
create_update_metadata=metadata)
@@ -305,7 +326,7 @@
@decorators.idempotent_id('9f60348d-c46f-4465-ae06-d51dbd470953')
def test_update_account_metadata_with_delete_metadata(self):
- # delete metadata from account
+ """Test deleting metadata from account"""
metadata = {'test-account-meta1': 'Meta1'}
self.account_client.create_update_or_delete_account_metadata(
create_update_metadata=metadata)
@@ -318,8 +339,11 @@
@decorators.idempotent_id('64fd53f3-adbd-4639-af54-436e4982dbfb')
def test_update_account_metadata_with_create_metadata_key(self):
- # if the value of metadata is not set, the metadata is not
- # registered at a server
+ """Test adding metadata to account with empty value
+
+ Adding metadata with empty value to account, the metadata is not
+ registered.
+ """
metadata = {'test-account-meta1': ''}
resp, _ = self.account_client.create_update_or_delete_account_metadata(
create_update_metadata=metadata)
@@ -330,8 +354,11 @@
@decorators.idempotent_id('d4d884d3-4696-4b85-bc98-4f57c4dd2bf1')
def test_update_account_metadata_with_delete_metadata_key(self):
- # Although the value of metadata is not set, the feature of
- # deleting metadata is valid
+ """Test deleting metadata from account with empty value
+
+ Although the value of metadata is not set, the feature of deleting
+ metadata is valid, so the metadata is removed from account.
+ """
metadata_1 = {'test-account-meta1': 'Meta1'}
self.account_client.create_update_or_delete_account_metadata(
create_update_metadata=metadata_1)
@@ -345,7 +372,11 @@
@decorators.idempotent_id('8e5fc073-59b9-42ee-984a-29ed11b2c749')
def test_update_account_metadata_with_create_and_delete_metadata(self):
- # Send a request adding and deleting metadata requests simultaneously
+ """Test adding and deleting metadata simultaneously
+
+ Send a request adding and deleting metadata requests simultaneously,
+ both adding and deleting of metadata will succeed.
+ """
metadata_1 = {'test-account-meta1': 'Meta1'}
self.account_client.create_update_or_delete_account_metadata(
create_update_metadata=metadata_1)
diff --git a/tempest/api/object_storage/test_container_sync.py b/tempest/api/object_storage/test_container_sync.py
index bdcb5ae..c5334a9 100644
--- a/tempest/api/object_storage/test_container_sync.py
+++ b/tempest/api/object_storage/test_container_sync.py
@@ -33,6 +33,8 @@
class ContainerSyncTest(base.BaseObjectTest):
+ """Test container synchronization"""
+
credentials = [['operator', CONF.object_storage.operator_role],
['operator_alt', CONF.object_storage.operator_role]]
@@ -129,6 +131,7 @@
not CONF.object_storage_feature_enabled.container_sync,
'Old-style container sync function is disabled')
def test_container_synchronization(self):
+ """Test container synchronization"""
def make_headers(cont, cont_client):
# tell first container to synchronize to a second
client_proxy_ip = \
diff --git a/tempest/api/object_storage/test_container_sync_middleware.py b/tempest/api/object_storage/test_container_sync_middleware.py
index e77b079..db6cfa4 100644
--- a/tempest/api/object_storage/test_container_sync_middleware.py
+++ b/tempest/api/object_storage/test_container_sync_middleware.py
@@ -27,6 +27,7 @@
class ContainerSyncMiddlewareTest(test_container_sync.ContainerSyncTest):
+ """Test containers synchronization specifying realm and cluster"""
@classmethod
def resource_setup(cls):
@@ -41,6 +42,7 @@
@decorators.idempotent_id('ea4645a1-d147-4976-82f7-e5a7a3065f80')
@utils.requires_ext(extension='container_sync', service='object')
def test_container_synchronization(self):
+ """Test container synchronization specifying realm and cluster"""
def make_headers(cont, cont_client):
# tell first container to synchronize to a second
account_name = cont_client.base_url.split('/')[-1]
diff --git a/tempest/api/object_storage/test_crossdomain.py b/tempest/api/object_storage/test_crossdomain.py
index 1567e06..c611ed6 100644
--- a/tempest/api/object_storage/test_crossdomain.py
+++ b/tempest/api/object_storage/test_crossdomain.py
@@ -19,6 +19,7 @@
class CrossdomainTest(base.BaseObjectTest):
+ """Test crossdomain policy"""
@classmethod
def resource_setup(cls):
@@ -37,6 +38,7 @@
@decorators.idempotent_id('d1b8b031-b622-4010-82f9-ff78a9e915c7')
@utils.requires_ext(extension='crossdomain', service='object')
def test_get_crossdomain_policy(self):
+ """Test getting crossdomain policy"""
url = self.account_client._get_base_version_url() + "crossdomain.xml"
resp, body = self.account_client.raw_request(url, "GET")
self.account_client._error_checker(resp, body)
diff --git a/tempest/api/object_storage/test_object_expiry.py b/tempest/api/object_storage/test_object_expiry.py
index 86f7c8c..6f6e32f 100644
--- a/tempest/api/object_storage/test_object_expiry.py
+++ b/tempest/api/object_storage/test_object_expiry.py
@@ -21,6 +21,8 @@
class ObjectExpiryTest(base.BaseObjectTest):
+ """Test object expiry"""
+
@classmethod
def resource_setup(cls):
super(ObjectExpiryTest, cls).resource_setup()
@@ -83,6 +85,7 @@
@decorators.idempotent_id('fb024a42-37f3-4ba5-9684-4f40a7910b41')
def test_get_object_after_expiry_time(self):
+ """Test object is expired after x-delete-after time"""
# the 10s is important, because the get calls can take 3s each
# some times
metadata = {'X-Delete-After': '10'}
@@ -90,5 +93,6 @@
@decorators.idempotent_id('e592f18d-679c-48fe-9e36-4be5f47102c5')
def test_get_object_at_expiry_time(self):
+ """Test object is expired at x-delete-at time"""
metadata = {'X-Delete-At': str(int(time.time()) + 10)}
self._test_object_expiry(metadata)
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index acb578d..4ecbcad 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -29,6 +29,7 @@
class ObjectTest(base.BaseObjectTest):
+ """Test storage object"""
@classmethod
def resource_setup(cls):
@@ -78,6 +79,7 @@
@decorators.attr(type='smoke')
@decorators.idempotent_id('5b4ce26f-3545-46c9-a2ba-5754358a4c62')
def test_create_object(self):
+ """Test creating object and checking the object's uploaded content"""
# create object
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
@@ -97,7 +99,7 @@
@decorators.idempotent_id('5daebb1d-f0d5-4dc9-b541-69672eff00b0')
def test_create_object_with_content_disposition(self):
- # create object with content_disposition
+ """Test creating object with content-disposition"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata = {}
@@ -119,7 +121,7 @@
@decorators.idempotent_id('605f8317-f945-4bee-ae91-013f1da8f0a0')
def test_create_object_with_content_encoding(self):
- # create object with content_encoding
+ """Test creating object with content-encoding"""
object_name = data_utils.rand_name(name='TestObject')
# put compressed string
@@ -146,7 +148,7 @@
@decorators.idempotent_id('73820093-0503-40b1-a478-edf0e69c7d1f')
def test_create_object_with_etag(self):
- # create object with etag
+ """Test creating object with Etag"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
md5 = hashlib.md5(data).hexdigest()
@@ -165,8 +167,7 @@
@decorators.idempotent_id('84dafe57-9666-4f6d-84c8-0814d37923b8')
def test_create_object_with_expect_continue(self):
- # create object with expect_continue
-
+ """Test creating object with expect_continue"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
@@ -182,7 +183,7 @@
@decorators.idempotent_id('4f84422a-e2f2-4403-b601-726a4220b54e')
def test_create_object_with_transfer_encoding(self):
- # create object with transfer_encoding
+ """Test creating object with transfer_encoding"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes(1024)
headers = {'Transfer-Encoding': 'chunked'}
@@ -202,7 +203,10 @@
@decorators.idempotent_id('0f3d62a6-47e3-4554-b0e5-1a5dc372d501')
def test_create_object_with_x_fresh_metadata(self):
- # create object with x_fresh_metadata
+ """Test creating object with x-fresh-metadata
+
+ The previous added metadata will be cleared.
+ """
object_name_base = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata_1 = {'X-Object-Meta-test-meta': 'Meta'}
@@ -228,7 +232,7 @@
@decorators.idempotent_id('1c7ed3e4-2099-406b-b843-5301d4811baf')
def test_create_object_with_x_object_meta(self):
- # create object with object_meta
+ """Test creating object with x-object-meta"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata = {'X-Object-Meta-test-meta': 'Meta'}
@@ -247,7 +251,7 @@
@decorators.idempotent_id('e4183917-33db-4153-85cc-4dacbb938865')
def test_create_object_with_x_object_metakey(self):
- # create object with the blank value of metadata
+ """Test creating object with the blank value of metadata"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata = {'X-Object-Meta-test-meta': ''}
@@ -266,7 +270,10 @@
@decorators.idempotent_id('ce798afc-b278-45de-a5ce-2ea124b98b99')
def test_create_object_with_x_remove_object_meta(self):
- # create object with x_remove_object_meta
+ """Test creating object with x-remove-object-meta
+
+ The metadata will be removed from the object.
+ """
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata_add = {'X-Object-Meta-test-meta': 'Meta'}
@@ -289,7 +296,11 @@
@decorators.idempotent_id('ad21e342-7916-4f9e-ab62-a1f885f2aaf9')
def test_create_object_with_x_remove_object_metakey(self):
- # create object with the blank value of remove metadata
+ """Test creating object with the blank value of remove metadata
+
+ Creating object with blank metadata 'X-Remove-Object-Meta-test-meta',
+ metadata 'x-object-meta-test-meta' will be removed from the object.
+ """
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata_add = {'X-Object-Meta-test-meta': 'Meta'}
@@ -312,7 +323,7 @@
@decorators.idempotent_id('17738d45-03bd-4d45-9e0b-7b2f58f98687')
def test_delete_object(self):
- # create object
+ """Test deleting object"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
resp, _ = self.object_client.create_object(self.container_name,
@@ -325,7 +336,7 @@
@decorators.attr(type='smoke')
@decorators.idempotent_id('7a94c25d-66e6-434c-9c38-97d4e2c29945')
def test_update_object_metadata(self):
- # update object metadata
+ """Test updating object metadata"""
object_name, _ = self.create_object(self.container_name)
metadata = {'X-Object-Meta-test-meta': 'Meta'}
@@ -343,7 +354,7 @@
@decorators.idempotent_id('48650ed0-c189-4e1e-ad6b-1d4770c6e134')
def test_update_object_metadata_with_remove_metadata(self):
- # update object metadata with remove metadata
+ """Test updating object metadata with remove metadata"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
create_metadata = {'X-Object-Meta-test-meta1': 'Meta1'}
@@ -366,6 +377,11 @@
@decorators.idempotent_id('f726174b-2ded-4708-bff7-729d12ce1f84')
def test_update_object_metadata_with_create_and_remove_metadata(self):
+ """Test updating object with creation and deletion of metadata
+
+ Update object with creation and deletion of metadata with one
+ request, both operations will succeed.
+ """
# creation and deletion of metadata with one request
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
@@ -392,8 +408,7 @@
@decorators.idempotent_id('08854588-6449-4bb7-8cca-f2e1040f5e6f')
def test_update_object_metadata_with_x_object_manifest(self):
- # update object metadata with x_object_manifest
-
+ """Test updating object metadata with x_object_manifest"""
# uploading segments
object_name, _ = self._upload_segments()
# creating a manifest file
@@ -418,7 +433,7 @@
@decorators.idempotent_id('0dbbe89c-6811-4d84-a2df-eca2bdd40c0e')
def test_update_object_metadata_with_x_object_metakey(self):
- # update object metadata with a blank value of metadata
+ """Test updating object metadata with a blank value of metadata"""
object_name, _ = self.create_object(self.container_name)
update_metadata = {'X-Object-Meta-test-meta': ''}
@@ -436,7 +451,7 @@
@decorators.idempotent_id('9a88dca4-b684-425b-806f-306cd0e57e42')
def test_update_object_metadata_with_x_remove_object_metakey(self):
- # update object metadata with a blank value of remove metadata
+ """Test updating object metadata with blank remove metadata value"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.arbitrary_string()
create_metadata = {'X-Object-Meta-test-meta': 'Meta'}
@@ -460,7 +475,7 @@
@decorators.attr(type='smoke')
@decorators.idempotent_id('9a447cf6-de06-48de-8226-a8c6ed31caf2')
def test_list_object_metadata(self):
- # get object metadata
+ """Test listing object metadata"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata = {'X-Object-Meta-test-meta': 'Meta'}
@@ -478,7 +493,7 @@
@decorators.idempotent_id('170fb90e-f5c3-4b1f-ae1b-a18810821172')
def test_list_no_object_metadata(self):
- # get empty list of object metadata
+ """Test listing object metadata for object without metadata"""
object_name, _ = self.create_object(self.container_name)
resp, _ = self.object_client.list_object_metadata(
@@ -489,8 +504,7 @@
@decorators.idempotent_id('23a3674c-d6de-46c3-86af-ff92bfc8a3da')
def test_list_object_metadata_with_x_object_manifest(self):
- # get object metadata with x_object_manifest
-
+ """Test getting object metadata with x_object_manifest"""
# uploading segments
object_name, _ = self._upload_segments()
# creating a manifest file
@@ -530,7 +544,7 @@
@decorators.attr(type='smoke')
@decorators.idempotent_id('02610ba7-86b7-4272-9ed8-aa8d417cb3cd')
def test_get_object(self):
- # retrieve object's data (in response body)
+ """Test retrieving object's data (in response body)"""
# create object
object_name, data = self.create_object(self.container_name)
@@ -543,7 +557,7 @@
@decorators.idempotent_id('005f9bf6-e06d-41ec-968e-96c78e0b1d82')
def test_get_object_with_metadata(self):
- # get object with metadata
+ """Test getting object with metadata"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
metadata = {'X-Object-Meta-test-meta': 'Meta'}
@@ -562,7 +576,7 @@
@decorators.idempotent_id('05a1890e-7db9-4a6c-90a8-ce998a2bddfa')
def test_get_object_with_range(self):
- # get object with range
+ """Test getting object with range"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes(100)
self.object_client.create_object(self.container_name,
@@ -580,7 +594,7 @@
@decorators.idempotent_id('11b4515b-7ba7-4ca8-8838-357ded86fc10')
def test_get_object_with_x_object_manifest(self):
- # get object with x_object_manifest
+ """Test getting object with x_object_manifest"""
# uploading segments
object_name, data_segments = self._upload_segments()
@@ -623,7 +637,7 @@
@decorators.idempotent_id('c05b4013-e4de-47af-be84-e598062b16fc')
def test_get_object_with_if_match(self):
- # get object with if_match
+ """Test getting object with if_match"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes(10)
create_md5 = hashlib.md5(data).hexdigest()
@@ -643,7 +657,7 @@
@decorators.idempotent_id('be133639-e5d2-4313-9b1f-2d59fc054a16')
def test_get_object_with_if_modified_since(self):
- # get object with if_modified_since
+ """Test getting object with if_modified_since"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
time_now = time.time()
@@ -663,7 +677,7 @@
@decorators.idempotent_id('641500d5-1612-4042-a04d-01fc4528bc30')
def test_get_object_with_if_none_match(self):
- # get object with if_none_match
+ """Test getting object with if_none_match"""
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.random_bytes()
create_md5 = hashlib.md5(data).hexdigest()
@@ -685,7 +699,7 @@
@decorators.idempotent_id('0aa1201c-10aa-467a-bee7-63cbdd463152')
def test_get_object_with_if_unmodified_since(self):
- # get object with if_unmodified_since
+ """Test getting object with if_unmodified_since"""
object_name, data = self.create_object(self.container_name)
time_now = time.time()
@@ -700,7 +714,7 @@
@decorators.idempotent_id('94587078-475f-48f9-a40f-389c246e31cd')
def test_get_object_with_x_newest(self):
- # get object with x_newest
+ """Test getting object with x_newest"""
object_name, data = self.create_object(self.container_name)
list_metadata = {'X-Newest': 'true'}
@@ -713,6 +727,7 @@
@decorators.idempotent_id('1a9ab572-1b66-4981-8c21-416e2a5e6011')
def test_copy_object_in_same_container(self):
+ """Test copying object to another object in same container"""
# create source object
src_object_name = data_utils.rand_name(name='SrcObject')
src_data = data_utils.random_bytes(size=len(src_object_name) * 2)
@@ -742,7 +757,7 @@
@decorators.idempotent_id('2248abba-415d-410b-9c30-22dff9cd6e67')
def test_copy_object_to_itself(self):
- # change the content type of an existing object
+ """Test changing the content type of an existing object"""
# create object
object_name, _ = self.create_object(self.container_name)
@@ -769,6 +784,7 @@
@decorators.idempotent_id('06f90388-2d0e-40aa-934c-e9a8833e958a')
def test_copy_object_2d_way(self):
+ """Test copying object's data to the new object using COPY"""
# create source object
src_object_name = data_utils.rand_name(name='SrcObject')
src_data = data_utils.random_bytes(size=len(src_object_name) * 2)
@@ -793,6 +809,7 @@
@decorators.idempotent_id('aa467252-44f3-472a-b5ae-5b57c3c9c147')
def test_copy_object_across_containers(self):
+ """Test copying object to another container"""
# create a container to use as a source container
src_container_name = data_utils.rand_name(name='TestSourceContainer')
self.container_client.update_container(src_container_name)
@@ -837,6 +854,7 @@
@decorators.idempotent_id('5a9e2cc6-85b6-46fc-916d-0cbb7a88e5fd')
def test_copy_object_with_x_fresh_metadata(self):
+ """Test copying objectwith x_fresh_metadata"""
# create source object
metadata = {'x-object-meta-src': 'src_value'}
src_object_name, data = self.create_object(self.container_name,
@@ -858,6 +876,7 @@
@decorators.idempotent_id('a28a8b99-e701-4d7e-9d84-3b66f121460b')
def test_copy_object_with_x_object_metakey(self):
+ """Test copying object with x_object_metakey"""
# create source object
metadata = {'x-object-meta-src': 'src_value'}
src_obj_name, data = self.create_object(self.container_name,
@@ -881,6 +900,7 @@
@decorators.idempotent_id('edabedca-24c3-4322-9b70-d6d9f942a074')
def test_copy_object_with_x_object_meta(self):
+ """Test copying object with x_object_meta"""
# create source object
metadata = {'x-object-meta-src': 'src_value'}
src_obj_name, data = self.create_object(self.container_name,
@@ -904,6 +924,7 @@
@decorators.idempotent_id('e3e6a64a-9f50-4955-b987-6ce6767c97fb')
def test_object_upload_in_segments(self):
+ """Test uploading object in segments"""
# create object
object_name = data_utils.rand_name(name='LObject')
data = data_utils.arbitrary_string()
@@ -947,10 +968,13 @@
@decorators.idempotent_id('50d01f12-526f-4360-9ac2-75dd508d7b68')
def test_get_object_if_different(self):
- # http://en.wikipedia.org/wiki/HTTP_ETag
- # Make a conditional request for an object using the If-None-Match
- # header, it should get downloaded only if the local file is different,
- # otherwise the response code should be 304 Not Modified
+ """Test getting object content only when the local file is different
+
+ http://en.wikipedia.org/wiki/HTTP_ETag
+ Make a conditional request for an object using the If-None-Match
+ header, it should get downloaded only if the local file is different,
+ otherwise the response code should be 304 Not Modified
+ """
object_name, data = self.create_object(self.container_name)
# local copy is identical, no download
md5 = hashlib.md5(data).hexdigest()
@@ -975,6 +999,7 @@
class PublicObjectTest(base.BaseObjectTest):
+ """Test public storage object"""
credentials = [['operator', CONF.object_storage.operator_role],
['operator_alt', CONF.object_storage.operator_role]]
@@ -1000,9 +1025,11 @@
@decorators.idempotent_id('07c9cf95-c0d4-4b49-b9c8-0ef2c9b27193')
def test_access_public_container_object_without_using_creds(self):
- # make container public-readable and access an object in it object
- # anonymously, without using credentials
+ """Test accessing public container object without using credentials
+ Make container public-readable and access an object in it object
+ anonymously, without using credentials.
+ """
# update container metadata to make it publicly readable
cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
resp_meta, body = (
@@ -1040,8 +1067,11 @@
@decorators.idempotent_id('54e2a2fe-42dc-491b-8270-8e4217dd4cdc')
def test_access_public_object_with_another_user_creds(self):
- # make container public-readable and access an object in it using
- # another user's credentials
+ """Test accessing public object with another user's credentials
+
+ Make container public-readable and access an object in it using
+ another user's credentials.
+ """
cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
resp_meta, body = (
self.container_client.create_update_or_delete_container_metadata(
diff --git a/tempest/api/object_storage/test_object_slo.py b/tempest/api/object_storage/test_object_slo.py
index 8bb2e6e..7e553ca 100644
--- a/tempest/api/object_storage/test_object_slo.py
+++ b/tempest/api/object_storage/test_object_slo.py
@@ -27,6 +27,7 @@
class ObjectSloTest(base.BaseObjectTest):
+ """Test static large object"""
def setUp(self):
super(ObjectSloTest, self).setUp()
@@ -108,7 +109,7 @@
@decorators.idempotent_id('2c3f24a6-36e8-4711-9aa2-800ee1fc7b5b')
@utils.requires_ext(extension='slo', service='object')
def test_upload_manifest(self):
- # create static large object from multipart manifest
+ """Test creating static large object from multipart manifest"""
manifest = self._create_manifest()
params = {'multipart-manifest': 'put'}
@@ -123,7 +124,10 @@
@decorators.idempotent_id('e69ad766-e1aa-44a2-bdd2-bf62c09c1456')
@utils.requires_ext(extension='slo', service='object')
def test_list_large_object_metadata(self):
- # list static large object metadata using multipart manifest
+ """Test listing static large object metadata
+
+ List static large object metadata using multipart manifest
+ """
object_name = self._create_large_object()
resp, _ = self.object_client.list_object_metadata(
@@ -135,7 +139,7 @@
@decorators.idempotent_id('49bc49bc-dd1b-4c0f-904e-d9f10b830ee8')
@utils.requires_ext(extension='slo', service='object')
def test_retrieve_large_object(self):
- # list static large object using multipart manifest
+ """Test listing static large object using multipart manifest"""
object_name = self._create_large_object()
resp, body = self.object_client.get_object(
@@ -150,7 +154,7 @@
@decorators.idempotent_id('87b6dfa1-abe9-404d-8bf0-6c3751e6aa77')
@utils.requires_ext(extension='slo', service='object')
def test_delete_large_object(self):
- # delete static large object using multipart manifest
+ """Test deleting static large object using multipart manifest"""
object_name = self._create_large_object()
params_del = {'multipart-manifest': 'delete'}
diff --git a/tempest/api/volume/admin/test_encrypted_volumes_extend.py b/tempest/api/volume/admin/test_encrypted_volumes_extend.py
new file mode 100644
index 0000000..7339179
--- /dev/null
+++ b/tempest/api/volume/admin/test_encrypted_volumes_extend.py
@@ -0,0 +1,35 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import testtools
+
+from tempest.api.volume import base
+from tempest.api.volume import test_volumes_extend as extend
+from tempest.common import utils
+from tempest import config
+from tempest.lib import decorators
+
+CONF = config.CONF
+
+
+class EncryptedVolumesExtendAttachedTest(extend.BaseVolumesExtendAttachedTest,
+ base.BaseVolumeAdminTest):
+ """Tests extending the size of an attached encrypted volume."""
+
+ @decorators.idempotent_id('e93243ec-7c37-4b5b-a099-ebf052c13216')
+ @testtools.skipUnless(
+ CONF.volume_feature_enabled.extend_attached_encrypted_volume,
+ "Attached encrypted volume extend is disabled.")
+ @utils.services('compute')
+ def test_extend_attached_encrypted_volume_luksv1(self):
+ volume = self.create_encrypted_volume(encryption_provider="luks")
+ self._test_extend_attached_volume(volume)
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 7af5927..c538e60 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -302,6 +302,27 @@
cls.addClassResourceCleanup(cls.clear_volume_type, volume_type['id'])
return volume_type
+ def create_encryption_type(self, type_id=None, provider=None,
+ key_size=None, cipher=None,
+ control_location=None):
+ if not type_id:
+ volume_type = self.create_volume_type()
+ type_id = volume_type['id']
+ self.admin_encryption_types_client.create_encryption_type(
+ type_id, provider=provider, key_size=key_size, cipher=cipher,
+ control_location=control_location)
+
+ def create_encrypted_volume(self, encryption_provider, key_size=256,
+ cipher='aes-xts-plain64',
+ control_location='front-end'):
+ volume_type = self.create_volume_type()
+ self.create_encryption_type(type_id=volume_type['id'],
+ provider=encryption_provider,
+ key_size=key_size,
+ cipher=cipher,
+ control_location=control_location)
+ return self.create_volume(volume_type=volume_type['name'])
+
def create_group_type(self, name=None, **kwargs):
"""Create a test group-type"""
name = name or data_utils.rand_name(
diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py
index 041823d..7441f1d 100644
--- a/tempest/api/volume/test_volumes_extend.py
+++ b/tempest/api/volume/test_volumes_extend.py
@@ -61,7 +61,7 @@
self.assertEqual(extend_size, resized_volume['size'])
-class VolumesExtendAttachedTest(base.BaseVolumeTest):
+class BaseVolumesExtendAttachedTest(base.BaseVolumeTest):
"""Tests extending the size of an attached volume."""
create_default_network = True
@@ -100,14 +100,9 @@
event['finish_time']):
return event
- @decorators.idempotent_id('301f5a30-1c6f-4ea0-be1a-91fd28d44354')
- @testtools.skipUnless(CONF.volume_feature_enabled.extend_attached_volume,
- "Attached volume extend is disabled.")
- @utils.services('compute')
- def test_extend_attached_volume(self):
+ def _test_extend_attached_volume(self, volume):
"""This is a happy path test which does the following:
- * Create a volume at the configured volume_size.
* Create a server instance.
* Attach the volume to the server.
* Wait for the volume status to be "in-use".
@@ -119,8 +114,6 @@
if we timeout waiting for the instance action event to show up, or
if the action on the server fails.
"""
- # Create a test volume. Will be automatically cleaned up on teardown.
- volume = self.create_volume()
# Create a test server. Will be automatically cleaned up on teardown.
server = self.create_server()
# Attach the volume to the server and wait for the volume status to be
@@ -182,3 +175,14 @@
"%(request_id)s." %
{'result': event['result'],
'request_id': action['request_id']})
+
+
+class VolumesExtendAttachedTest(BaseVolumesExtendAttachedTest):
+
+ @decorators.idempotent_id('301f5a30-1c6f-4ea0-be1a-91fd28d44354')
+ @testtools.skipUnless(CONF.volume_feature_enabled.extend_attached_volume,
+ "Attached volume extend is disabled.")
+ @utils.services('compute')
+ def test_extend_attached_volume(self):
+ volume = self.create_volume()
+ self._test_extend_attached_volume(volume)
diff --git a/tempest/clients.py b/tempest/clients.py
index 1db93a0..8363a8d 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -203,6 +203,8 @@
**params_v3)
self.application_credentials_client = \
self.identity_v3.ApplicationCredentialsClient(**params_v3)
+ self.access_rules_client = \
+ self.identity_v3.AccessRulesClient(**params_v3)
# Token clients do not use the catalog. They only need default_params.
# They read auth_url, so they should only be set if the corresponding
diff --git a/tempest/config.py b/tempest/config.py
index a632dee..2f2c2e9 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -250,6 +250,11 @@
default=False,
help='Does the environment have application credentials '
'enabled?'),
+ # Access rules for application credentials is a default feature in Train.
+ # This config option can removed once Stein is EOL.
+ cfg.BoolOpt('access_rules',
+ default=False,
+ help='Does the environment have access rules enabled?'),
cfg.BoolOpt('immutable_user_source',
default=False,
help='Set to True if the environment has a read-only '
@@ -1012,7 +1017,15 @@
'which is currently attached to a server instance? This '
'depends on the 3.42 volume API microversion and the '
'2.51 compute API microversion. Also, not all volume or '
- 'compute backends support this operation.')
+ 'compute backends support this operation.'),
+ cfg.BoolOpt('extend_attached_encrypted_volume',
+ default=False,
+ help='Does the cloud support extending the size of an '
+ 'encrypted volume which is currently attached to a '
+ 'server instance? This depends on the 3.42 volume API '
+ 'microversion and the 2.51 compute API microversion. '
+ 'Also, not all volume or compute backends support this '
+ 'operation.')
]
@@ -1186,7 +1199,7 @@
The best use case is investigating used resources of one test.
A test can be run as follows:
- $ ostestr --pdb TEST_ID
+ $ stestr run --pdb TEST_ID
or
$ python -m testtools.run TEST_ID"""),
]
diff --git a/tempest/lib/services/identity/v3/__init__.py b/tempest/lib/services/identity/v3/__init__.py
index da1c51c..86fa991 100644
--- a/tempest/lib/services/identity/v3/__init__.py
+++ b/tempest/lib/services/identity/v3/__init__.py
@@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations under
# the License.
+from tempest.lib.services.identity.v3.access_rules_client import \
+ AccessRulesClient
from tempest.lib.services.identity.v3.application_credentials_client import \
ApplicationCredentialsClient
from tempest.lib.services.identity.v3.catalog_client import \
@@ -48,9 +50,10 @@
from tempest.lib.services.identity.v3.users_client import UsersClient
from tempest.lib.services.identity.v3.versions_client import VersionsClient
-__all__ = ['ApplicationCredentialsClient', 'CatalogClient',
- 'CredentialsClient', 'DomainsClient', 'DomainConfigurationClient',
- 'EndPointGroupsClient', 'EndPointsClient', 'EndPointsFilterClient',
+__all__ = ['AccessRulesClient', 'ApplicationCredentialsClient',
+ 'CatalogClient', 'CredentialsClient', 'DomainsClient',
+ 'DomainConfigurationClient', 'EndPointGroupsClient',
+ 'EndPointsClient', 'EndPointsFilterClient',
'GroupsClient', 'IdentityClient', 'InheritedRolesClient',
'OAUTHConsumerClient', 'OAUTHTokenClient', 'PoliciesClient',
'ProjectsClient', 'ProjectTagsClient', 'RegionsClient',
diff --git a/tempest/lib/services/identity/v3/access_rules_client.py b/tempest/lib/services/identity/v3/access_rules_client.py
new file mode 100644
index 0000000..4f13e47
--- /dev/null
+++ b/tempest/lib/services/identity/v3/access_rules_client.py
@@ -0,0 +1,68 @@
+# Copyright 2019 SUSE LLC
+#
+# 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.
+
+"""
+https://docs.openstack.org/api-ref/identity/v3/index.html#application-credentials
+"""
+
+from oslo_serialization import jsonutils as json
+from six.moves.urllib import parse as urllib
+
+from tempest.lib.common import rest_client
+
+
+class AccessRulesClient(rest_client.RestClient):
+ api_version = "v3"
+
+ def show_access_rule(self, user_id, access_rule_id):
+ """Gets details of an access rule.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://docs.openstack.org/api-ref/identity/v3/index.html#show-access-rule-details
+ """
+ resp, body = self.get('users/%s/access_rules/%s' %
+ (user_id, access_rule_id))
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def list_access_rules(self, user_id, **params):
+ """Lists out all of a user's access rules.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://docs.openstack.org/api-ref/identity/v3/index.html#list-access-rules
+ """
+ url = 'users/%s/access_rules' % user_id
+ if params:
+ url += '?%s' % urllib.urlencode(params)
+ resp, body = self.get(url)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def delete_access_rule(self, user_id, access_rule_id):
+ """Deletes an access rule.
+
+ For a full list of available parameters, please refer to the official
+ API reference:
+ https://docs.openstack.org/api-ref/identity/v3/index.html#delete-access-rule
+ """
+ resp, body = self.delete('users/%s/access_rules/%s' %
+ (user_id, access_rule_id))
+ self.expected_success(204, resp.status)
+ return rest_client.ResponseBody(resp, body)
diff --git a/tempest/lib/services/identity/v3/endpoint_filter_client.py b/tempest/lib/services/identity/v3/endpoint_filter_client.py
index ce84869..2d5c8c9 100644
--- a/tempest/lib/services/identity/v3/endpoint_filter_client.py
+++ b/tempest/lib/services/identity/v3/endpoint_filter_client.py
@@ -66,3 +66,57 @@
% (project_id, endpoint_id))
self.expected_success(204, resp.status)
return rest_client.ResponseBody(resp, body)
+
+ def list_endpoint_groups_for_project(self, project_id):
+ """List Endpoint Groups Associated with Project."""
+ resp, body = self.get(
+ self.ep_filter + '/projects/%s/endpoint_groups'
+ % project_id)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def list_projects_for_endpoint_group(self, endpoint_group_id):
+ """List Projects Associated with Endpoint Group."""
+ resp, body = self.get(
+ self.ep_filter + '/endpoint_groups/%s/projects'
+ % endpoint_group_id)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def list_endpoints_for_endpoint_group(self, endpoint_group_id):
+ """List Endpoints Associated with Endpoint Group."""
+ resp, body = self.get(
+ self.ep_filter + '/endpoint_groups/%s/endpoints'
+ % endpoint_group_id)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def add_endpoint_group_to_project(self, endpoint_group_id, project_id):
+ """Create Endpoint Group to Project Association."""
+ body = None
+ resp, body = self.put(
+ self.ep_filter + '/endpoint_groups/%s/projects/%s'
+ % (endpoint_group_id, project_id), body)
+ self.expected_success(204, resp.status)
+ return rest_client.ResponseBody(resp, body)
+
+ def show_endpoint_group_for_project(self, endpoint_group_id, project_id):
+ """Get Endpoint Group to Project Association."""
+ resp, body = self.get(
+ self.ep_filter + '/endpoint_groups/%s/projects/%s'
+ % (endpoint_group_id, project_id))
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def delete_endpoint_group_from_project(
+ self, endpoint_group_id, project_id):
+ """Delete Endpoint Group to Project Association."""
+ resp, body = self.delete(
+ self.ep_filter + '/endpoint_groups/%s/projects/%s'
+ % (endpoint_group_id, project_id))
+ self.expected_success(204, resp.status)
+ return rest_client.ResponseBody(resp, body)
diff --git a/tempest/lib/services/identity/v3/policies_client.py b/tempest/lib/services/identity/v3/policies_client.py
index 31c0d18..41def38 100644
--- a/tempest/lib/services/identity/v3/policies_client.py
+++ b/tempest/lib/services/identity/v3/policies_client.py
@@ -185,3 +185,27 @@
resp, body = self.delete(url)
self.expected_success(204, resp.status)
return rest_client.ResponseBody(resp, body)
+
+ def list_endpoints_for_policy(self, policy_id):
+ """List policy and service endpoint associations.
+
+ API reference:
+ https://docs.openstack.org/api-ref/identity/v3-ext/#list-policy-and-service-endpoint-associations
+ """
+ url = "policies/{0}/OS-ENDPOINT-POLICY/endpoints".format(policy_id)
+ resp, body = self.get(url)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def show_policy_for_endpoint(self, endpoint_id):
+ """Show the effective policy associated with an endpoint
+
+ API reference:
+ https://docs.openstack.org/api-ref/identity/v3-ext/#show-the-effective-policy-associated-with-an-endpoint
+ """
+ url = "endpoints/{0}/OS-ENDPOINT-POLICY/policy".format(endpoint_id)
+ resp, body = self.get(url)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
diff --git a/tempest/lib/services/identity/v3/users_client.py b/tempest/lib/services/identity/v3/users_client.py
index f47730f..bba02a4 100644
--- a/tempest/lib/services/identity/v3/users_client.py
+++ b/tempest/lib/services/identity/v3/users_client.py
@@ -118,3 +118,30 @@
self.expected_success(200, resp.status)
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
+
+ def create_user_ec2_credential(self, user_id, **kwargs):
+ post_body = json.dumps(kwargs)
+ resp, body = self.post('/users/%s/credentials/OS-EC2' % user_id,
+ post_body)
+ self.expected_success(201, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def delete_user_ec2_credential(self, user_id, access):
+ resp, body = self.delete('/users/%s/credentials/OS-EC2/%s' %
+ (user_id, access))
+ self.expected_success(204, resp.status)
+ return rest_client.ResponseBody(resp, body)
+
+ def list_user_ec2_credentials(self, user_id):
+ resp, body = self.get('/users/%s/credentials/OS-EC2' % user_id)
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
+
+ def show_user_ec2_credential(self, user_id, access):
+ resp, body = self.get('/users/%s/credentials/OS-EC2/%s' %
+ (user_id, access))
+ self.expected_success(200, resp.status)
+ body = json.loads(body)
+ return rest_client.ResponseBody(resp, body)
diff --git a/tempest/tests/lib/services/identity/v3/test_access_rules_client.py b/tempest/tests/lib/services/identity/v3/test_access_rules_client.py
new file mode 100644
index 0000000..71c9cde
--- /dev/null
+++ b/tempest/tests/lib/services/identity/v3/test_access_rules_client.py
@@ -0,0 +1,97 @@
+# Copyright 2019 SUSE LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from tempest.lib.services.identity.v3 import access_rules_client
+from tempest.tests.lib import fake_auth_provider
+from tempest.tests.lib.services import base
+
+
+class TestAccessRulesClient(base.BaseServiceTest):
+ FAKE_LIST_ACCESS_RULES = {
+ "links": {
+ "self": "https://example.com/identity/v3/users/" +
+ "3e0716ae/access_rules",
+ "previous": None,
+ "next": None
+ },
+ "access_rules": [
+ {
+ "path": "/v2.0/metrics",
+ "links": {
+ "self": "https://example.com/identity/v3/access_rules/" +
+ "07d719df00f349ef8de77d542edf010c"
+ },
+ "id": "07d719df00f349ef8de77d542edf010c",
+ "service": "monitoring",
+ "method": "GET"
+ }
+ ]
+ }
+
+ FAKE_ACCESS_RULE_INFO = {
+ "access_rule": {
+ "path": "/v2.0/metrics",
+ "links": {
+ "self": "https://example.com/identity/v3/access_rules/" +
+ "07d719df00f349ef8de77d542edf010c"
+ },
+ "id": "07d719df00f349ef8de77d542edf010c",
+ "service": "monitoring",
+ "method": "GET"
+ }
+ }
+
+ def setUp(self):
+ super(TestAccessRulesClient, self).setUp()
+ fake_auth = fake_auth_provider.FakeAuthProvider()
+ self.client = access_rules_client.AccessRulesClient(
+ fake_auth, 'identity', 'regionOne')
+
+ def _test_show_access_rule(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_access_rule,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_ACCESS_RULE_INFO,
+ bytes_body,
+ user_id="123456",
+ access_rule_id="5499a186")
+
+ def _test_list_access_rules(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_access_rules,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_LIST_ACCESS_RULES,
+ bytes_body,
+ user_id="123456")
+
+ def test_show_access_rule_with_str_body(self):
+ self._test_show_access_rule()
+
+ def test_show_access_rule_with_bytes_body(self):
+ self._test_show_access_rule(bytes_body=True)
+
+ def test_list_access_rule_with_str_body(self):
+ self._test_list_access_rules()
+
+ def test_list_access_rule_with_bytes_body(self):
+ self._test_list_access_rules(bytes_body=True)
+
+ def test_delete_access_rule(self):
+ self.check_service_client_function(
+ self.client.delete_access_rule,
+ 'tempest.lib.common.rest_client.RestClient.delete',
+ {},
+ user_id="123456",
+ access_rule_id="5499a186",
+ status=204)
diff --git a/tempest/tests/lib/services/identity/v3/test_endpoint_filter_client.py b/tempest/tests/lib/services/identity/v3/test_endpoint_filter_client.py
index 7faf6a0..e5f7a66 100644
--- a/tempest/tests/lib/services/identity/v3/test_endpoint_filter_client.py
+++ b/tempest/tests/lib/services/identity/v3/test_endpoint_filter_client.py
@@ -83,6 +83,36 @@
}
}
+ FAKE_LIST_ENDPOINT_GROUPS_FOR_PROJECT = {
+ "endpoint_groups": [
+ {
+ "endpoint_group": {
+ "description": "endpoint group description #2",
+ "filters": {
+ "interface": "admin"
+ },
+ "id": "3de68c",
+ "name": "endpoint group name #2"
+ }
+ }
+ ],
+ "links": {
+ "self": "https://url/identity/v3/OS-EP-FILTER/endpoint_groups",
+ }
+ }
+
+ FAKE_PROJECT_INFO = {
+ "project": {
+ "domain_id": "1789d1",
+ "id": "263fd9",
+ "links": {
+ "self": "http://example.com/identity/v3/projects/263fd9"
+ },
+ "name": "project name #1",
+ "description": "project description #1"
+ }
+ }
+
def setUp(self):
super(TestEndPointsFilterClient, self).setUp()
fake_auth = fake_auth_provider.FakeAuthProvider()
@@ -137,6 +167,52 @@
project_id=3,
endpoint_id=4)
+ def _test_list_endpoint_groups_for_project(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_endpoint_groups_for_project,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_LIST_ENDPOINT_GROUPS_FOR_PROJECT,
+ bytes_body,
+ status=200,
+ project_id=3)
+
+ def _test_list_projects_for_endpoint_group(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_projects_for_endpoint_group,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_LIST_PROJECTS_FOR_ENDPOINTS,
+ bytes_body,
+ status=200,
+ endpoint_group_id=5)
+
+ def _test_list_endpoints_for_endpoint_group(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_endpoints_for_endpoint_group,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_LIST_ENDPOINTS_FOR_PROJECTS,
+ bytes_body,
+ status=200,
+ endpoint_group_id=5)
+
+ def _test_add_endpoint_group_to_project(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.add_endpoint_group_to_project,
+ 'tempest.lib.common.rest_client.RestClient.put',
+ {},
+ bytes_body,
+ status=204,
+ endpoint_group_id=5,
+ project_id=6)
+
+ def _test_show_endpoint_group_for_project(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_endpoint_group_for_project,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_PROJECT_INFO,
+ bytes_body,
+ endpoint_group_id=5,
+ project_id=6)
+
def test_add_endpoint_to_project_with_str_body(self):
self._test_add_endpoint_to_project()
@@ -163,3 +239,43 @@
def test_delete_endpoint_from_project(self):
self._test_delete_endpoint_from_project()
+
+ def test_list_endpoint_groups_for_project_with_str_body(self):
+ self._test_list_endpoint_groups_for_project()
+
+ def test_list_endpoint_groups_for_project_with_bytes_body(self):
+ self._test_list_endpoint_groups_for_project(bytes_body=True)
+
+ def test_list_projects_for_endpoint_group_with_str_body(self):
+ self._test_list_projects_for_endpoint_group()
+
+ def test_list_projects_for_endpoint_group_with_bytes_body(self):
+ self._test_list_projects_for_endpoint_group(bytes_body=True)
+
+ def test_list_endpoints_for_endpoint_group_with_str_body(self):
+ self._test_list_endpoints_for_endpoint_group()
+
+ def test_list_endpoints_for_endpoint_group_with_bytes_body(self):
+ self._test_list_endpoints_for_endpoint_group(bytes_body=True)
+
+ def test_add_endpoint_group_to_project_with_str_body(self):
+ self._test_add_endpoint_group_to_project()
+
+ def test_add_endpoint_group_to_project_with_bytes_body(self):
+ self._test_add_endpoint_group_to_project(bytes_body=True)
+
+ def test_show_endpoint_group_for_project_with_str_body(self):
+ self._test_show_endpoint_group_for_project()
+
+ def test_show_endpoint_group_for_project_with_bytes_body(self):
+ self._test_show_endpoint_group_for_project(bytes_body=True)
+
+ def test_delete_endpoint_group_from_project(self):
+ self.check_service_client_function(
+ self.client.delete_endpoint_group_from_project,
+ 'tempest.lib.common.rest_client.RestClient.delete',
+ {},
+ False,
+ status=204,
+ endpoint_group_id=5,
+ project_id=5)
diff --git a/tempest/tests/lib/services/identity/v3/test_policies_client.py b/tempest/tests/lib/services/identity/v3/test_policies_client.py
index 0237475..4fc800a 100644
--- a/tempest/tests/lib/services/identity/v3/test_policies_client.py
+++ b/tempest/tests/lib/services/identity/v3/test_policies_client.py
@@ -44,6 +44,34 @@
}
}
+ FAKE_ENDPOINT_INFO = {
+ "endpoints": [
+ {
+ "id": "1",
+ "interface": "public",
+ "links": {
+ "self": "http://example.com/identity/v3/endpoints/1"
+ },
+ "region": "north",
+ "service_id": "9242e05f0c23467bbd1cf1f7a6e5e596",
+ "url": "http://example.com/identity/"
+ },
+ {
+ "id": "1",
+ "interface": "internal",
+ "links": {
+ "self": "http://example.com/identity/v3/endpoints/1"
+ },
+ "region": "south",
+ "service_id": "9242e05f0c23467bbd1cf1f7a6e5e596",
+ "url": "http://example.com/identity/"
+ }
+ ],
+ "links": {
+ "self": "http://exmp.com/identity/v3/OS-ENDPOINT-POLICY/policies/1"
+ }
+ }
+
FAKE_LIST_POLICIES = {
"links": {
"next": None,
@@ -238,3 +266,33 @@
service_id=self.FAKE_SERVICE_ID,
region_id=self.FAKE_REGION_ID,
status=204)
+
+ def _test_list_endpoints_for_policy(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_endpoints_for_policy,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_ENDPOINT_INFO,
+ bytes_body,
+ policy_id=self.FAKE_POLICY_ID,
+ status=200)
+
+ def test_list_endpoints_for_policy_with_str_body(self):
+ self._test_list_endpoints_for_policy()
+
+ def test_list_endpoints_for_policy_with_bytes_body(self):
+ self._test_list_endpoints_for_policy(bytes_body=True)
+
+ def _test_list_policy_for_endpoint(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_policy_for_endpoint,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_POLICY_INFO,
+ bytes_body,
+ endpoint_id=self.FAKE_ENDPOINT_ID,
+ status=200)
+
+ def test_list_policy_for_endpoint_with_str_body(self):
+ self._test_list_policy_for_endpoint()
+
+ def test_list_policy_for_endpoint_with_bytes_body(self):
+ self._test_list_policy_for_endpoint(bytes_body=True)
diff --git a/tempest/tests/lib/services/identity/v3/test_users_client.py b/tempest/tests/lib/services/identity/v3/test_users_client.py
index c0dfdae..7be0480 100644
--- a/tempest/tests/lib/services/identity/v3/test_users_client.py
+++ b/tempest/tests/lib/services/identity/v3/test_users_client.py
@@ -141,6 +141,35 @@
]
}
+ FAKE_USER_EC2_CREDENTIAL_INFO = {
+ "credential": {
+ 'user_id': '9beb0e12f3e5416db8d7cccfc785db3b',
+ 'access': '79abf59acc77492a86170cbe2f1feafa',
+ 'secret': 'c4e7d3a691fd4563873d381a40320f46',
+ 'trust_id': None,
+ 'tenant_id': '596557269d7b4dd78631a602eb9f151d'
+ }
+ }
+
+ FAKE_LIST_USER_EC2_CREDENTIALS = {
+ "credentials": [
+ {
+ 'user_id': '9beb0e12f3e5416db8d7cccfc785db3b',
+ 'access': '79abf59acc77492a86170cbe2f1feafa',
+ 'secret': 'c4e7d3a691fd4563873d381a40320f46',
+ 'trust_id': None,
+ 'tenant_id': '596557269d7b4dd78631a602eb9f151d'
+ },
+ {
+ 'user_id': '3beb0e12f3e5416db8d7cccfc785de4r',
+ 'access': '45abf59acc77492a86170cbe2f1fesde',
+ 'secret': 'g4e7d3a691fd4563873d381a40320e45',
+ 'trust_id': None,
+ 'tenant_id': '123557269d7b4dd78631a602eb9f112f'
+ }
+ ]
+ }
+
def setUp(self):
super(TestUsersClient, self).setUp()
fake_auth = fake_auth_provider.FakeAuthProvider()
@@ -201,6 +230,33 @@
user_id='817fb3c23fd7465ba6d7fe1b1320121d',
)
+ def _test_create_user_ec2_credential(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.create_user_ec2_credential,
+ 'tempest.lib.common.rest_client.RestClient.post',
+ self.FAKE_USER_EC2_CREDENTIAL_INFO,
+ bytes_body,
+ status=201,
+ user_id="1",
+ tenant_id="123")
+
+ def _test_show_user_ec2_credential(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.show_user_ec2_credential,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_USER_EC2_CREDENTIAL_INFO,
+ bytes_body,
+ user_id="1",
+ access="123")
+
+ def _test_list_user_ec2_credentials(self, bytes_body=False):
+ self.check_service_client_function(
+ self.client.list_user_ec2_credentials,
+ 'tempest.lib.common.rest_client.RestClient.get',
+ self.FAKE_LIST_USER_EC2_CREDENTIALS,
+ bytes_body,
+ user_id="1")
+
def test_create_user_with_string_body(self):
self._test_create_user()
@@ -255,3 +311,30 @@
user_id='817fb3c23fd7465ba6d7fe1b1320121d',
password='NewTempestPassword',
original_password='OldTempestPassword')
+
+ def test_create_user_ec2_credential_with_str_body(self):
+ self._test_create_user_ec2_credential()
+
+ def test_create_user_ec2_credential_with_bytes_body(self):
+ self._test_create_user_ec2_credential(bytes_body=True)
+
+ def test_show_user_ec2_credential_with_str_body(self):
+ self._test_show_user_ec2_credential()
+
+ def test_show_user_ec2_credential_with_bytes_body(self):
+ self._test_show_user_ec2_credential(bytes_body=True)
+
+ def test_list_user_ec2_credentials_with_str_body(self):
+ self._test_list_user_ec2_credentials()
+
+ def test_list_user_ec2_credentials_with_bytes_body(self):
+ self._test_list_user_ec2_credentials(bytes_body=True)
+
+ def test_delete_user_ec2_credential(self):
+ self.check_service_client_function(
+ self.client.delete_user_ec2_credential,
+ 'tempest.lib.common.rest_client.RestClient.delete',
+ {},
+ user_id="123",
+ access="1234",
+ status=204)
diff --git a/tools/tempest-integrated-gate-networking-blacklist.txt b/tools/tempest-integrated-gate-networking-blacklist.txt
index 263b2e4..97808d9 100644
--- a/tools/tempest-integrated-gate-networking-blacklist.txt
+++ b/tools/tempest-integrated-gate-networking-blacklist.txt
@@ -17,3 +17,8 @@
tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_boot_server_from_encrypted_volume_luks
tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_image_defined_boot_from_volume
tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_create_server_from_volume_snapshot
+
+# TODO(gmann): Remove these test skip once nova bug #1882521 is solved
+tempest.api.compute.volumes.test_attach_volume.AttachVolumeMultiAttachTest.test_resize_server_with_multiattached_volume
+tempest.api.compute.servers.test_server_rescue_negative.ServerRescueNegativeTestJSON
+tempest.api.compute.servers.test_server_rescue.ServerStableDeviceRescueTest.test_stable_device_rescue_disk_virtio_with_volume_attached
diff --git a/tools/tempest-integrated-gate-placement-blacklist.txt b/tools/tempest-integrated-gate-placement-blacklist.txt
index efba796..657bda2 100644
--- a/tools/tempest-integrated-gate-placement-blacklist.txt
+++ b/tools/tempest-integrated-gate-placement-blacklist.txt
@@ -17,3 +17,8 @@
tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_boot_server_from_encrypted_volume_luks
tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_image_defined_boot_from_volume
tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_create_server_from_volume_snapshot
+
+# TODO(gmann): Remove these test skip once nova bug #1882521 is solved
+tempest.api.compute.volumes.test_attach_volume.AttachVolumeMultiAttachTest.test_resize_server_with_multiattached_volume
+tempest.api.compute.servers.test_server_rescue_negative.ServerRescueNegativeTestJSON
+tempest.api.compute.servers.test_server_rescue.ServerStableDeviceRescueTest.test_stable_device_rescue_disk_virtio_with_volume_attached
diff --git a/tools/tempest-integrated-gate-storage-blacklist.txt b/tools/tempest-integrated-gate-storage-blacklist.txt
index 1ef6bb5..cbd3e9d 100644
--- a/tools/tempest-integrated-gate-storage-blacklist.txt
+++ b/tools/tempest-integrated-gate-storage-blacklist.txt
@@ -12,3 +12,8 @@
tempest.scenario.test_network_basic_ops.TestNetworkBasicOps
tempest.scenario.test_network_v6.TestGettingAddress
tempest.scenario.test_security_groups_basic_ops.TestSecurityGroupsBasicOps
+
+# TODO(gmann): Remove these test skip once nova bug #1882521 is solved
+tempest.api.compute.volumes.test_attach_volume.AttachVolumeMultiAttachTest.test_resize_server_with_multiattached_volume
+tempest.api.compute.servers.test_server_rescue_negative.ServerRescueNegativeTestJSON
+tempest.api.compute.servers.test_server_rescue.ServerStableDeviceRescueTest.test_stable_device_rescue_disk_virtio_with_volume_attached