blob: ec2192f103e94fc0b4766308e03e8826e1537668 [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
Doug Hellmann583ce2c2015-03-11 14:55:46 +000018from oslo_log import log as logging
Matthew Treinish01472ff2015-02-20 17:26:52 -050019from tempest_lib import exceptions as lib_exc
20
Joseph Lanouxb3e1f872015-01-30 11:13:07 +000021from tempest.common import compute
Fei Long Wangd39431f2015-05-14 11:30:48 +120022from tempest.common.utils import data_utils
Ken'ichi Ohmichi8b9c7802015-07-08 05:57:37 +000023from tempest.common import waiters
Matthew Treinishb0a78fc2014-01-29 16:49:12 +000024from tempest import config
David Kranz33138312013-09-24 17:09:32 -040025from tempest import exceptions
Attila Fazekasdc216422013-01-29 15:12:14 +010026import tempest.test
Jay Pipesf38eaac2012-06-21 13:37:35 -040027
Matthew Treinishb0a78fc2014-01-29 16:49:12 +000028CONF = config.CONF
Tiago Melloeda03b52012-08-22 23:47:29 -030029
Jay Pipesf38eaac2012-06-21 13:37:35 -040030LOG = logging.getLogger(__name__)
Daryl Walleckc7251962012-03-12 17:26:54 -050031
32
Attila Fazekasdc216422013-01-29 15:12:14 +010033class BaseComputeTest(tempest.test.BaseTestCase):
Sean Daguef237ccb2013-01-04 15:19:14 -050034 """Base test case class for all Compute API tests."""
Daryl Walleckc7251962012-03-12 17:26:54 -050035
Ken'ichi Ohmichi9f5adf82014-12-12 04:01:32 +000036 _api_version = 2
Attila Fazekas430dae32013-10-17 15:19:32 +020037 force_tenant_isolation = False
Chris Yeoh8a79b9d2013-01-18 19:32:47 +103038
Andrea Frittolib21de6c2015-02-06 20:12:38 +000039 # TODO(andreaf) We should care also for the alt_manager here
40 # but only once client lazy load in the manager is done
41 credentials = ['primary']
42
Jay Pipesf38eaac2012-06-21 13:37:35 -040043 @classmethod
Emily Hugenbruche7991d92014-12-12 16:53:36 +000044 def skip_checks(cls):
45 super(BaseComputeTest, cls).skip_checks()
Matthew Treinishf8ff3582015-08-25 12:41:56 -040046 if not CONF.service_available.nova:
47 raise cls.skipException("Nova is not available")
Emily Hugenbruche7991d92014-12-12 16:53:36 +000048 if cls._api_version != 2:
49 msg = ("Unexpected API version is specified (%s)" %
50 cls._api_version)
51 raise exceptions.InvalidConfiguration(message=msg)
Jay Pipesf38eaac2012-06-21 13:37:35 -040052
Emily Hugenbruche7991d92014-12-12 16:53:36 +000053 @classmethod
54 def setup_credentials(cls):
55 cls.set_network_resources()
56 super(BaseComputeTest, cls).setup_credentials()
Daryl Walleckc7251962012-03-12 17:26:54 -050057
Emily Hugenbruche7991d92014-12-12 16:53:36 +000058 @classmethod
59 def setup_clients(cls):
60 super(BaseComputeTest, cls).setup_clients()
61 cls.servers_client = cls.os.servers_client
Ken'ichi Ohmichi7ca54b82015-07-07 01:10:26 +000062 cls.server_groups_client = cls.os.server_groups_client
Emily Hugenbruche7991d92014-12-12 16:53:36 +000063 cls.flavors_client = cls.os.flavors_client
64 cls.images_client = cls.os.images_client
65 cls.extensions_client = cls.os.extensions_client
Ken'ichi Ohmichi03af1c52015-07-13 00:28:05 +000066 cls.floating_ip_pools_client = cls.os.floating_ip_pools_client
Emily Hugenbruche7991d92014-12-12 16:53:36 +000067 cls.floating_ips_client = cls.os.floating_ips_client
68 cls.keypairs_client = cls.os.keypairs_client
Ken'ichi Ohmichi685cd172015-07-13 01:29:57 +000069 cls.security_group_rules_client = cls.os.security_group_rules_client
Emily Hugenbruche7991d92014-12-12 16:53:36 +000070 cls.security_groups_client = cls.os.security_groups_client
71 cls.quotas_client = cls.os.quotas_client
Emily Hugenbruche7991d92014-12-12 16:53:36 +000072 cls.quota_classes_client = cls.os.quota_classes_client
John Warren9487a182015-09-14 18:12:56 -040073 cls.compute_networks_client = cls.os.compute_networks_client
Emily Hugenbruche7991d92014-12-12 16:53:36 +000074 cls.limits_client = cls.os.limits_client
75 cls.volumes_extensions_client = cls.os.volumes_extensions_client
Gaozexub9c9d6e2015-09-10 17:08:04 +080076 cls.snapshots_extensions_client = cls.os.snapshots_extensions_client
Emily Hugenbruche7991d92014-12-12 16:53:36 +000077 cls.interfaces_client = cls.os.interfaces_client
78 cls.fixed_ips_client = cls.os.fixed_ips_client
79 cls.availability_zone_client = cls.os.availability_zone_client
80 cls.agents_client = cls.os.agents_client
81 cls.aggregates_client = cls.os.aggregates_client
82 cls.services_client = cls.os.services_client
83 cls.instance_usages_audit_log_client = (
84 cls.os.instance_usages_audit_log_client)
85 cls.hypervisor_client = cls.os.hypervisor_client
86 cls.certificates_client = cls.os.certificates_client
87 cls.migrations_client = cls.os.migrations_client
88 cls.security_group_default_rules_client = (
89 cls.os.security_group_default_rules_client)
Ken'ichi Ohmichi2b6012b2015-09-03 01:56:19 +000090 cls.versions_client = cls.os.compute_versions_client
Emily Hugenbruche7991d92014-12-12 16:53:36 +000091
Ivan Kolodyazhnybcfc32e2015-08-06 13:31:36 +030092 if CONF.volume_feature_enabled.api_v1:
93 cls.volumes_client = cls.os.volumes_client
94 else:
95 cls.volumes_client = cls.os.volumes_v2_client
96
Emily Hugenbruche7991d92014-12-12 16:53:36 +000097 @classmethod
98 def resource_setup(cls):
99 super(BaseComputeTest, cls).resource_setup()
Matthew Treinishb0a78fc2014-01-29 16:49:12 +0000100 cls.build_interval = CONF.compute.build_interval
101 cls.build_timeout = CONF.compute.build_timeout
102 cls.ssh_user = CONF.compute.ssh_user
103 cls.image_ref = CONF.compute.image_ref
104 cls.image_ref_alt = CONF.compute.image_ref_alt
105 cls.flavor_ref = CONF.compute.flavor_ref
106 cls.flavor_ref_alt = CONF.compute.flavor_ref_alt
107 cls.image_ssh_user = CONF.compute.image_ssh_user
108 cls.image_ssh_password = CONF.compute.image_ssh_password
Jay Pipesf38eaac2012-06-21 13:37:35 -0400109 cls.servers = []
Sean Dagued62bf1c2013-06-05 14:36:25 -0400110 cls.images = []
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800111 cls.security_groups = []
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530112 cls.server_groups = []
Matthew Treinishf7fca6a2013-12-09 16:27:23 +0000113
Emily Hugenbruche7991d92014-12-12 16:53:36 +0000114 @classmethod
115 def resource_cleanup(cls):
116 cls.clear_images()
117 cls.clear_servers()
118 cls.clear_security_groups()
119 cls.clear_server_groups()
120 super(BaseComputeTest, cls).resource_cleanup()
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900121
Matthew Treinishf7fca6a2013-12-09 16:27:23 +0000122 @classmethod
Jay Pipes444c3e62012-10-04 19:26:35 -0400123 def clear_servers(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200124 LOG.debug('Clearing servers: %s', ','.join(
125 server['id'] for server in cls.servers))
Jay Pipes444c3e62012-10-04 19:26:35 -0400126 for server in cls.servers:
Dan Smith74e7bcb2012-08-21 09:18:26 -0700127 try:
128 cls.servers_client.delete_server(server['id'])
Masayuki Igawabfa07602015-01-20 18:47:17 +0900129 except lib_exc.NotFound:
Joe Gordon0c335792014-09-23 12:36:11 -0700130 # Something else already cleaned up the server, nothing to be
131 # worried about
Dan Smith74e7bcb2012-08-21 09:18:26 -0700132 pass
Joe Gordon0c335792014-09-23 12:36:11 -0700133 except Exception:
134 LOG.exception('Deleting server %s failed' % server['id'])
Dan Smith74e7bcb2012-08-21 09:18:26 -0700135
Jay Pipes444c3e62012-10-04 19:26:35 -0400136 for server in cls.servers:
Dan Smith74e7bcb2012-08-21 09:18:26 -0700137 try:
Ken'ichi Ohmichie91a0c62015-08-13 02:09:16 +0000138 waiters.wait_for_server_termination(cls.servers_client,
139 server['id'])
Dan Smith74e7bcb2012-08-21 09:18:26 -0700140 except Exception:
Joe Gordon0c335792014-09-23 12:36:11 -0700141 LOG.exception('Waiting for deletion of server %s failed'
142 % server['id'])
Dan Smith74e7bcb2012-08-21 09:18:26 -0700143
144 @classmethod
Attila Fazekas305e65b2013-10-29 13:23:07 +0100145 def server_check_teardown(cls):
146 """Checks is the shared server clean enough for subsequent test.
147 Method will delete the server when it's dirty.
148 The setUp method is responsible for creating a new server.
149 Exceptions raised in tearDown class are fails the test case,
150 This method supposed to use only by tierDown methods, when
151 the shared server_id is stored in the server_id of the class.
152 """
153 if getattr(cls, 'server_id', None) is not None:
154 try:
Ken'ichi Ohmichi0eb153c2015-07-13 02:18:25 +0000155 waiters.wait_for_server_status(cls.servers_client,
156 cls.server_id, 'ACTIVE')
Attila Fazekas305e65b2013-10-29 13:23:07 +0100157 except Exception as exc:
158 LOG.exception(exc)
159 cls.servers_client.delete_server(cls.server_id)
Ken'ichi Ohmichie91a0c62015-08-13 02:09:16 +0000160 waiters.wait_for_server_termination(cls.servers_client,
161 cls.server_id)
Attila Fazekas305e65b2013-10-29 13:23:07 +0100162 cls.server_id = None
163 raise
164
165 @classmethod
Sean Dagued62bf1c2013-06-05 14:36:25 -0400166 def clear_images(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200167 LOG.debug('Clearing images: %s', ','.join(cls.images))
Sean Dagued62bf1c2013-06-05 14:36:25 -0400168 for image_id in cls.images:
169 try:
170 cls.images_client.delete_image(image_id)
Masayuki Igawabfa07602015-01-20 18:47:17 +0900171 except lib_exc.NotFound:
David Kranz33138312013-09-24 17:09:32 -0400172 # The image may have already been deleted which is OK.
173 pass
Yair Frieda039f872014-01-02 12:11:10 +0200174 except Exception:
175 LOG.exception('Exception raised deleting image %s' % image_id)
Sean Dagued62bf1c2013-06-05 14:36:25 -0400176
177 @classmethod
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800178 def clear_security_groups(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200179 LOG.debug('Clearing security groups: %s', ','.join(
180 str(sg['id']) for sg in cls.security_groups))
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800181 for sg in cls.security_groups:
182 try:
David Kranz9964b4e2015-02-06 15:45:29 -0500183 cls.security_groups_client.delete_security_group(sg['id'])
Masayuki Igawabfa07602015-01-20 18:47:17 +0900184 except lib_exc.NotFound:
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800185 # The security group may have already been deleted which is OK.
186 pass
187 except Exception as exc:
188 LOG.info('Exception raised deleting security group %s',
189 sg['id'])
190 LOG.exception(exc)
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800191
192 @classmethod
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530193 def clear_server_groups(cls):
Salvatore1422a9a2014-10-08 15:53:25 +0200194 LOG.debug('Clearing server groups: %s', ','.join(cls.server_groups))
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530195 for server_group_id in cls.server_groups:
196 try:
Ken'ichi Ohmichi7ca54b82015-07-07 01:10:26 +0000197 cls.server_groups_client.delete_server_group(server_group_id)
Masayuki Igawabfa07602015-01-20 18:47:17 +0900198 except lib_exc.NotFound:
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530199 # The server-group may have already been deleted which is OK.
200 pass
201 except Exception:
202 LOG.exception('Exception raised deleting server-group %s',
203 server_group_id)
204
205 @classmethod
Joe Gordon8843f0f2015-03-17 15:07:34 -0700206 def create_test_server(cls, validatable=False, volume_backed=False,
207 **kwargs):
Joseph Lanouxb3e1f872015-01-30 11:13:07 +0000208 """Wrapper utility that returns a test server.
Rohit Karajgidc300b22012-05-04 08:11:00 -0700209
Joseph Lanouxb3e1f872015-01-30 11:13:07 +0000210 This wrapper utility calls the common create test server and
211 returns a test server. The purpose of this wrapper is to minimize
212 the impact on the code of the tests already using this
213 function.
Joe Gordon8843f0f2015-03-17 15:07:34 -0700214
215 :param validatable: Whether the server will be pingable or sshable.
216 :param volume_backed: Whether the instance is volume backed or not.
Joseph Lanouxb3e1f872015-01-30 11:13:07 +0000217 """
218 tenant_network = cls.get_tenant_network()
219 body, servers = compute.create_test_server(
220 cls.os,
221 validatable,
222 validation_resources=cls.validation_resources,
223 tenant_network=tenant_network,
Joe Gordon8843f0f2015-03-17 15:07:34 -0700224 volume_backed=volume_backed,
Joseph Lanouxb3e1f872015-01-30 11:13:07 +0000225 **kwargs)
Ken'ichi Ohmichi51c8c262013-12-21 03:30:37 +0900226
227 cls.servers.extend(servers)
Sean Dague9b669e32012-12-13 18:40:08 -0500228
David Kranz0fb14292015-02-11 15:55:20 -0500229 return body
Sean Dague9b669e32012-12-13 18:40:08 -0500230
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800231 @classmethod
232 def create_security_group(cls, name=None, description=None):
233 if name is None:
234 name = data_utils.rand_name(cls.__name__ + "-securitygroup")
235 if description is None:
Ken'ichi Ohmichi4937f562015-03-23 00:15:01 +0000236 description = data_utils.rand_name('description')
ghanshyamb610b772015-08-24 17:29:38 +0900237 body = cls.security_groups_client.create_security_group(
238 name=name, description=description)['security_group']
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800239 cls.security_groups.append(body)
240
David Kranz9964b4e2015-02-06 15:45:29 -0500241 return body
Zhi Kun Liu02e7a7b2014-01-08 16:08:32 +0800242
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530243 @classmethod
Ghanshyam2a180b82014-06-16 13:54:22 +0900244 def create_test_server_group(cls, name="", policy=None):
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530245 if not name:
246 name = data_utils.rand_name(cls.__name__ + "-Server-Group")
Ghanshyam2a180b82014-06-16 13:54:22 +0900247 if policy is None:
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530248 policy = ['affinity']
Ken'ichi Ohmichi1f36daa2015-09-30 01:41:34 +0000249 body = cls.server_groups_client.create_server_group(
250 name=name, policies=policy)['server_group']
David Kranzda5d4ec2014-06-24 16:04:57 -0400251 cls.server_groups.append(body['id'])
David Kranzae99b9a2015-02-16 13:37:01 -0500252 return body
Abhijeet.Jain87dd4452014-04-23 15:51:23 +0530253
David Kranzcf0040c2012-06-26 09:46:56 -0400254 def wait_for(self, condition):
Sean Daguef237ccb2013-01-04 15:19:14 -0500255 """Repeatedly calls condition() until a timeout."""
David Kranzcf0040c2012-06-26 09:46:56 -0400256 start_time = int(time.time())
257 while True:
258 try:
259 condition()
Matthew Treinish05d9fb92012-12-07 16:14:05 -0500260 except Exception:
David Kranzcf0040c2012-06-26 09:46:56 -0400261 pass
262 else:
263 return
264 if int(time.time()) - start_time >= self.build_timeout:
265 condition()
266 return
267 time.sleep(self.build_interval)
Jay Pipesf38eaac2012-06-21 13:37:35 -0400268
Matt Riedemann807d0562014-01-27 12:03:10 -0800269 @staticmethod
270 def _delete_volume(volumes_client, volume_id):
271 """Deletes the given volume and waits for it to be gone."""
272 try:
Joseph Lanoux6809bab2014-12-18 14:57:18 +0000273 volumes_client.delete_volume(volume_id)
Matt Riedemann807d0562014-01-27 12:03:10 -0800274 # TODO(mriedem): We should move the wait_for_resource_deletion
275 # into the delete_volume method as a convenience to the caller.
276 volumes_client.wait_for_resource_deletion(volume_id)
Masayuki Igawabfa07602015-01-20 18:47:17 +0900277 except lib_exc.NotFound:
Matt Riedemann807d0562014-01-27 12:03:10 -0800278 LOG.warn("Unable to delete volume '%s' since it was not found. "
279 "Maybe it was already deleted?" % volume_id)
280
Attila Fazekas423834d2014-03-14 17:33:13 +0100281 @classmethod
282 def prepare_instance_network(cls):
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000283 if (CONF.validation.auth_method != 'disabled' and
284 CONF.validation.connect_method == 'floating'):
Attila Fazekas423834d2014-03-14 17:33:13 +0100285 cls.set_network_resources(network=True, subnet=True, router=True,
286 dhcp=True)
287
ivan-zhu8f992be2013-07-31 14:56:58 +0800288 @classmethod
289 def create_image_from_server(cls, server_id, **kwargs):
290 """Wrapper utility that returns an image created from the server."""
Masayuki Igawa259c1132013-10-31 17:48:44 +0900291 name = data_utils.rand_name(cls.__name__ + "-image")
ivan-zhu8f992be2013-07-31 14:56:58 +0800292 if 'name' in kwargs:
293 name = kwargs.pop('name')
294
Ken'ichi Ohmichi28f18672015-07-17 10:00:38 +0000295 image = cls.images_client.create_image(server_id, name=name)
David Kranza5299eb2015-01-15 17:24:05 -0500296 image_id = data_utils.parse_image_id(image.response['location'])
ivan-zhu8f992be2013-07-31 14:56:58 +0800297 cls.images.append(image_id)
298
299 if 'wait_until' in kwargs:
Ken'ichi Ohmichi8b9c7802015-07-08 05:57:37 +0000300 waiters.wait_for_image_status(cls.images_client,
301 image_id, kwargs['wait_until'])
ghanshyam1756e0b2015-08-18 19:19:05 +0900302 image = cls.images_client.show_image(image_id)['image']
ivan-zhu8f992be2013-07-31 14:56:58 +0800303
Bob Ball621e4602013-12-06 19:53:43 +0000304 if kwargs['wait_until'] == 'ACTIVE':
305 if kwargs.get('wait_for_server', True):
Ken'ichi Ohmichi0eb153c2015-07-13 02:18:25 +0000306 waiters.wait_for_server_status(cls.servers_client,
307 server_id, 'ACTIVE')
David Kranza5299eb2015-01-15 17:24:05 -0500308 return image
ivan-zhu8f992be2013-07-31 14:56:58 +0800309
310 @classmethod
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000311 def rebuild_server(cls, server_id, validatable=False, **kwargs):
ivan-zhu8f992be2013-07-31 14:56:58 +0800312 # Destroy an existing server and creates a new one
Matthew Treinish2cd19a42013-12-02 21:54:42 +0000313 if server_id:
314 try:
315 cls.servers_client.delete_server(server_id)
Ken'ichi Ohmichie91a0c62015-08-13 02:09:16 +0000316 waiters.wait_for_server_termination(cls.servers_client,
317 server_id)
Yair Frieda039f872014-01-02 12:11:10 +0200318 except Exception:
319 LOG.exception('Failed to delete server %s' % server_id)
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000320
321 server = cls.create_test_server(
322 validatable,
323 wait_until='ACTIVE',
324 **kwargs)
Ken'ichi Ohmichi9f5adf82014-12-12 04:01:32 +0000325 cls.password = server['adminPass']
Matthew Treinish2cd19a42013-12-02 21:54:42 +0000326 return server['id']
ivan-zhu8f992be2013-07-31 14:56:58 +0800327
Matt Riedemann5dc594c2014-01-27 11:40:28 -0800328 @classmethod
Jesse Keating613b4982015-05-04 15:05:19 -0700329 def delete_server(cls, server_id):
330 """Deletes an existing server and waits for it to be gone."""
331 try:
332 cls.servers_client.delete_server(server_id)
Ken'ichi Ohmichie91a0c62015-08-13 02:09:16 +0000333 waiters.wait_for_server_termination(cls.servers_client,
334 server_id)
Jesse Keating613b4982015-05-04 15:05:19 -0700335 except Exception:
336 LOG.exception('Failed to delete server %s' % server_id)
337
338 @classmethod
Matt Riedemann5dc594c2014-01-27 11:40:28 -0800339 def delete_volume(cls, volume_id):
340 """Deletes the given volume and waits for it to be gone."""
Ken'ichi Ohmichi9f5adf82014-12-12 04:01:32 +0000341 cls._delete_volume(cls.volumes_extensions_client, volume_id)
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900342
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000343 @classmethod
344 def get_server_ip(cls, server):
345 """Get the server fixed or floating IP.
346
347 For the floating IP, the address created by the validation resources
348 is returned.
349 For the fixed IP, the server is returned and the current mechanism of
350 address extraction in the remote_client is followed.
351 """
352 if CONF.validation.connect_method == 'floating':
353 ip_or_server = cls.validation_resources['floating_ip']['ip']
354 elif CONF.validation.connect_method == 'fixed':
355 ip_or_server = server
356 return ip_or_server
357
Ken'ichi Ohmichi543a5d42014-05-02 08:44:15 +0900358
359class BaseV2ComputeTest(BaseComputeTest):
360 _api_version = 2
Matt Riedemann5dc594c2014-01-27 11:40:28 -0800361
ivan-zhuf2b00502013-10-18 10:06:52 +0800362
Ken'ichi Ohmichibcefa3d2014-05-09 08:14:05 +0900363class BaseComputeAdminTest(BaseComputeTest):
364 """Base test case class for Compute Admin API tests."""
ivan-zhuf2b00502013-10-18 10:06:52 +0800365
Andrea Frittolib21de6c2015-02-06 20:12:38 +0000366 credentials = ['primary', 'admin']
Emily Hugenbruche7991d92014-12-12 16:53:36 +0000367
368 @classmethod
369 def setup_clients(cls):
370 super(BaseComputeAdminTest, cls).setup_clients()
Ken'ichi Ohmichi9f5adf82014-12-12 04:01:32 +0000371 cls.availability_zone_admin_client = (
372 cls.os_adm.availability_zone_client)
ivan-zhu8f992be2013-07-31 14:56:58 +0800373
Ken'ichi Ohmichibcefa3d2014-05-09 08:14:05 +0900374
375class BaseV2ComputeAdminTest(BaseComputeAdminTest):
376 """Base test case class for Compute Admin V2 API tests."""
377 _api_version = 2