blob: 31fc1ebfc2ca9b7f64842a7007a22dd89b7bf86b [file] [log] [blame]
Andrew Kerrfcb0b682016-04-01 16:01:34 -04001# Copyright 2016 Andrew Kerr
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15from tempest.api.volume import api_microversion_fixture
16from tempest.api.volume import base
17from tempest import config
18from tempest.lib.common import api_version_utils
19
20CONF = config.CONF
21
22
23class VolumesV3Test(api_version_utils.BaseMicroversionTest,
24 base.BaseVolumeTest):
25 """Base test case class for all v3 Cinder API tests."""
26
27 _api_version = 3
28
29 @classmethod
30 def skip_checks(cls):
31 super(VolumesV3Test, cls).skip_checks()
32 api_version_utils.check_skip_with_microversion(
33 cls.min_microversion, cls.max_microversion,
34 CONF.volume.min_microversion, CONF.volume.max_microversion)
35
36 @classmethod
37 def resource_setup(cls):
38 super(VolumesV3Test, cls).resource_setup()
39 cls.request_microversion = (
40 api_version_utils.select_request_microversion(
41 cls.min_microversion,
42 CONF.volume.min_microversion))
43
44 @classmethod
45 def setup_clients(cls):
46 super(VolumesV3Test, cls).setup_clients()
Benny Kopilove43b6e02016-11-03 10:51:34 +020047 cls.messages_client = cls.os.volume_v3_messages_client
Andrew Kerrfcb0b682016-04-01 16:01:34 -040048
49 def setUp(self):
50 super(VolumesV3Test, self).setUp()
51 self.useFixture(api_microversion_fixture.APIMicroversionFixture(
52 self.request_microversion))
53
54
Benny Kopilov8a33ee12016-11-09 10:35:23 +020055class VolumesV3AdminTest(VolumesV3Test,
56 base.BaseVolumeAdminTest):
Andrew Kerrfcb0b682016-04-01 16:01:34 -040057 """Base test case class for all v3 Volume Admin API tests."""
58
59 credentials = ['primary', 'admin']
60
61 @classmethod
62 def setup_clients(cls):
63 super(VolumesV3AdminTest, cls).setup_clients()
Benny Kopilove43b6e02016-11-03 10:51:34 +020064 cls.admin_messages_client = cls.os_adm.volume_v3_messages_client
Andrew Kerrfcb0b682016-04-01 16:01:34 -040065 cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client