blob: 6507ce1f74f174d3a97df0fa3de403d1c30fcc72 [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2012 OpenStack Foundation
Jay Pipes13b479b2012-06-11 14:52:27 -04002# 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.
15
David Kranzcf0040c2012-06-26 09:46:56 -040016import time
Jay Pipesf38eaac2012-06-21 13:37:35 -040017
Matthew Treinish481466b2012-12-20 17:16:01 -050018from tempest import clients
Masayuki Igawa259c1132013-10-31 17:48:44 +090019from tempest.common.utils import data_utils
Matthew Treinishb0a78fc2014-01-29 16:49:12 +000020from tempest import config
David Kranz33138312013-09-24 17:09:32 -040021from tempest import exceptions
Matthew Treinish83d97be2014-09-19 16:34:54 -040022from tempest.openstack.common import excutils
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040023from tempest.openstack.common import log as logging
Attila Fazekasdc216422013-01-29 15:12:14 +010024import tempest.test
Jay Pipesf38eaac2012-06-21 13:37:35 -040025
Matthew Treinishb0a78fc2014-01-29 16:49:12 +000026CONF = config.CONF
Tiago Melloeda03b52012-08-22 23:47:29 -030027
Jay Pipesf38eaac2012-06-21 13:37:35 -040028LOG = logging.getLogger(__name__)
Daryl Walleckc7251962012-03-12 17:26:54 -050029
30
Attila Fazekasdc216422013-01-29 15:12:14 +010031class BaseComputeTest(tempest.test.BaseTestCase):
Sean Daguef237ccb2013-01-04 15:19:14 -050032 """Base test case class for all Compute API tests."""
Daryl Walleckc7251962012-03-12 17:26:54 -050033
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +090034 _api_version = 3
Attila Fazekas430dae32013-10-17 15:19:32 +020035 force_tenant_isolation = False
Chris Yeoh8a79b9d2013-01-18 19:32:47 +103036
Jay Pipesf38eaac2012-06-21 13:37:35 -040037 @classmethod
Andrea Frittoli50bb80d2014-09-15 12:34:27 +010038 def resource_setup(cls):
Ken'ichi Ohmichi5fd4ecf2014-04-25 13:38:15 +090039 cls.set_network_resources()
Andrea Frittoli50bb80d2014-09-15 12:34:27 +010040 super(BaseComputeTest, cls).resource_setup()
Matthew Treinish20866a22014-06-12 14:58:36 -040041 if getattr(cls, '_interface', None) == 'xml' and cls._api_version == 2:
42 if not CONF.compute_feature_enabled.xml_api_v2:
43 raise cls.skipException('XML API is not enabled')
Jay Pipesf38eaac2012-06-21 13:37:35 -040044
Andrea Frittoli422fbdf2014-03-20 10:05:18 +000045 # TODO(andreaf) WE should care also for the alt_manager here
46 # but only once client lazy load in the manager is done
Andrea Frittoli8283b4e2014-07-17 13:28:58 +010047 cls.os = cls.get_client_manager()
48 cls.multi_user = cls.check_multi_user()
Daryl Walleckc7251962012-03-12 17:26:54 -050049
Matthew Treinishb0a78fc2014-01-29 16:49:12 +000050 cls.build_interval = CONF.compute.build_interval
51 cls.build_timeout = CONF.compute.build_timeout
52 cls.ssh_user = CONF.compute.ssh_user
53 cls.image_ref = CONF.compute.image_ref
54 cls.image_ref_alt = CONF.compute.image_ref_alt
55 cls.flavor_ref = CONF.compute.flavor_ref
56 cls.flavor_ref_alt = CONF.compute.flavor_ref_alt
57 cls.image_ssh_user = CONF.compute.image_ssh_user
58 cls.image_ssh_password = CONF.compute.image_ssh_password
Jay Pipesf38eaac2012-06-21 13:37:35 -040059 cls.servers = []
Sean Dagued62bf1c2013-06-05 14:36:25 -040060 cls.images = []
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +080061 cls.security_groups = []
Abhijeet.Jain87dd4452014-04-23 15:51:23 +053062 cls.server_groups = []
Matthew Treinishf7fca6a2013-12-09 16:27:23 +000063
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +090064 if cls._api_version == 2:
65 cls.servers_client = cls.os.servers_client
66 cls.flavors_client = cls.os.flavors_client
67 cls.images_client = cls.os.images_client
68 cls.extensions_client = cls.os.extensions_client
69 cls.floating_ips_client = cls.os.floating_ips_client
70 cls.keypairs_client = cls.os.keypairs_client
71 cls.security_groups_client = cls.os.security_groups_client
72 cls.quotas_client = cls.os.quotas_client
Matt Riedemann848805f2014-06-16 13:23:51 -070073 # NOTE(mriedem): os-quota-class-sets is v2 API only
74 cls.quota_classes_client = cls.os.quota_classes_client
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +090075 cls.limits_client = cls.os.limits_client
76 cls.volumes_extensions_client = cls.os.volumes_extensions_client
77 cls.volumes_client = cls.os.volumes_client
78 cls.interfaces_client = cls.os.interfaces_client
79 cls.fixed_ips_client = cls.os.fixed_ips_client
80 cls.availability_zone_client = cls.os.availability_zone_client
81 cls.agents_client = cls.os.agents_client
82 cls.aggregates_client = cls.os.aggregates_client
83 cls.services_client = cls.os.services_client
84 cls.instance_usages_audit_log_client = \
85 cls.os.instance_usages_audit_log_client
86 cls.hypervisor_client = cls.os.hypervisor_client
87 cls.certificates_client = cls.os.certificates_client
88 cls.migrations_client = cls.os.migrations_client
Ghanshyam9d9201d2014-04-16 19:28:09 +090089 cls.security_group_default_rules_client = (
90 cls.os.security_group_default_rules_client)
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +090091
92 elif cls._api_version == 3:
93 if not CONF.compute_feature_enabled.api_v3:
94 skip_msg = ("%s skipped as nova v3 api is not available" %
95 cls.__name__)
96 raise cls.skipException(skip_msg)
97 cls.servers_client = cls.os.servers_v3_client
98 cls.images_client = cls.os.image_client
99 cls.flavors_client = cls.os.flavors_v3_client
100 cls.services_client = cls.os.services_v3_client
101 cls.extensions_client = cls.os.extensions_v3_client
102 cls.availability_zone_client = cls.os.availability_zone_v3_client
103 cls.interfaces_client = cls.os.interfaces_v3_client
104 cls.hypervisor_client = cls.os.hypervisor_v3_client
105 cls.keypairs_client = cls.os.keypairs_v3_client
106 cls.volumes_client = cls.os.volumes_client
107 cls.certificates_client = cls.os.certificates_v3_client
108 cls.keypairs_client = cls.os.keypairs_v3_client
109 cls.aggregates_client = cls.os.aggregates_v3_client
110 cls.hosts_client = cls.os.hosts_v3_client
111 cls.quotas_client = cls.os.quotas_v3_client
112 cls.version_client = cls.os.version_v3_client
113 cls.migrations_client = cls.os.migrations_v3_client
114 else:
115 msg = ("Unexpected API version is specified (%s)" %
116 cls._api_version)
117 raise exceptions.InvalidConfiguration(message=msg)
118
Matthew Treinishf7fca6a2013-12-09 16:27:23 +0000119 @classmethod
Andrea Frittoli8283b4e2014-07-17 13:28:58 +0100120 def check_multi_user(cls):
121 # We have a list of accounts now, so just checking if the list is gt 2
122 if not cls.isolated_creds.is_multi_user():
123 msg = "Not enough users available for multi-user testing"
124 raise exceptions.InvalidConfiguration(msg)
125 return True
Daryl Walleckc7251962012-03-12 17:26:54 -0500126
Jay Pipesf38eaac2012-06-21 13:37:35 -0400127 @classmethod
Jay Pipes444c3e62012-10-04 19:26:35 -0400128 def clear_servers(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200129 LOG.debug('Clearing servers: %s', ','.join(
130 server['id'] for server in cls.servers))
Jay Pipes444c3e62012-10-04 19:26:35 -0400131 for server in cls.servers:
Dan Smith74e7bcb2012-08-21 09:18:26 -0700132 try:
133 cls.servers_client.delete_server(server['id'])
Joe Gordon0c335792014-09-23 12:36:11 -0700134 except exceptions.NotFound:
135 # Something else already cleaned up the server, nothing to be
136 # worried about
Dan Smith74e7bcb2012-08-21 09:18:26 -0700137 pass
Joe Gordon0c335792014-09-23 12:36:11 -0700138 except Exception:
139 LOG.exception('Deleting server %s failed' % server['id'])
Dan Smith74e7bcb2012-08-21 09:18:26 -0700140
Jay Pipes444c3e62012-10-04 19:26:35 -0400141 for server in cls.servers:
Dan Smith74e7bcb2012-08-21 09:18:26 -0700142 try:
143 cls.servers_client.wait_for_server_termination(server['id'])
144 except Exception:
Joe Gordon0c335792014-09-23 12:36:11 -0700145 LOG.exception('Waiting for deletion of server %s failed'
146 % server['id'])
Dan Smith74e7bcb2012-08-21 09:18:26 -0700147
148 @classmethod
Attila Fazekas305e65b2013-10-29 13:23:07 +0100149 def server_check_teardown(cls):
150 """Checks is the shared server clean enough for subsequent test.
151 Method will delete the server when it's dirty.
152 The setUp method is responsible for creating a new server.
153 Exceptions raised in tearDown class are fails the test case,
154 This method supposed to use only by tierDown methods, when
155 the shared server_id is stored in the server_id of the class.
156 """
157 if getattr(cls, 'server_id', None) is not None:
158 try:
159 cls.servers_client.wait_for_server_status(cls.server_id,
160 'ACTIVE')
161 except Exception as exc:
162 LOG.exception(exc)
163 cls.servers_client.delete_server(cls.server_id)
164 cls.servers_client.wait_for_server_termination(cls.server_id)
165 cls.server_id = None
166 raise
167
168 @classmethod
Sean Dagued62bf1c2013-06-05 14:36:25 -0400169 def clear_images(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200170 LOG.debug('Clearing images: %s', ','.join(cls.images))
Sean Dagued62bf1c2013-06-05 14:36:25 -0400171 for image_id in cls.images:
172 try:
173 cls.images_client.delete_image(image_id)
David Kranz33138312013-09-24 17:09:32 -0400174 except exceptions.NotFound:
175 # The image may have already been deleted which is OK.
176 pass
Yair Frieda039f872014-01-02 12:11:10 +0200177 except Exception:
178 LOG.exception('Exception raised deleting image %s' % image_id)
Sean Dagued62bf1c2013-06-05 14:36:25 -0400179
180 @classmethod
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800181 def clear_security_groups(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200182 LOG.debug('Clearing security groups: %s', ','.join(
183 str(sg['id']) for sg in cls.security_groups))
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800184 for sg in cls.security_groups:
185 try:
186 resp, body =\
187 cls.security_groups_client.delete_security_group(sg['id'])
188 except exceptions.NotFound:
189 # The security group may have already been deleted which is OK.
190 pass
191 except Exception as exc:
192 LOG.info('Exception raised deleting security group %s',
193 sg['id'])
194 LOG.exception(exc)
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800195
196 @classmethod
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530197 def clear_server_groups(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200198 LOG.debug('Clearing server groups: %s', ','.join(cls.server_groups))
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530199 for server_group_id in cls.server_groups:
200 try:
201 cls.client.delete_server_group(server_group_id)
202 except exceptions.NotFound:
203 # The server-group may have already been deleted which is OK.
204 pass
205 except Exception:
206 LOG.exception('Exception raised deleting server-group %s',
207 server_group_id)
208
209 @classmethod
Andrea Frittoli50bb80d2014-09-15 12:34:27 +0100210 def resource_cleanup(cls):
Sean Dagued62bf1c2013-06-05 14:36:25 -0400211 cls.clear_images()
Jay Pipes444c3e62012-10-04 19:26:35 -0400212 cls.clear_servers()
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800213 cls.clear_security_groups()
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530214 cls.clear_server_groups()
Andrea Frittoli50bb80d2014-09-15 12:34:27 +0100215 super(BaseComputeTest, cls).resource_cleanup()
Rohit Karajgidc300b22012-05-04 08:11:00 -0700216
Jay Pipes444c3e62012-10-04 19:26:35 -0400217 @classmethod
Ken'ichi Ohmichicfc052e2013-10-23 11:50:04 +0900218 def create_test_server(cls, **kwargs):
Sean Daguef237ccb2013-01-04 15:19:14 -0500219 """Wrapper utility that returns a test server."""
Masayuki Igawa259c1132013-10-31 17:48:44 +0900220 name = data_utils.rand_name(cls.__name__ + "-instance")
Sean Dague22897e12013-02-25 17:54:09 -0500221 if 'name' in kwargs:
222 name = kwargs.pop('name')
223 flavor = kwargs.get('flavor', cls.flavor_ref)
224 image_id = kwargs.get('image_id', cls.image_ref)
Rohit Karajgidc300b22012-05-04 08:11:00 -0700225
Andrea Frittoli938d1512013-05-16 15:42:27 +0100226 resp, body = cls.servers_client.create_server(
Sean Dague22897e12013-02-25 17:54:09 -0500227 name, image_id, flavor, **kwargs)
Andrea Frittoli938d1512013-05-16 15:42:27 +0100228
229 # handle the case of multiple servers
230 servers = [body]
231 if 'min_count' in kwargs or 'max_count' in kwargs:
232 # Get servers created which name match with name param.
233 r, b = cls.servers_client.list_servers()
234 servers = [s for s in b['servers'] if s['name'].startswith(name)]
235
Sean Dague22897e12013-02-25 17:54:09 -0500236 if 'wait_until' in kwargs:
Andrea Frittoli938d1512013-05-16 15:42:27 +0100237 for server in servers:
Ken'ichi Ohmichi51c8c262013-12-21 03:30:37 +0900238 try:
239 cls.servers_client.wait_for_server_status(
240 server['id'], kwargs['wait_until'])
Matthew Treinish83d97be2014-09-19 16:34:54 -0400241 except Exception:
242 with excutils.save_and_reraise_exception():
243 if ('preserve_server_on_error' not in kwargs
244 or kwargs['preserve_server_on_error'] is False):
245 for server in servers:
246 try:
247 cls.servers_client.delete_server(
248 server['id'])
249 except Exception:
250 pass
Ken'ichi Ohmichi51c8c262013-12-21 03:30:37 +0900251
252 cls.servers.extend(servers)
Sean Dague9b669e32012-12-13 18:40:08 -0500253
Andrea Frittoli938d1512013-05-16 15:42:27 +0100254 return resp, body
Sean Dague9b669e32012-12-13 18:40:08 -0500255
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800256 @classmethod
257 def create_security_group(cls, name=None, description=None):
258 if name is None:
259 name = data_utils.rand_name(cls.__name__ + "-securitygroup")
260 if description is None:
261 description = data_utils.rand_name('description-')
262 resp, body = \
263 cls.security_groups_client.create_security_group(name,
264 description)
265 cls.security_groups.append(body)
266
267 return resp, body
268
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530269 @classmethod
Ghanshyam2a180b82014-06-16 13:54:22 +0900270 def create_test_server_group(cls, name="", policy=None):
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530271 if not name:
272 name = data_utils.rand_name(cls.__name__ + "-Server-Group")
Ghanshyam2a180b82014-06-16 13:54:22 +0900273 if policy is None:
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530274 policy = ['affinity']
275 resp, body = cls.servers_client.create_server_group(name, policy)
David Kranzda5d4ec2014-06-24 16:04:57 -0400276 cls.server_groups.append(body['id'])
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530277 return resp, body
278
David Kranzcf0040c2012-06-26 09:46:56 -0400279 def wait_for(self, condition):
Sean Daguef237ccb2013-01-04 15:19:14 -0500280 """Repeatedly calls condition() until a timeout."""
David Kranzcf0040c2012-06-26 09:46:56 -0400281 start_time = int(time.time())
282 while True:
283 try:
284 condition()
Matthew Treinish05d9fb92012-12-07 16:14:05 -0500285 except Exception:
David Kranzcf0040c2012-06-26 09:46:56 -0400286 pass
287 else:
288 return
289 if int(time.time()) - start_time >= self.build_timeout:
290 condition()
291 return
292 time.sleep(self.build_interval)
Jay Pipesf38eaac2012-06-21 13:37:35 -0400293
Matt Riedemann807d0562014-01-27 12:03:10 -0800294 @staticmethod
295 def _delete_volume(volumes_client, volume_id):
296 """Deletes the given volume and waits for it to be gone."""
297 try:
298 resp, _ = volumes_client.delete_volume(volume_id)
299 # TODO(mriedem): We should move the wait_for_resource_deletion
300 # into the delete_volume method as a convenience to the caller.
301 volumes_client.wait_for_resource_deletion(volume_id)
302 except exceptions.NotFound:
303 LOG.warn("Unable to delete volume '%s' since it was not found. "
304 "Maybe it was already deleted?" % volume_id)
305
Attila Fazekas423834d2014-03-14 17:33:13 +0100306 @classmethod
307 def prepare_instance_network(cls):
308 if (CONF.compute.ssh_auth_method != 'disabled' and
309 CONF.compute.ssh_connect_method == 'floating'):
310 cls.set_network_resources(network=True, subnet=True, router=True,
311 dhcp=True)
312
ivan-zhu8f992be2013-07-31 14:56:58 +0800313 @classmethod
314 def create_image_from_server(cls, server_id, **kwargs):
315 """Wrapper utility that returns an image created from the server."""
Masayuki Igawa259c1132013-10-31 17:48:44 +0900316 name = data_utils.rand_name(cls.__name__ + "-image")
ivan-zhu8f992be2013-07-31 14:56:58 +0800317 if 'name' in kwargs:
318 name = kwargs.pop('name')
319
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900320 if cls._api_version == 2:
321 resp, image = cls.images_client.create_image(server_id, name)
322 elif cls._api_version == 3:
323 resp, image = cls.servers_client.create_image(server_id, name)
Masayuki Igawa259c1132013-10-31 17:48:44 +0900324 image_id = data_utils.parse_image_id(resp['location'])
ivan-zhu8f992be2013-07-31 14:56:58 +0800325 cls.images.append(image_id)
326
327 if 'wait_until' in kwargs:
328 cls.images_client.wait_for_image_status(image_id,
329 kwargs['wait_until'])
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900330 if cls._api_version == 2:
331 resp, image = cls.images_client.get_image(image_id)
332 elif cls._api_version == 3:
333 resp, image = cls.images_client.get_image_meta(image_id)
ivan-zhu8f992be2013-07-31 14:56:58 +0800334
Bob Ball621e4602013-12-06 19:53:43 +0000335 if kwargs['wait_until'] == 'ACTIVE':
336 if kwargs.get('wait_for_server', True):
337 cls.servers_client.wait_for_server_status(server_id,
338 'ACTIVE')
ivan-zhu8f992be2013-07-31 14:56:58 +0800339 return resp, image
340
341 @classmethod
Matthew Treinish2cd19a42013-12-02 21:54:42 +0000342 def rebuild_server(cls, server_id, **kwargs):
ivan-zhu8f992be2013-07-31 14:56:58 +0800343 # Destroy an existing server and creates a new one
Matthew Treinish2cd19a42013-12-02 21:54:42 +0000344 if server_id:
345 try:
346 cls.servers_client.delete_server(server_id)
347 cls.servers_client.wait_for_server_termination(server_id)
Yair Frieda039f872014-01-02 12:11:10 +0200348 except Exception:
349 LOG.exception('Failed to delete server %s' % server_id)
Ken'ichi Ohmichicfc052e2013-10-23 11:50:04 +0900350 resp, server = cls.create_test_server(wait_until='ACTIVE', **kwargs)
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900351 if cls._api_version == 2:
352 cls.password = server['adminPass']
353 elif cls._api_version == 3:
354 cls.password = server['admin_password']
Matthew Treinish2cd19a42013-12-02 21:54:42 +0000355 return server['id']
ivan-zhu8f992be2013-07-31 14:56:58 +0800356
Matt Riedemann5dc594c2014-01-27 11:40:28 -0800357 @classmethod
358 def delete_volume(cls, volume_id):
359 """Deletes the given volume and waits for it to be gone."""
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900360 if cls._api_version == 2:
361 cls._delete_volume(cls.volumes_extensions_client, volume_id)
362 elif cls._api_version == 3:
363 cls._delete_volume(cls.volumes_client, volume_id)
364
365
366class BaseV2ComputeTest(BaseComputeTest):
367 _api_version = 2
368 _interface = "json"
Matt Riedemann5dc594c2014-01-27 11:40:28 -0800369
ivan-zhuf2b00502013-10-18 10:06:52 +0800370
Ken'ichi Ohmichibcefa3d2014-05-09 08:14:05 +0900371class BaseV3ComputeTest(BaseComputeTest):
372 _api_version = 3
373 _interface = "json"
374
375
376class BaseComputeAdminTest(BaseComputeTest):
377 """Base test case class for Compute Admin API tests."""
378 _interface = "json"
ivan-zhuf2b00502013-10-18 10:06:52 +0800379
380 @classmethod
Andrea Frittoli50bb80d2014-09-15 12:34:27 +0100381 def resource_setup(cls):
382 super(BaseComputeAdminTest, cls).resource_setup()
Andrea Frittoli8283b4e2014-07-17 13:28:58 +0100383 try:
Matthew Treinishb86cda92013-07-29 11:22:23 -0400384 creds = cls.isolated_creds.get_admin_creds()
Andrea Frittoli8283b4e2014-07-17 13:28:58 +0100385 cls.os_adm = clients.Manager(
386 credentials=creds, interface=cls._interface)
387 except NotImplementedError:
388 msg = ("Missing Compute Admin API credentials in configuration.")
389 raise cls.skipException(msg)
390
Ghanshyam31501112014-06-23 13:56:42 +0900391 if cls._api_version == 2:
392 cls.availability_zone_admin_client = (
393 cls.os_adm.availability_zone_client)
ivan-zhu8f992be2013-07-31 14:56:58 +0800394
Ghanshyam31501112014-06-23 13:56:42 +0900395 else:
Ken'ichi Ohmichibcefa3d2014-05-09 08:14:05 +0900396 cls.servers_admin_client = cls.os_adm.servers_v3_client
397 cls.services_admin_client = cls.os_adm.services_v3_client
398 cls.availability_zone_admin_client = \
399 cls.os_adm.availability_zone_v3_client
400 cls.hypervisor_admin_client = cls.os_adm.hypervisor_v3_client
401 cls.flavors_admin_client = cls.os_adm.flavors_v3_client
402 cls.aggregates_admin_client = cls.os_adm.aggregates_v3_client
403 cls.hosts_admin_client = cls.os_adm.hosts_v3_client
404 cls.quotas_admin_client = cls.os_adm.quotas_v3_client
405 cls.agents_admin_client = cls.os_adm.agents_v3_client
406 cls.migrations_admin_client = cls.os_adm.migrations_v3_client
ivan-zhu8f992be2013-07-31 14:56:58 +0800407
Ken'ichi Ohmichibcefa3d2014-05-09 08:14:05 +0900408
409class BaseV2ComputeAdminTest(BaseComputeAdminTest):
410 """Base test case class for Compute Admin V2 API tests."""
411 _api_version = 2
412
413
414class BaseV3ComputeAdminTest(BaseComputeAdminTest):
415 """Base test case class for Compute Admin V3 API tests."""
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900416 _api_version = 3