Changing directory structure for Cinder clients

The tempest/services/volume directory had the following structure:

        tempest
        |___services
            |___volume
                |____json
                |    |____admin
                |    |    |____<client files>
                |    |
                |    |____<client files>
                |
                |____v2
                     |____json
                          |____admin
                          |    |____<client files>
                          |
                          |____<client files>

The structure was changed to keep consistency with other clients directories.
For example, the tempest/services/identity derectory and the tempest/services/image
directory. So now the structure is the following:

        tempest
        |___services
            |___volume
                |____base
                |    |____<client files>
                |
                |____v1
                |    |____json
                |         |____admin
                |         |    |____<client files>
                |         |
                |         |____<client files>
                |
                |____v2
                     |____json
                          |____admin
                          |    |____<client files>
                          |
                          |____<client files>

The tempest/services/volume/base directory was created and now it containes base
client files with base client classes for v1 and v2 Cinder clients.

Change-Id: I0ac37e15eddffb12d150dcd5b68e0f933712d22c
This commit is contained in:
Yaroslav Lobankov 2015-11-28 20:04:54 +03:00
parent d160c29b7e
commit db4a2e162f
40 changed files with 243 additions and 88 deletions

View File

@ -119,22 +119,22 @@ from tempest.services.orchestration.json.orchestration_client import \
from tempest.services.telemetry.json.alarming_client import AlarmingClient
from tempest.services.telemetry.json.telemetry_client import \
TelemetryClient
from tempest.services.volume.json.admin.volume_hosts_client import \
from tempest.services.volume.v1.json.admin.volume_hosts_client import \
VolumeHostsClient
from tempest.services.volume.json.admin.volume_quotas_client import \
from tempest.services.volume.v1.json.admin.volume_quotas_client import \
VolumeQuotasClient
from tempest.services.volume.json.admin.volume_services_client import \
from tempest.services.volume.v1.json.admin.volume_services_client import \
VolumesServicesClient
from tempest.services.volume.json.admin.volume_types_client import \
from tempest.services.volume.v1.json.admin.volume_types_client import \
VolumeTypesClient
from tempest.services.volume.json.availability_zone_client import \
from tempest.services.volume.v1.json.availability_zone_client import \
VolumeAvailabilityZoneClient
from tempest.services.volume.json.backups_client import BackupsClient
from tempest.services.volume.json.extensions_client import \
from tempest.services.volume.v1.json.backups_client import BackupsClient
from tempest.services.volume.v1.json.extensions_client import \
ExtensionsClient as VolumeExtensionClient
from tempest.services.volume.json.qos_client import QosSpecsClient
from tempest.services.volume.json.snapshots_client import SnapshotsClient
from tempest.services.volume.json.volumes_client import VolumesClient
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.volume_hosts_client import \
VolumeHostsV2Client
from tempest.services.volume.v2.json.admin.volume_quotas_client import \

View File

@ -135,7 +135,7 @@ from tempest.services.object_storage import container_client
from tempest.services.object_storage import object_client
from tempest.services.telemetry.json import alarming_client
from tempest.services.telemetry.json import telemetry_client
from tempest.services.volume.json import volumes_client
from tempest.services.volume.v1.json import volumes_client
CONF = config.CONF
OPTS = {}

View File

@ -7,6 +7,6 @@
./tempest/services/object_storage/object_client.py
./tempest/services/telemetry/json/alarming_client.py
./tempest/services/telemetry/json/telemetry_client.py
./tempest/services/volume/json/qos_client.py
./tempest/services/volume/json/backups_client.py
./tempest/services/volume/base/base_qos_client.py
./tempest/services/volume/base/base_backups_client.py
./tempest/services/baremetal/base.py

View File

@ -33,7 +33,3 @@ class BaseVolumeHostsClient(service_client.ServiceClient):
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body)
class VolumeHostsClient(BaseVolumeHostsClient):
"""Client class to send CRUD Volume Host API V1 requests"""

View File

@ -74,7 +74,3 @@ class BaseVolumeQuotasClient(service_client.ServiceClient):
resp, body = self.delete('os-quota-sets/%s' % tenant_id)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body)
class VolumeQuotasClient(BaseVolumeQuotasClient):
"""Client class to send CRUD Volume Type API V1 requests"""

View File

@ -30,7 +30,3 @@ class BaseVolumesServicesClient(service_client.ServiceClient):
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body)
class VolumesServicesClient(BaseVolumesServicesClient):
"""Volume V1 volume services client"""

View File

@ -182,7 +182,3 @@ class BaseVolumeTypesClient(service_client.ServiceClient):
"/types/%s/encryption/provider" % str(vol_type_id))
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body)
class VolumeTypesClient(BaseVolumeTypesClient):
"""Volume V1 Volume Types client"""

View File

@ -25,7 +25,3 @@ class BaseVolumeAvailabilityZoneClient(service_client.ServiceClient):
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body)
class VolumeAvailabilityZoneClient(BaseVolumeAvailabilityZoneClient):
"""Volume V1 availability zone client."""

View File

@ -16,7 +16,6 @@
import time
from oslo_serialization import jsonutils as json
from tempest_lib import exceptions as lib_exc
from tempest.common import service_client
@ -124,7 +123,3 @@ class BaseBackupsClient(service_client.ServiceClient):
if int(time.time()) - start_time >= self.build_timeout:
raise exceptions.TimeoutException
time.sleep(self.build_interval)
class BackupsClient(BaseBackupsClient):
"""Volume V1 Backups client"""

View File

@ -26,7 +26,3 @@ class BaseExtensionsClient(service_client.ServiceClient):
body = json.loads(body)
self.expected_success(200, resp.status)
return service_client.ResponseBody(resp, body)
class ExtensionsClient(BaseExtensionsClient):
"""Volume V1 extensions client."""

View File

@ -155,7 +155,3 @@ class BaseQosSpecsClient(service_client.ServiceClient):
resp, body = self.get(url)
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body)
class QosSpecsClient(BaseQosSpecsClient):
"""Volume V1 QoS client."""

View File

@ -196,7 +196,3 @@ class BaseSnapshotsClient(service_client.ServiceClient):
resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body)
self.expected_success(202, resp.status)
return service_client.ResponseBody(resp, body)
class SnapshotsClient(BaseSnapshotsClient):
"""Client class to send CRUD Volume V1 API requests."""

View File

@ -334,7 +334,3 @@ class BaseVolumesClient(service_client.ServiceClient):
post_body = json.dumps({'os-retype': post_body})
resp, body = self.post('volumes/%s/action' % volume_id, post_body)
self.expected_success(202, resp.status)
class VolumesClient(BaseVolumesClient):
"""Client class to send CRUD Volume V1 API requests"""

View File

View File

@ -0,0 +1,20 @@
# Copyright 2013 OpenStack Foundation
# 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.services.volume.base.admin import base_volume_hosts_client
class VolumeHostsClient(base_volume_hosts_client.BaseVolumeHostsClient):
"""Client class to send CRUD Volume Host API V1 requests"""

View File

@ -0,0 +1,19 @@
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.base.admin import base_volume_quotas_client
class VolumeQuotasClient(base_volume_quotas_client.BaseVolumeQuotasClient):
"""Client class to send CRUD Volume Type API V1 requests"""

View File

@ -0,0 +1,21 @@
# Copyright 2014 NEC Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.base.admin import base_volume_services_client
class VolumesServicesClient(
base_volume_services_client.BaseVolumesServicesClient):
"""Volume V1 volume services client"""

View File

@ -0,0 +1,20 @@
# Copyright 2012 OpenStack Foundation
# 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.services.volume.base.admin import base_volume_types_client
class VolumeTypesClient(base_volume_types_client.BaseVolumeTypesClient):
"""Volume V1 Volume Types client"""

View File

@ -0,0 +1,21 @@
# Copyright 2014 NEC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.base import base_availability_zone_client
class VolumeAvailabilityZoneClient(
base_availability_zone_client.BaseVolumeAvailabilityZoneClient):
"""Volume V1 availability zone client."""

View File

@ -0,0 +1,20 @@
# Copyright 2014 OpenStack Foundation
# 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.services.volume.base import base_backups_client
class BackupsClient(base_backups_client.BaseBackupsClient):
"""Volume V1 Backups client"""

View File

@ -0,0 +1,20 @@
# Copyright 2012 OpenStack Foundation
# 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.services.volume.base import base_extensions_client
class ExtensionsClient(base_extensions_client.BaseExtensionsClient):
"""Volume V1 extensions client."""

View File

@ -0,0 +1,19 @@
# 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.services.volume.base import base_qos_client
class QosSpecsClient(base_qos_client.BaseQosSpecsClient):
"""Volume V1 QoS client."""

View File

@ -0,0 +1,17 @@
# 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.base import base_snapshots_client
class SnapshotsClient(base_snapshots_client.BaseSnapshotsClient):
"""Client class to send CRUD Volume V1 API requests."""

View File

@ -0,0 +1,20 @@
# Copyright 2012 OpenStack Foundation
# 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.services.volume.base import base_volumes_client
class VolumesClient(base_volumes_client.BaseVolumesClient):
"""Client class to send CRUD Volume V1 API requests"""

View File

@ -13,10 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json.admin import volume_hosts_client
from tempest.services.volume.base.admin import base_volume_hosts_client
class VolumeHostsV2Client(volume_hosts_client.BaseVolumeHostsClient):
class VolumeHostsV2Client(base_volume_hosts_client.BaseVolumeHostsClient):
"""Client class to send CRUD Volume V2 API requests"""
api_version = "v2"

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json.admin import volume_quotas_client
from tempest.services.volume.base.admin import base_volume_quotas_client
class VolumeQuotasV2Client(volume_quotas_client.BaseVolumeQuotasClient):
class VolumeQuotasV2Client(base_volume_quotas_client.BaseVolumeQuotasClient):
"""Client class to send CRUD Volume V2 API requests"""
api_version = "v2"

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json.admin import volume_services_client as vs_cli
from tempest.services.volume.base.admin import base_volume_services_client
class VolumesServicesV2Client(vs_cli.BaseVolumesServicesClient):
class VolumesServicesV2Client(
base_volume_services_client.BaseVolumesServicesClient):
"""Client class to send CRUD Volume V2 API requests"""
api_version = "v2"

View File

@ -13,10 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json.admin import volume_types_client
from tempest.services.volume.base.admin import base_volume_types_client
class VolumeTypesV2Client(volume_types_client.BaseVolumeTypesClient):
class VolumeTypesV2Client(base_volume_types_client.BaseVolumeTypesClient):
"""Client class to send CRUD Volume V2 API requests"""
api_version = "v2"

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json import availability_zone_client
from tempest.services.volume.base import base_availability_zone_client
class VolumeV2AvailabilityZoneClient(
availability_zone_client.BaseVolumeAvailabilityZoneClient):
base_availability_zone_client.BaseVolumeAvailabilityZoneClient):
api_version = "v2"

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json import backups_client
from tempest.services.volume.base import base_backups_client
class BackupsClientV2(backups_client.BaseBackupsClient):
class BackupsClientV2(base_backups_client.BaseBackupsClient):
"""Client class to send CRUD Volume V2 API requests"""
api_version = "v2"

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json import extensions_client
from tempest.services.volume.base import base_extensions_client
class ExtensionsV2Client(extensions_client.BaseExtensionsClient):
class ExtensionsV2Client(base_extensions_client.BaseExtensionsClient):
api_version = "v2"

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json import qos_client
from tempest.services.volume.base import base_qos_client
class QosSpecsV2Client(qos_client.BaseQosSpecsClient):
class QosSpecsV2Client(base_qos_client.BaseQosSpecsClient):
api_version = "v2"

View File

@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json import snapshots_client
from tempest.services.volume.base import base_snapshots_client
class SnapshotsV2Client(snapshots_client.BaseSnapshotsClient):
class SnapshotsV2Client(base_snapshots_client.BaseSnapshotsClient):
"""Client class to send CRUD Volume V2 API requests."""
api_version = "v2"
create_resp = 202

View File

@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.services.volume.json import volumes_client
from tempest.services.volume.base import base_volumes_client
class VolumesV2Client(volumes_client.BaseVolumesClient):
class VolumesV2Client(base_volumes_client.BaseVolumesClient):
"""Client class to send CRUD Volume V2 API requests"""
api_version = "v2"
create_resp = 202

View File

@ -46,18 +46,18 @@ from tempest.services.object_storage import object_client
from tempest.services.orchestration.json import orchestration_client
from tempest.services.telemetry.json import alarming_client
from tempest.services.telemetry.json import telemetry_client
from tempest.services.volume.json.admin import volume_hosts_client
from tempest.services.volume.json.admin import volume_quotas_client
from tempest.services.volume.json.admin import volume_services_client
from tempest.services.volume.json.admin import volume_types_client
from tempest.services.volume.json import availability_zone_client \
from tempest.services.volume.v1.json.admin import volume_hosts_client
from tempest.services.volume.v1.json.admin import volume_quotas_client
from tempest.services.volume.v1.json.admin import volume_services_client
from tempest.services.volume.v1.json.admin import volume_types_client
from tempest.services.volume.v1.json import availability_zone_client \
as volume_az_client
from tempest.services.volume.json import backups_client
from tempest.services.volume.json import extensions_client \
from tempest.services.volume.v1.json import backups_client
from tempest.services.volume.v1.json import extensions_client \
as volume_extensions_client
from tempest.services.volume.json import qos_client
from tempest.services.volume.json import snapshots_client
from tempest.services.volume.json import volumes_client
from tempest.services.volume.v1.json import qos_client
from tempest.services.volume.v1.json import snapshots_client
from tempest.services.volume.v1.json import volumes_client
from tempest.services.volume.v2.json.admin import volume_hosts_client \
as volume_v2_hosts_client
from tempest.services.volume.v2.json.admin import volume_quotas_client \

View File

@ -18,7 +18,7 @@ import mock
from tempest.common import waiters
from tempest import exceptions
from tempest.services.volume.json import volumes_client
from tempest.services.volume.base import base_volumes_client
from tempest.tests import base
@ -53,7 +53,7 @@ class TestImageWaiters(base.TestCase):
def test_wait_for_volume_status_error_restoring(self, mock_sleep):
# Tests that the wait method raises VolumeRestoreErrorException if
# the volume status is 'error_restoring'.
client = mock.Mock(spec=volumes_client.BaseVolumesClient,
client = mock.Mock(spec=base_volumes_client.BaseVolumesClient,
build_interval=1)
volume1 = {'volume': {'status': 'restoring-backup'}}
volume2 = {'volume': {'status': 'error_restoring'}}