Merge "Fix un-assignment local variable 'returncode' error"
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index bc1b158..e6a22b0 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -29,7 +29,7 @@
@classmethod
def disable_user(cls, user_name):
user = cls.get_user_by_name(user_name)
- cls.users_client.enable_disable_user(user['id'], enabled=False)
+ cls.users_client.update_user_enabled(user['id'], enabled=False)
@classmethod
def disable_tenant(cls, tenant_name):
diff --git a/tempest/api/identity/v2/test_ec2_credentials.py b/tempest/api/identity/v2/test_ec2_credentials.py
index 5902196..3c379f0 100644
--- a/tempest/api/identity/v2/test_ec2_credentials.py
+++ b/tempest/api/identity/v2/test_ec2_credentials.py
@@ -33,14 +33,14 @@
cls.creds = cls.os.credentials
@test.idempotent_id('b580fab9-7ae9-46e8-8138-417260cb6f9f')
- def test_create_ec2_credentials(self):
- """Create user ec2 credentials."""
- resp = self.non_admin_users_client.create_user_ec2_credentials(
+ 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_credentials,
+ self.non_admin_users_client.delete_user_ec2_credential,
self.creds.user_id, access)
self.assertNotEmpty(resp['access'])
self.assertNotEmpty(resp['secret'])
@@ -53,21 +53,21 @@
created_creds = []
fetched_creds = []
# create first ec2 credentials
- creds1 = self.non_admin_users_client.create_user_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'])
# create second ec2 credentials
- creds2 = self.non_admin_users_client.create_user_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'])
# add credentials to be cleaned up
self.addCleanup(
- self.non_admin_users_client.delete_user_ec2_credentials,
+ self.non_admin_users_client.delete_user_ec2_credential,
self.creds.user_id, creds1['access'])
self.addCleanup(
- self.non_admin_users_client.delete_user_ec2_credentials,
+ 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(
@@ -81,32 +81,32 @@
', '.join(cred for cred in missing))
@test.idempotent_id('cb284075-b613-440d-83ca-fe0b33b3c2b8')
- def test_show_ec2_credentials(self):
- """Get the definite user ec2 credentials."""
- resp = self.non_admin_users_client.create_user_ec2_credentials(
+ 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_credentials,
+ 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_credentials(
+ 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])
@test.idempotent_id('6aba0d4c-b76b-4e46-aa42-add79bc1551d')
- def test_delete_ec2_credentials(self):
- """Delete user ec2 credentials."""
- resp = self.non_admin_users_client.create_user_ec2_credentials(
+ 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_credentials(
+ 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_credentials,
+ self.non_admin_users_client.show_user_ec2_credential,
self.creds.user_id,
access)
diff --git a/tempest/api/volume/v2/test_image_metadata.py b/tempest/api/volume/v2/test_image_metadata.py
new file mode 100644
index 0000000..1e7bb30
--- /dev/null
+++ b/tempest/api/volume/v2/test_image_metadata.py
@@ -0,0 +1,64 @@
+# Copyright 2016 Red Hat, Inc.
+# 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 testtools import matchers
+
+from tempest.api.volume import base
+from tempest import config
+from tempest import test
+
+CONF = config.CONF
+
+
+class VolumesV2ImageMetadata(base.BaseVolumeTest):
+
+ @classmethod
+ def resource_setup(cls):
+ super(VolumesV2ImageMetadata, cls).resource_setup()
+ # Create a volume from image ID
+ cls.volume = cls.create_volume(imageRef=CONF.compute.image_ref)
+
+ @test.idempotent_id('03efff0b-5c75-4822-8f10-8789ac15b13e')
+ @test.services('image')
+ def test_update_image_metadata(self):
+ # Update image metadata
+ image_metadata = {'image_id': '5137a025-3c5f-43c1-bc64-5f41270040a5',
+ 'image_name': 'image',
+ 'kernel_id': '6ff710d2-942b-4d6b-9168-8c9cc2404ab1',
+ 'ramdisk_id': 'somedisk'}
+ self.volumes_client.update_volume_image_metadata(self.volume['id'],
+ **image_metadata)
+
+ # Fetch image metadata from the volume
+ volume_image_metadata = self.volumes_client.show_volume(
+ self.volume['id'])['volume']['volume_image_metadata']
+
+ # Verify image metadata was updated
+ self.assertThat(volume_image_metadata.items(),
+ matchers.ContainsAll(image_metadata.items()))
+
+ # Delete one item from image metadata of the volume
+ self.volumes_client.delete_volume_image_metadata(self.volume['id'],
+ 'ramdisk_id')
+ del image_metadata['ramdisk_id']
+
+ # Fetch the new image metadata from the volume
+ volume_image_metadata = self.volumes_client.show_volume(
+ self.volume['id'])['volume']['volume_image_metadata']
+
+ # Verify image metadata was updated after item deletion
+ self.assertThat(volume_image_metadata.items(),
+ matchers.ContainsAll(image_metadata.items()))
+ self.assertNotIn('ramdisk_id', volume_image_metadata)
diff --git a/tempest/clients.py b/tempest/clients.py
index 8c1b279..b7bc4fa 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -21,98 +21,16 @@
from tempest import config
from tempest import exceptions
from tempest.lib.services import compute
-from tempest.lib.services.identity.v2.endpoints_client import EndpointsClient
-from tempest.lib.services.identity.v2.token_client import TokenClient
-from tempest.lib.services.identity.v3.token_client import V3TokenClient
-from tempest.lib.services.image.v1.image_members_client import \
- ImageMembersClient
-from tempest.lib.services.image.v2.image_members_client import \
- ImageMembersClient as ImageMembersClientV2
-from tempest.lib.services.image.v2.images_client import \
- ImagesClient as ImagesV2Client
-from tempest.lib.services.image.v2.namespaces_client import NamespacesClient
-from tempest.lib.services.image.v2.resource_types_client import \
- ResourceTypesClient
-from tempest.lib.services.image.v2.schemas_client import SchemasClient
from tempest.lib.services import network
from tempest import manager
-from tempest.services.baremetal.v1.json.baremetal_client import \
- BaremetalClient
-from tempest.services.data_processing.v1_1.data_processing_client import \
- DataProcessingClient
-from tempest.services.database.json.flavors_client import \
- DatabaseFlavorsClient
-from tempest.services.database.json.limits_client import \
- DatabaseLimitsClient
-from tempest.services.database.json.versions_client import \
- DatabaseVersionsClient
-from tempest.services.identity.v2.json.identity_client import IdentityClient
-from tempest.services.identity.v2.json.roles_client import RolesClient
-from tempest.services.identity.v2.json.services_client import \
- ServicesClient as IdentityServicesClient
-from tempest.services.identity.v2.json.tenants_client import TenantsClient
-from tempest.services.identity.v2.json.users_client import UsersClient
-from tempest.services.identity.v3.json.credentials_client import \
- CredentialsClient
-from tempest.services.identity.v3.json.domains_client import DomainsClient
-from tempest.services.identity.v3.json.endpoints_client import \
- EndPointsClient as EndPointsV3Client
-from tempest.services.identity.v3.json.groups_client import GroupsClient
-from tempest.services.identity.v3.json.identity_client import \
- IdentityClient as IdentityV3Client
-from tempest.services.identity.v3.json.policies_client import PoliciesClient
-from tempest.services.identity.v3.json.projects_client import ProjectsClient
-from tempest.services.identity.v3.json.regions_client import RegionsClient
-from tempest.services.identity.v3.json.roles_client import \
- RolesClient as RolesV3Client
-from tempest.services.identity.v3.json.services_client import \
- ServicesClient as IdentityServicesV3Client
-from tempest.services.identity.v3.json.trusts_client import TrustsClient
-from tempest.services.identity.v3.json.users_clients import \
- UsersClient as UsersV3Client
-from tempest.services.image.v1.json.images_client import ImagesClient
-from tempest.services.object_storage.account_client import AccountClient
-from tempest.services.object_storage.container_client import ContainerClient
-from tempest.services.object_storage.object_client import ObjectClient
-from tempest.services.orchestration.json.orchestration_client import \
- OrchestrationClient
-from tempest.services.volume.v1.json.admin.hosts_client import \
- HostsClient as VolumeHostsClient
-from tempest.services.volume.v1.json.admin.quotas_client import \
- QuotasClient as VolumeQuotasClient
-from tempest.services.volume.v1.json.admin.services_client import \
- ServicesClient as VolumeServicesClient
-from tempest.services.volume.v1.json.admin.types_client import \
- TypesClient as VolumeTypesClient
-from tempest.services.volume.v1.json.availability_zone_client import \
- AvailabilityZoneClient as VolumeAvailabilityZoneClient
-from tempest.services.volume.v1.json.backups_client import BackupsClient
-from tempest.services.volume.v1.json.extensions_client import \
- ExtensionsClient as VolumeExtensionsClient
-from tempest.services.volume.v1.json.qos_client import QosSpecsClient
-from tempest.services.volume.v1.json.snapshots_client import SnapshotsClient
-from tempest.services.volume.v1.json.volumes_client import VolumesClient
-from tempest.services.volume.v2.json.admin.hosts_client import \
- HostsClient as VolumeHostsV2Client
-from tempest.services.volume.v2.json.admin.quotas_client import \
- QuotasClient as VolumeQuotasV2Client
-from tempest.services.volume.v2.json.admin.services_client import \
- ServicesClient as VolumeServicesV2Client
-from tempest.services.volume.v2.json.admin.types_client import \
- TypesClient as VolumeTypesV2Client
-from tempest.services.volume.v2.json.availability_zone_client import \
- AvailabilityZoneClient as VolumeAvailabilityZoneV2Client
-from tempest.services.volume.v2.json.backups_client import \
- BackupsClient as BackupsV2Client
-from tempest.services.volume.v2.json.extensions_client import \
- ExtensionsClient as VolumeExtensionsV2Client
-from tempest.services.volume.v2.json.qos_client import \
- QosSpecsClient as QosSpecsV2Client
-from tempest.services.volume.v2.json.snapshots_client import \
- SnapshotsClient as SnapshotsV2Client
-from tempest.services.volume.v2.json.volumes_client import \
- VolumesClient as VolumesV2Client
-from tempest.services.volume.v3.json.messages_client import MessagesClient
+from tempest.services import baremetal
+from tempest.services import data_processing
+from tempest.services import database
+from tempest.services import identity
+from tempest.services import image
+from tempest.services import object_storage
+from tempest.services import orchestration
+from tempest.services import volume
CONF = config.CONF
LOG = logging.getLogger(__name__)
@@ -153,13 +71,13 @@
self._set_image_clients()
self._set_network_clients()
- self.baremetal_client = BaremetalClient(
+ self.baremetal_client = baremetal.BaremetalClient(
self.auth_provider,
CONF.baremetal.catalog_type,
CONF.identity.region,
endpoint_type=CONF.baremetal.endpoint_type,
**self.default_params_with_timeout_values)
- self.orchestration_client = OrchestrationClient(
+ self.orchestration_client = orchestration.OrchestrationClient(
self.auth_provider,
CONF.orchestration.catalog_type,
CONF.orchestration.region or CONF.identity.region,
@@ -167,7 +85,7 @@
build_interval=CONF.orchestration.build_interval,
build_timeout=CONF.orchestration.build_timeout,
**self.default_params)
- self.data_processing_client = DataProcessingClient(
+ self.data_processing_client = data_processing.DataProcessingClient(
self.auth_provider,
CONF.data_processing.catalog_type,
CONF.identity.region,
@@ -225,19 +143,19 @@
params.update(self.default_params)
if CONF.service_available.glance:
- self.image_client = ImagesClient(
+ self.image_client = image.v1.ImagesClient(
self.auth_provider, **params)
- self.image_member_client = ImageMembersClient(
+ self.image_member_client = image.v1.ImageMembersClient(
self.auth_provider, **params)
- self.image_client_v2 = ImagesV2Client(
+ self.image_client_v2 = image.v2.ImagesClient(
self.auth_provider, **params)
- self.image_member_client_v2 = ImageMembersClientV2(
+ self.image_member_client_v2 = image.v2.ImageMembersClient(
self.auth_provider, **params)
- self.namespaces_client = NamespacesClient(
+ self.namespaces_client = image.v2.NamespacesClient(
self.auth_provider, **params)
- self.resource_types_client = ResourceTypesClient(
+ self.resource_types_client = image.v2.ResourceTypesClient(
self.auth_provider, **params)
- self.schemas_client = SchemasClient(
+ self.schemas_client = image.v2.SchemasClient(
self.auth_provider, **params)
def _set_compute_clients(self):
@@ -326,17 +244,17 @@
self.auth_provider, **params_volume)
def _set_database_clients(self):
- self.database_flavors_client = DatabaseFlavorsClient(
+ self.database_flavors_client = database.DatabaseFlavorsClient(
self.auth_provider,
CONF.database.catalog_type,
CONF.identity.region,
**self.default_params_with_timeout_values)
- self.database_limits_client = DatabaseLimitsClient(
+ self.database_limits_client = database.DatabaseLimitsClient(
self.auth_provider,
CONF.database.catalog_type,
CONF.identity.region,
**self.default_params_with_timeout_values)
- self.database_versions_client = DatabaseVersionsClient(
+ self.database_versions_client = database.DatabaseVersionsClient(
self.auth_provider,
CONF.database.catalog_type,
CONF.identity.region,
@@ -352,62 +270,71 @@
# Clients below use the admin endpoint type of Keystone API v2
params_v2_admin = params.copy()
params_v2_admin['endpoint_type'] = CONF.identity.v2_admin_endpoint_type
- self.endpoints_client = EndpointsClient(self.auth_provider,
- **params_v2_admin)
- self.identity_client = IdentityClient(self.auth_provider,
- **params_v2_admin)
- self.tenants_client = TenantsClient(self.auth_provider,
- **params_v2_admin)
- self.roles_client = RolesClient(self.auth_provider, **params_v2_admin)
- self.users_client = UsersClient(self.auth_provider, **params_v2_admin)
- self.identity_services_client = IdentityServicesClient(
+ self.endpoints_client = identity.v2.EndpointsClient(self.auth_provider,
+ **params_v2_admin)
+ self.identity_client = identity.v2.IdentityClient(self.auth_provider,
+ **params_v2_admin)
+ self.tenants_client = identity.v2.TenantsClient(self.auth_provider,
+ **params_v2_admin)
+ self.roles_client = identity.v2.RolesClient(self.auth_provider,
+ **params_v2_admin)
+ self.users_client = identity.v2.UsersClient(self.auth_provider,
+ **params_v2_admin)
+ self.identity_services_client = identity.v2.ServicesClient(
self.auth_provider, **params_v2_admin)
# Clients below use the public endpoint type of Keystone API v2
params_v2_public = params.copy()
params_v2_public['endpoint_type'] = (
CONF.identity.v2_public_endpoint_type)
- self.identity_public_client = IdentityClient(self.auth_provider,
- **params_v2_public)
- self.tenants_public_client = TenantsClient(self.auth_provider,
- **params_v2_public)
- self.users_public_client = UsersClient(self.auth_provider,
- **params_v2_public)
+ self.identity_public_client = identity.v2.IdentityClient(
+ self.auth_provider, **params_v2_public)
+ self.tenants_public_client = identity.v2.TenantsClient(
+ self.auth_provider, **params_v2_public)
+ self.users_public_client = identity.v2.UsersClient(
+ self.auth_provider, **params_v2_public)
# Clients below use the endpoint type of Keystone API v3
params_v3 = params.copy()
params_v3['endpoint_type'] = CONF.identity.v3_endpoint_type
- self.domains_client = DomainsClient(self.auth_provider,
- **params_v3)
- self.identity_v3_client = IdentityV3Client(self.auth_provider,
- **params_v3)
- self.trusts_client = TrustsClient(self.auth_provider, **params_v3)
- self.users_v3_client = UsersV3Client(self.auth_provider, **params_v3)
- self.endpoints_v3_client = EndPointsV3Client(self.auth_provider,
- **params_v3)
- self.roles_v3_client = RolesV3Client(self.auth_provider, **params_v3)
- self.identity_services_v3_client = IdentityServicesV3Client(
+ self.domains_client = identity.v3.DomainsClient(self.auth_provider,
+ **params_v3)
+ self.identity_v3_client = identity.v3.IdentityClient(
self.auth_provider, **params_v3)
- self.policies_client = PoliciesClient(self.auth_provider, **params_v3)
- self.projects_client = ProjectsClient(self.auth_provider, **params_v3)
- self.regions_client = RegionsClient(self.auth_provider, **params_v3)
- self.credentials_client = CredentialsClient(self.auth_provider,
- **params_v3)
- self.groups_client = GroupsClient(self.auth_provider, **params_v3)
+ self.trusts_client = identity.v3.TrustsClient(self.auth_provider,
+ **params_v3)
+ self.users_v3_client = identity.v3.UsersClient(self.auth_provider,
+ **params_v3)
+ self.endpoints_v3_client = identity.v3.EndPointsClient(
+ self.auth_provider, **params_v3)
+ self.roles_v3_client = identity.v3.RolesClient(self.auth_provider,
+ **params_v3)
+ self.identity_services_v3_client = identity.v3.ServicesClient(
+ self.auth_provider, **params_v3)
+ self.policies_client = identity.v3.PoliciesClient(self.auth_provider,
+ **params_v3)
+ self.projects_client = identity.v3.ProjectsClient(self.auth_provider,
+ **params_v3)
+ self.regions_client = identity.v3.RegionsClient(self.auth_provider,
+ **params_v3)
+ self.credentials_client = identity.v3.CredentialsClient(
+ self.auth_provider, **params_v3)
+ self.groups_client = identity.v3.GroupsClient(self.auth_provider,
+ **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
# API version is marked as enabled
if CONF.identity_feature_enabled.api_v2:
if CONF.identity.uri:
- self.token_client = TokenClient(
+ self.token_client = identity.v2.TokenClient(
CONF.identity.uri, **self.default_params)
else:
msg = 'Identity v2 API enabled, but no identity.uri set'
raise exceptions.InvalidConfiguration(msg)
if CONF.identity_feature_enabled.api_v3:
if CONF.identity.uri_v3:
- self.token_v3_client = V3TokenClient(
+ self.token_v3_client = identity.v3.V3TokenClient(
CONF.identity.uri_v3, **self.default_params)
else:
msg = 'Identity v3 API enabled, but no identity.uri_v3 set'
@@ -423,49 +350,50 @@
}
params.update(self.default_params)
- self.volume_qos_client = QosSpecsClient(self.auth_provider,
- **params)
- self.volume_qos_v2_client = QosSpecsV2Client(
+ self.volume_qos_client = volume.v1.QosSpecsClient(self.auth_provider,
+ **params)
+ self.volume_qos_v2_client = volume.v2.QosSpecsClient(
self.auth_provider, **params)
- self.volume_services_client = VolumeServicesClient(
+ self.volume_services_client = volume.v1.ServicesClient(
self.auth_provider, **params)
- self.volume_services_v2_client = VolumeServicesV2Client(
+ self.volume_services_v2_client = volume.v2.ServicesClient(
self.auth_provider, **params)
- self.backups_client = BackupsClient(self.auth_provider, **params)
- self.backups_v2_client = BackupsV2Client(self.auth_provider,
- **params)
- self.snapshots_client = SnapshotsClient(self.auth_provider,
- **params)
- self.snapshots_v2_client = SnapshotsV2Client(self.auth_provider,
- **params)
- self.volumes_client = VolumesClient(
+ self.backups_client = volume.v1.BackupsClient(self.auth_provider,
+ **params)
+ self.backups_v2_client = volume.v2.BackupsClient(self.auth_provider,
+ **params)
+ self.snapshots_client = volume.v1.SnapshotsClient(self.auth_provider,
+ **params)
+ self.snapshots_v2_client = volume.v2.SnapshotsClient(
+ self.auth_provider, **params)
+ self.volumes_client = volume.v1.VolumesClient(
self.auth_provider, default_volume_size=CONF.volume.volume_size,
**params)
- self.volumes_v2_client = VolumesV2Client(
+ self.volumes_v2_client = volume.v2.VolumesClient(
self.auth_provider, default_volume_size=CONF.volume.volume_size,
**params)
- self.volume_messages_client = MessagesClient(self.auth_provider,
- **params)
- self.volume_types_client = VolumeTypesClient(self.auth_provider,
- **params)
- self.volume_types_v2_client = VolumeTypesV2Client(
+ self.volume_messages_client = volume.v3.MessagesClient(
self.auth_provider, **params)
- self.volume_hosts_client = VolumeHostsClient(self.auth_provider,
- **params)
- self.volume_hosts_v2_client = VolumeHostsV2Client(
- self.auth_provider, **params)
- self.volume_quotas_client = VolumeQuotasClient(self.auth_provider,
- **params)
- self.volume_quotas_v2_client = VolumeQuotasV2Client(self.auth_provider,
+ self.volume_types_client = volume.v1.TypesClient(self.auth_provider,
+ **params)
+ self.volume_types_v2_client = volume.v2.TypesClient(self.auth_provider,
**params)
- self.volumes_extension_client = VolumeExtensionsClient(
+ self.volume_hosts_client = volume.v1.HostsClient(self.auth_provider,
+ **params)
+ self.volume_hosts_v2_client = volume.v2.HostsClient(self.auth_provider,
+ **params)
+ self.volume_quotas_client = volume.v1.QuotasClient(self.auth_provider,
+ **params)
+ self.volume_quotas_v2_client = volume.v2.QuotasClient(
self.auth_provider, **params)
- self.volumes_v2_extension_client = VolumeExtensionsV2Client(
+ self.volumes_extension_client = volume.v1.ExtensionsClient(
+ self.auth_provider, **params)
+ self.volumes_v2_extension_client = volume.v2.ExtensionsClient(
self.auth_provider, **params)
self.volume_availability_zone_client = \
- VolumeAvailabilityZoneClient(self.auth_provider, **params)
+ volume.v1.AvailabilityZoneClient(self.auth_provider, **params)
self.volume_v2_availability_zone_client = \
- VolumeAvailabilityZoneV2Client(self.auth_provider, **params)
+ volume.v2.AvailabilityZoneClient(self.auth_provider, **params)
def _set_object_storage_clients(self):
params = {
@@ -475,6 +403,9 @@
}
params.update(self.default_params_with_timeout_values)
- self.account_client = AccountClient(self.auth_provider, **params)
- self.container_client = ContainerClient(self.auth_provider, **params)
- self.object_client = ObjectClient(self.auth_provider, **params)
+ self.account_client = object_storage.AccountClient(self.auth_provider,
+ **params)
+ self.container_client = object_storage.ContainerClient(
+ self.auth_provider, **params)
+ self.object_client = object_storage.ObjectClient(self.auth_provider,
+ **params)
diff --git a/tempest/cmd/init.py b/tempest/cmd/init.py
index 77d62d3..b9db989 100644
--- a/tempest/cmd/init.py
+++ b/tempest/cmd/init.py
@@ -138,6 +138,8 @@
"config dir %s can't be found" % config_dir)
def create_working_dir(self, local_dir, config_dir):
+ # make sure we are working with abspath however tempest init is called
+ local_dir = os.path.abspath(local_dir)
# Create local dir if missing
if not os.path.isdir(local_dir):
LOG.debug('Creating local working dir: %s' % local_dir)
diff --git a/tempest/lib/services/compute/aggregates_client.py b/tempest/lib/services/compute/aggregates_client.py
index 168126c..ae747d8 100644
--- a/tempest/lib/services/compute/aggregates_client.py
+++ b/tempest/lib/services/compute/aggregates_client.py
@@ -108,7 +108,11 @@
return rest_client.ResponseBody(resp, body)
def set_metadata(self, aggregate_id, **kwargs):
- """Replace the aggregate's existing metadata with new metadata."""
+ """Replace the aggregate's existing metadata with new metadata.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-compute-v2.1.html#addAggregateMetadata
+ """
post_body = json.dumps({'set_metadata': kwargs})
resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
post_body)
diff --git a/tempest/lib/services/image/v2/__init__.py b/tempest/lib/services/image/v2/__init__.py
index e69de29..32bad8b 100644
--- a/tempest/lib/services/image/v2/__init__.py
+++ b/tempest/lib/services/image/v2/__init__.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.lib.services.image.v2.image_members_client import \
+ ImageMembersClient
+from tempest.lib.services.image.v2.images_client import ImagesClient
+from tempest.lib.services.image.v2.namespaces_client import NamespacesClient
+from tempest.lib.services.image.v2.resource_types_client import \
+ ResourceTypesClient
+from tempest.lib.services.image.v2.schemas_client import SchemasClient
+
+__all__ = ['ImageMembersClient', 'ImagesClient', 'NamespacesClient',
+ 'ResourceTypesClient', 'SchemasClient']
diff --git a/tempest/services/baremetal/__init__.py b/tempest/services/baremetal/__init__.py
index e69de29..390f40a 100644
--- a/tempest/services/baremetal/__init__.py
+++ b/tempest/services/baremetal/__init__.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.baremetal.v1.json.baremetal_client import \
+ BaremetalClient
+
+__all__ = ['BaremetalClient']
diff --git a/tempest/services/data_processing/__init__.py b/tempest/services/data_processing/__init__.py
index e69de29..c49bc5c 100644
--- a/tempest/services/data_processing/__init__.py
+++ b/tempest/services/data_processing/__init__.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.data_processing.v1_1.data_processing_client import \
+ DataProcessingClient
+
+__all__ = ['DataProcessingClient']
diff --git a/tempest/services/database/__init__.py b/tempest/services/database/__init__.py
index e69de29..9a742d8 100644
--- a/tempest/services/database/__init__.py
+++ b/tempest/services/database/__init__.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.database.json.flavors_client import \
+ DatabaseFlavorsClient
+from tempest.services.database.json.limits_client import \
+ DatabaseLimitsClient
+from tempest.services.database.json.versions_client import \
+ DatabaseVersionsClient
+
+__all__ = ['DatabaseFlavorsClient', 'DatabaseLimitsClient',
+ 'DatabaseVersionsClient']
diff --git a/tempest/services/identity/__init__.py b/tempest/services/identity/__init__.py
index e69de29..0e24926 100644
--- a/tempest/services/identity/__init__.py
+++ b/tempest/services/identity/__init__.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.identity import v2
+from tempest.services.identity import v3
+
+__all__ = ['v2', 'v3']
diff --git a/tempest/services/identity/v2/__init__.py b/tempest/services/identity/v2/__init__.py
index e69de29..6f4ebcf 100644
--- a/tempest/services/identity/v2/__init__.py
+++ b/tempest/services/identity/v2/__init__.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.lib.services.identity.v2.endpoints_client import EndpointsClient
+from tempest.lib.services.identity.v2.token_client import TokenClient
+from tempest.services.identity.v2.json.identity_client import IdentityClient
+from tempest.services.identity.v2.json.roles_client import RolesClient
+from tempest.services.identity.v2.json.services_client import ServicesClient
+from tempest.services.identity.v2.json.tenants_client import TenantsClient
+from tempest.services.identity.v2.json.users_client import UsersClient
+
+__all__ = ['EndpointsClient', 'TokenClient', 'IdentityClient', 'RolesClient',
+ 'ServicesClient', 'TenantsClient', 'UsersClient']
diff --git a/tempest/services/identity/v2/json/users_client.py b/tempest/services/identity/v2/json/users_client.py
index 1048840..4ea17f9 100644
--- a/tempest/services/identity/v2/json/users_client.py
+++ b/tempest/services/identity/v2/json/users_client.py
@@ -78,7 +78,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def enable_disable_user(self, user_id, **kwargs):
+ def update_user_enabled(self, user_id, **kwargs):
"""Enables or disables a user.
Available params: see http://developer.openstack.org/
@@ -121,7 +121,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def create_user_ec2_credentials(self, user_id, **kwargs):
+ def create_user_ec2_credential(self, user_id, **kwargs):
# TODO(piyush): Current api-site doesn't contain this API description.
# After fixing the api-site, we need to fix here also for putting the
# link to api-site.
@@ -132,7 +132,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def delete_user_ec2_credentials(self, user_id, access):
+ 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)
@@ -144,7 +144,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def show_user_ec2_credentials(self, user_id, access):
+ 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)
diff --git a/tempest/services/identity/v3/__init__.py b/tempest/services/identity/v3/__init__.py
index e69de29..144c5a9 100644
--- a/tempest/services/identity/v3/__init__.py
+++ b/tempest/services/identity/v3/__init__.py
@@ -0,0 +1,33 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.lib.services.identity.v3.token_client import V3TokenClient
+from tempest.services.identity.v3.json.credentials_client import \
+ CredentialsClient
+from tempest.services.identity.v3.json.domains_client import DomainsClient
+from tempest.services.identity.v3.json.endpoints_client import EndPointsClient
+from tempest.services.identity.v3.json.groups_client import GroupsClient
+from tempest.services.identity.v3.json.identity_client import IdentityClient
+from tempest.services.identity.v3.json.policies_client import PoliciesClient
+from tempest.services.identity.v3.json.projects_client import ProjectsClient
+from tempest.services.identity.v3.json.regions_client import RegionsClient
+from tempest.services.identity.v3.json.roles_client import RolesClient
+from tempest.services.identity.v3.json.services_client import ServicesClient
+from tempest.services.identity.v3.json.trusts_client import TrustsClient
+from tempest.services.identity.v3.json.users_clients import UsersClient
+
+__all__ = ['V3TokenClient', 'CredentialsClient', 'DomainsClient',
+ 'EndPointsClient', 'GroupsClient', 'IdentityClient',
+ 'PoliciesClient', 'ProjectsClient', 'RegionsClient', 'RolesClient',
+ 'ServicesClient', 'TrustsClient', 'UsersClient', ]
diff --git a/tempest/services/image/__init__.py b/tempest/services/image/__init__.py
index e69de29..7ff0886 100644
--- a/tempest/services/image/__init__.py
+++ b/tempest/services/image/__init__.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.lib.services.image import v2
+from tempest.services.image import v1
+
+__all__ = ['v1', 'v2']
diff --git a/tempest/services/image/v1/__init__.py b/tempest/services/image/v1/__init__.py
index e69de29..67dca39 100644
--- a/tempest/services/image/v1/__init__.py
+++ b/tempest/services/image/v1/__init__.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.lib.services.image.v1.image_members_client import \
+ ImageMembersClient
+from tempest.services.image.v1.json.images_client import ImagesClient
+
+__all__ = ['ImageMembersClient', 'ImagesClient']
diff --git a/tempest/services/object_storage/__init__.py b/tempest/services/object_storage/__init__.py
index e69de29..96fe4a3 100644
--- a/tempest/services/object_storage/__init__.py
+++ b/tempest/services/object_storage/__init__.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.object_storage.account_client import AccountClient
+from tempest.services.object_storage.container_client import ContainerClient
+from tempest.services.object_storage.object_client import ObjectClient
+
+__all__ = ['AccountClient', 'ContainerClient', 'ObjectClient']
diff --git a/tempest/services/orchestration/__init__.py b/tempest/services/orchestration/__init__.py
index e69de29..5a1ffcc 100644
--- a/tempest/services/orchestration/__init__.py
+++ b/tempest/services/orchestration/__init__.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.orchestration.json.orchestration_client import \
+ OrchestrationClient
+
+__all__ = ['OrchestrationClient']
diff --git a/tempest/services/volume/__init__.py b/tempest/services/volume/__init__.py
index e69de29..4d29cdd 100644
--- a/tempest/services/volume/__init__.py
+++ b/tempest/services/volume/__init__.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.volume import v1
+from tempest.services.volume import v2
+from tempest.services.volume import v3
+
+__all__ = ['v1', 'v2', 'v3']
diff --git a/tempest/services/volume/base/base_volumes_client.py b/tempest/services/volume/base/base_volumes_client.py
index 6237745..a3a4eb6 100644
--- a/tempest/services/volume/base/base_volumes_client.py
+++ b/tempest/services/volume/base/base_volumes_client.py
@@ -299,6 +299,23 @@
self.expected_success(200, resp.status)
return rest_client.ResponseBody(resp, body)
+ def update_volume_image_metadata(self, volume_id, **kwargs):
+ """Update image metadata for the volume."""
+ post_body = json.dumps({'os-set_image_metadata': {'metadata': kwargs}})
+ url = "volumes/%s/action" % (volume_id)
+ resp, body = self.post(url, post_body)
+ body = json.loads(body)
+ self.expected_success(200, resp.status)
+ return rest_client.ResponseBody(resp, body)
+
+ def delete_volume_image_metadata(self, volume_id, key_name):
+ """Delete image metadata item for the volume."""
+ post_body = json.dumps({'os-unset_image_metadata': {'key': key_name}})
+ url = "volumes/%s/action" % (volume_id)
+ resp, body = self.post(url, post_body)
+ self.expected_success(200, resp.status)
+ return rest_client.ResponseBody(resp, body)
+
def retype_volume(self, volume_id, **kwargs):
"""Updates volume with new volume type."""
post_body = json.dumps({'os-retype': kwargs})
diff --git a/tempest/services/volume/v1/__init__.py b/tempest/services/volume/v1/__init__.py
index e69de29..6bdb8c4 100644
--- a/tempest/services/volume/v1/__init__.py
+++ b/tempest/services/volume/v1/__init__.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.volume.v1.json.admin.hosts_client import HostsClient
+from tempest.services.volume.v1.json.admin.quotas_client import QuotasClient
+from tempest.services.volume.v1.json.admin.services_client import \
+ ServicesClient
+from tempest.services.volume.v1.json.admin.types_client import TypesClient
+from tempest.services.volume.v1.json.availability_zone_client import \
+ AvailabilityZoneClient
+from tempest.services.volume.v1.json.backups_client import BackupsClient
+from tempest.services.volume.v1.json.extensions_client import ExtensionsClient
+from tempest.services.volume.v1.json.qos_client import QosSpecsClient
+from tempest.services.volume.v1.json.snapshots_client import SnapshotsClient
+from tempest.services.volume.v1.json.volumes_client import VolumesClient
+
+__all__ = ['HostsClient', 'QuotasClient', 'ServicesClient', 'TypesClient',
+ 'AvailabilityZoneClient', 'BackupsClient', 'ExtensionsClient',
+ 'QosSpecsClient', 'SnapshotsClient', 'VolumesClient']
diff --git a/tempest/services/volume/v2/__init__.py b/tempest/services/volume/v2/__init__.py
index e69de29..c75b0e5 100644
--- a/tempest/services/volume/v2/__init__.py
+++ b/tempest/services/volume/v2/__init__.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.volume.v2.json.admin.hosts_client import HostsClient
+from tempest.services.volume.v2.json.admin.quotas_client import QuotasClient
+from tempest.services.volume.v2.json.admin.services_client import \
+ ServicesClient
+from tempest.services.volume.v2.json.admin.types_client import TypesClient
+from tempest.services.volume.v2.json.availability_zone_client import \
+ AvailabilityZoneClient
+from tempest.services.volume.v2.json.backups_client import BackupsClient
+from tempest.services.volume.v2.json.extensions_client import ExtensionsClient
+from tempest.services.volume.v2.json.qos_client import QosSpecsClient
+from tempest.services.volume.v2.json.snapshots_client import SnapshotsClient
+from tempest.services.volume.v2.json.volumes_client import VolumesClient
+
+__all__ = ['HostsClient', 'QuotasClient', 'ServicesClient', 'TypesClient',
+ 'AvailabilityZoneClient', 'BackupsClient', 'ExtensionsClient',
+ 'QosSpecsClient', 'SnapshotsClient', 'VolumesClient']
diff --git a/tempest/services/volume/v3/__init__.py b/tempest/services/volume/v3/__init__.py
index e69de29..d50098c 100644
--- a/tempest/services/volume/v3/__init__.py
+++ b/tempest/services/volume/v3/__init__.py
@@ -0,0 +1,17 @@
+# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+from tempest.services.volume.v3.json.messages_client import MessagesClient
+
+__all__ = ['MessagesClient']