Merge "enable cinder v2 api for test_volumes_backup"
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index bf014a8..1357d31 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -23,17 +23,16 @@
LOG = logging.getLogger(__name__)
-class VolumesBackupsTest(base.BaseVolumeV1AdminTest):
+class VolumesBackupsV2Test(base.BaseVolumeAdminTest):
_interface = "json"
@classmethod
def resource_setup(cls):
- super(VolumesBackupsTest, cls).resource_setup()
+ super(VolumesBackupsV2Test, cls).resource_setup()
if not CONF.volume_feature_enabled.backup:
raise cls.skipException("Cinder backup feature disabled")
- cls.backups_adm_client = cls.os_adm.backups_client
cls.volume = cls.create_volume()
@test.attr(type='smoke')
@@ -71,3 +70,7 @@
'available')
self.admin_volume_client.wait_for_volume_status(
restore['volume_id'], 'available')
+
+
+class VolumesBackupsV1Test(VolumesBackupsV2Test):
+ _api_version = 1
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index f9f03ac..5d99123 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -176,6 +176,7 @@
cls.admin_volume_client = cls.os_adm.volumes_client
cls.hosts_client = cls.os_adm.volume_hosts_client
cls.admin_snapshots_client = cls.os_adm.snapshots_client
+ cls.backups_adm_client = cls.os_adm.backups_client
elif cls._api_version == 2:
if not CONF.volume_feature_enabled.api_v2:
msg = "Volume API v2 is disabled"
@@ -185,6 +186,7 @@
cls.admin_volume_client = cls.os_adm.volumes_v2_client
cls.hosts_client = cls.os_adm.volume_hosts_v2_client
cls.admin_snapshots_client = cls.os_adm.snapshots_v2_client
+ cls.backups_adm_client = cls.os_adm.backups_v2_client
@classmethod
def resource_cleanup(cls):
diff --git a/tempest/clients.py b/tempest/clients.py
index 9546502..756614d 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -187,6 +187,7 @@
VolumeTypesV2ClientJSON
from tempest.services.volume.v2.json.availability_zone_client import \
VolumeV2AvailabilityZoneClientJSON
+from tempest.services.volume.v2.json.backups_client import BackupsClientV2JSON
from tempest.services.volume.v2.json.extensions_client import \
ExtensionsV2ClientJSON as VolumeV2ExtensionClientJSON
from tempest.services.volume.v2.json.qos_client import QosSpecsV2ClientJSON
@@ -436,6 +437,7 @@
def _set_volume_json_clients(self):
self.backups_client = BackupsClientJSON(self.auth_provider)
+ self.backups_v2_client = BackupsClientV2JSON(self.auth_provider)
self.snapshots_client = SnapshotsClientJSON(self.auth_provider)
self.snapshots_v2_client = SnapshotsV2ClientJSON(self.auth_provider)
self.volumes_client = VolumesClientJSON(self.auth_provider)
diff --git a/tempest/services/volume/json/backups_client.py b/tempest/services/volume/json/backups_client.py
index 63fc646..da47639 100644
--- a/tempest/services/volume/json/backups_client.py
+++ b/tempest/services/volume/json/backups_client.py
@@ -23,13 +23,13 @@
CONF = config.CONF
-class BackupsClientJSON(rest_client.RestClient):
+class BaseBackupsClientJSON(rest_client.RestClient):
"""
Client class to send CRUD Volume backup API requests to a Cinder endpoint
"""
def __init__(self, auth_provider):
- super(BackupsClientJSON, self).__init__(auth_provider)
+ super(BaseBackupsClientJSON, self).__init__(auth_provider)
self.service = CONF.volume.catalog_type
self.build_interval = CONF.volume.build_interval
self.build_timeout = CONF.volume.build_timeout
@@ -99,3 +99,7 @@
'the required time (%s s).' %
(backup_id, status, self.build_timeout))
raise exceptions.TimeoutException(message)
+
+
+class BackupsClientJSON(BaseBackupsClientJSON):
+ """Volume V1 Backups client"""
diff --git a/tempest/services/volume/v2/json/backups_client.py b/tempest/services/volume/v2/json/backups_client.py
new file mode 100644
index 0000000..9698075
--- /dev/null
+++ b/tempest/services/volume/v2/json/backups_client.py
@@ -0,0 +1,26 @@
+# 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.json import backups_client
+
+
+class BackupsClientV2JSON(backups_client.BaseBackupsClientJSON):
+ """
+ Client class to send CRUD Volume V2 API requests to a Cinder endpoint
+ """
+
+ def __init__(self, auth_provider):
+ super(BackupsClientV2JSON, self).__init__(auth_provider)
+ self.api_version = "v2"