ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 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. |
| 15 | |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 16 | import netaddr |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 17 | |
Matthew Treinish | 481466b | 2012-12-20 17:16:01 -0500 | [diff] [blame] | 18 | from tempest import clients |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 19 | from tempest.common.utils import data_utils |
Matthew Treinish | 03b48df | 2014-01-29 16:59:49 +0000 | [diff] [blame] | 20 | from tempest import config |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 21 | from tempest import exceptions |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 22 | from tempest.openstack.common import log as logging |
Attila Fazekas | dc21642 | 2013-01-29 15:12:14 +0100 | [diff] [blame] | 23 | import tempest.test |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 24 | |
Matthew Treinish | 03b48df | 2014-01-29 16:59:49 +0000 | [diff] [blame] | 25 | CONF = config.CONF |
| 26 | |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 27 | LOG = logging.getLogger(__name__) |
| 28 | |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 29 | |
Attila Fazekas | dc21642 | 2013-01-29 15:12:14 +0100 | [diff] [blame] | 30 | class BaseNetworkTest(tempest.test.BaseTestCase): |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 31 | |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 32 | """ |
Mark McClain | f2982e8 | 2013-07-06 17:48:03 -0400 | [diff] [blame] | 33 | Base class for the Neutron tests that use the Tempest Neutron REST client |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 34 | |
Mark McClain | f2982e8 | 2013-07-06 17:48:03 -0400 | [diff] [blame] | 35 | Per the Neutron API Guide, API v1.x was removed from the source code tree |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 36 | (docs.openstack.org/api/openstack-network/2.0/content/Overview-d1e71.html) |
Mark McClain | f2982e8 | 2013-07-06 17:48:03 -0400 | [diff] [blame] | 37 | Therefore, v2.x of the Neutron API is assumed. It is also assumed that the |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 38 | following options are defined in the [network] section of etc/tempest.conf: |
| 39 | |
| 40 | tenant_network_cidr with a block of cidr's from which smaller blocks |
| 41 | can be allocated for tenant networks |
| 42 | |
| 43 | tenant_network_mask_bits with the mask bits to be used to partition the |
| 44 | block defined by tenant-network_cidr |
Miguel Lavalle | 2492d78 | 2013-06-16 15:04:15 -0500 | [diff] [blame] | 45 | |
| 46 | Finally, it is assumed that the following option is defined in the |
| 47 | [service_available] section of etc/tempest.conf |
| 48 | |
| 49 | neutron as True |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 50 | """ |
| 51 | |
Matthew Treinish | 2f6628c | 2013-10-21 21:06:27 +0000 | [diff] [blame] | 52 | force_tenant_isolation = False |
| 53 | |
Henry Gessau | ffda37a | 2014-01-16 11:17:55 -0500 | [diff] [blame^] | 54 | # Default to ipv4. |
| 55 | _ip_version = 4 |
| 56 | _tenant_network_cidr = CONF.network.tenant_network_cidr |
| 57 | _tenant_network_mask_bits = CONF.network.tenant_network_mask_bits |
| 58 | |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 59 | @classmethod |
| 60 | def setUpClass(cls): |
Salvatore Orlando | 5a33724 | 2014-01-15 22:49:22 +0000 | [diff] [blame] | 61 | # Create no network resources for these test. |
| 62 | cls.set_network_resources() |
Attila Fazekas | f86fa31 | 2013-07-30 19:56:39 +0200 | [diff] [blame] | 63 | super(BaseNetworkTest, cls).setUpClass() |
Sean Dague | ffe8afe | 2013-10-23 15:28:00 -0400 | [diff] [blame] | 64 | os = clients.Manager(interface=cls._interface) |
Matthew Treinish | 03b48df | 2014-01-29 16:59:49 +0000 | [diff] [blame] | 65 | if not CONF.service_available.neutron: |
Mark McClain | f2982e8 | 2013-07-06 17:48:03 -0400 | [diff] [blame] | 66 | raise cls.skipException("Neutron support is required") |
Matthew Treinish | 2f6628c | 2013-10-21 21:06:27 +0000 | [diff] [blame] | 67 | |
| 68 | os = cls.get_client_manager() |
| 69 | |
| 70 | cls.network_cfg = CONF.network |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 71 | cls.client = os.network_client |
| 72 | cls.networks = [] |
| 73 | cls.subnets = [] |
raiesmh08 | e1aad98 | 2013-08-05 14:19:36 +0530 | [diff] [blame] | 74 | cls.ports = [] |
Salvatore Orlando | a85e8fe | 2013-09-20 03:48:02 -0700 | [diff] [blame] | 75 | cls.routers = [] |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 76 | cls.pools = [] |
| 77 | cls.vips = [] |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 78 | cls.members = [] |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 79 | cls.health_monitors = [] |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 80 | cls.vpnservices = [] |
raiesmh08 | bd6070d | 2013-12-06 15:13:38 +0530 | [diff] [blame] | 81 | cls.ikepolicies = [] |
rossella | dd68b23 | 2013-11-13 10:21:59 +0100 | [diff] [blame] | 82 | cls.floating_ips = [] |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 83 | |
| 84 | @classmethod |
| 85 | def tearDownClass(cls): |
raiesmh08 | bd6070d | 2013-12-06 15:13:38 +0530 | [diff] [blame] | 86 | # Clean up ike policies |
| 87 | for ikepolicy in cls.ikepolicies: |
Eugene Nikanorov | 909ded1 | 2013-12-15 17:45:37 +0400 | [diff] [blame] | 88 | cls.client.delete_ikepolicy(ikepolicy['id']) |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 89 | # Clean up vpn services |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 90 | for vpnservice in cls.vpnservices: |
Eugene Nikanorov | 909ded1 | 2013-12-15 17:45:37 +0400 | [diff] [blame] | 91 | cls.client.delete_vpnservice(vpnservice['id']) |
rossella | dd68b23 | 2013-11-13 10:21:59 +0100 | [diff] [blame] | 92 | # Clean up floating IPs |
| 93 | for floating_ip in cls.floating_ips: |
| 94 | cls.client.delete_floating_ip(floating_ip['id']) |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 95 | # Clean up routers |
Salvatore Orlando | a85e8fe | 2013-09-20 03:48:02 -0700 | [diff] [blame] | 96 | for router in cls.routers: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 97 | resp, body = cls.client.list_router_interfaces(router['id']) |
| 98 | interfaces = body['ports'] |
| 99 | for i in interfaces: |
| 100 | cls.client.remove_router_interface_with_subnet_id( |
| 101 | router['id'], i['fixed_ips'][0]['subnet_id']) |
| 102 | cls.client.delete_router(router['id']) |
| 103 | # Clean up health monitors |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 104 | for health_monitor in cls.health_monitors: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 105 | cls.client.delete_health_monitor(health_monitor['id']) |
| 106 | # Clean up members |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 107 | for member in cls.members: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 108 | cls.client.delete_member(member['id']) |
| 109 | # Clean up vips |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 110 | for vip in cls.vips: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 111 | cls.client.delete_vip(vip['id']) |
| 112 | # Clean up pools |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 113 | for pool in cls.pools: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 114 | cls.client.delete_pool(pool['id']) |
| 115 | # Clean up ports |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 116 | for port in cls.ports: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 117 | cls.client.delete_port(port['id']) |
| 118 | # Clean up subnets |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 119 | for subnet in cls.subnets: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 120 | cls.client.delete_subnet(subnet['id']) |
| 121 | # Clean up networks |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 122 | for network in cls.networks: |
Matthew Treinish | ec3489c | 2013-10-25 17:26:50 +0000 | [diff] [blame] | 123 | cls.client.delete_network(network['id']) |
Matthew Treinish | 2f6628c | 2013-10-21 21:06:27 +0000 | [diff] [blame] | 124 | cls.clear_isolated_creds() |
Attila Fazekas | f86fa31 | 2013-07-30 19:56:39 +0200 | [diff] [blame] | 125 | super(BaseNetworkTest, cls).tearDownClass() |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 126 | |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 127 | @classmethod |
| 128 | def create_network(cls, network_name=None): |
Sean Dague | f237ccb | 2013-01-04 15:19:14 -0500 | [diff] [blame] | 129 | """Wrapper utility that returns a test network.""" |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 130 | network_name = network_name or data_utils.rand_name('test-network-') |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 131 | |
Eugene Nikanorov | e9d255a | 2013-12-18 16:31:42 +0400 | [diff] [blame] | 132 | resp, body = cls.client.create_network(name=network_name) |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 133 | network = body['network'] |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 134 | cls.networks.append(network) |
Jay Pipes | f4dad39 | 2012-06-05 16:03:58 -0400 | [diff] [blame] | 135 | return network |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 136 | |
| 137 | @classmethod |
Henry Gessau | ffda37a | 2014-01-16 11:17:55 -0500 | [diff] [blame^] | 138 | def create_subnet(cls, network): |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 139 | """Wrapper utility that returns a test subnet.""" |
Henry Gessau | ffda37a | 2014-01-16 11:17:55 -0500 | [diff] [blame^] | 140 | # The cidr and mask_bits depend on the ip version. |
| 141 | cidr = netaddr.IPNetwork(cls._tenant_network_cidr) |
| 142 | mask_bits = cls._tenant_network_mask_bits |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 143 | # Find a cidr that is not in use yet and create a subnet with it |
Matt Riedemann | 9c9fa41 | 2013-06-19 18:33:47 -0700 | [diff] [blame] | 144 | body = None |
Matt Riedemann | d052c57 | 2013-05-31 17:10:11 -0700 | [diff] [blame] | 145 | failure = None |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 146 | for subnet_cidr in cidr.subnet(mask_bits): |
| 147 | try: |
Eugene Nikanorov | e9d255a | 2013-12-18 16:31:42 +0400 | [diff] [blame] | 148 | resp, body = cls.client.create_subnet( |
| 149 | network_id=network['id'], |
| 150 | cidr=str(subnet_cidr), |
Henry Gessau | ffda37a | 2014-01-16 11:17:55 -0500 | [diff] [blame^] | 151 | ip_version=cls._ip_version) |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 152 | break |
| 153 | except exceptions.BadRequest as e: |
| 154 | is_overlapping_cidr = 'overlaps with another subnet' in str(e) |
| 155 | if not is_overlapping_cidr: |
| 156 | raise |
Matt Riedemann | d052c57 | 2013-05-31 17:10:11 -0700 | [diff] [blame] | 157 | # save the failure in case all of the CIDRs are overlapping |
| 158 | failure = e |
| 159 | |
| 160 | if not body and failure: |
| 161 | raise failure |
| 162 | |
Miguel Lavalle | cc93961 | 2013-02-22 17:27:20 -0600 | [diff] [blame] | 163 | subnet = body['subnet'] |
| 164 | cls.subnets.append(subnet) |
| 165 | return subnet |
raiesmh08 | e1aad98 | 2013-08-05 14:19:36 +0530 | [diff] [blame] | 166 | |
| 167 | @classmethod |
| 168 | def create_port(cls, network): |
| 169 | """Wrapper utility that returns a test port.""" |
Eugene Nikanorov | e9d255a | 2013-12-18 16:31:42 +0400 | [diff] [blame] | 170 | resp, body = cls.client.create_port(network_id=network['id']) |
raiesmh08 | e1aad98 | 2013-08-05 14:19:36 +0530 | [diff] [blame] | 171 | port = body['port'] |
| 172 | cls.ports.append(port) |
| 173 | return port |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 174 | |
| 175 | @classmethod |
Salvatore Orlando | a85e8fe | 2013-09-20 03:48:02 -0700 | [diff] [blame] | 176 | def create_router(cls, router_name=None, admin_state_up=False, |
| 177 | external_network_id=None, enable_snat=None): |
| 178 | ext_gw_info = {} |
| 179 | if external_network_id: |
| 180 | ext_gw_info['network_id'] = external_network_id |
| 181 | if enable_snat: |
| 182 | ext_gw_info['enable_snat'] = enable_snat |
| 183 | resp, body = cls.client.create_router( |
| 184 | router_name, external_gateway_info=ext_gw_info, |
| 185 | admin_state_up=admin_state_up) |
| 186 | router = body['router'] |
| 187 | cls.routers.append(router) |
| 188 | return router |
| 189 | |
| 190 | @classmethod |
rossella | dd68b23 | 2013-11-13 10:21:59 +0100 | [diff] [blame] | 191 | def create_floating_ip(cls, external_network_id, **kwargs): |
| 192 | """Wrapper utility that returns a test floating IP.""" |
| 193 | resp, body = cls.client.create_floating_ip( |
| 194 | external_network_id, |
| 195 | **kwargs) |
| 196 | fip = body['floatingip'] |
| 197 | cls.floating_ips.append(fip) |
| 198 | return fip |
| 199 | |
| 200 | @classmethod |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 201 | def create_pool(cls, name, lb_method, protocol, subnet): |
| 202 | """Wrapper utility that returns a test pool.""" |
Eugene Nikanorov | 431e04a | 2013-12-17 15:44:27 +0400 | [diff] [blame] | 203 | resp, body = cls.client.create_pool( |
| 204 | name=name, |
| 205 | lb_method=lb_method, |
| 206 | protocol=protocol, |
| 207 | subnet_id=subnet['id']) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 208 | pool = body['pool'] |
| 209 | cls.pools.append(pool) |
| 210 | return pool |
| 211 | |
| 212 | @classmethod |
Eugene Nikanorov | 431e04a | 2013-12-17 15:44:27 +0400 | [diff] [blame] | 213 | def update_pool(cls, name): |
| 214 | """Wrapper utility that returns a test pool.""" |
| 215 | resp, body = cls.client.update_pool(name=name) |
| 216 | pool = body['pool'] |
| 217 | return pool |
| 218 | |
| 219 | @classmethod |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 220 | def create_vip(cls, name, protocol, protocol_port, subnet, pool): |
| 221 | """Wrapper utility that returns a test vip.""" |
| 222 | resp, body = cls.client.create_vip(name, protocol, protocol_port, |
| 223 | subnet['id'], pool['id']) |
| 224 | vip = body['vip'] |
| 225 | cls.vips.append(vip) |
| 226 | return vip |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 227 | |
| 228 | @classmethod |
| 229 | def create_member(cls, protocol_port, pool): |
| 230 | """Wrapper utility that returns a test member.""" |
| 231 | resp, body = cls.client.create_member("10.0.9.46", |
| 232 | protocol_port, |
| 233 | pool['id']) |
| 234 | member = body['member'] |
| 235 | cls.members.append(member) |
| 236 | return member |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 237 | |
| 238 | @classmethod |
| 239 | def create_health_monitor(cls, delay, max_retries, Type, timeout): |
| 240 | """Wrapper utility that returns a test health monitor.""" |
| 241 | resp, body = cls.client.create_health_monitor(delay, |
| 242 | max_retries, |
| 243 | Type, timeout) |
| 244 | health_monitor = body['health_monitor'] |
| 245 | cls.health_monitors.append(health_monitor) |
| 246 | return health_monitor |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 247 | |
| 248 | @classmethod |
| 249 | def create_router_interface(cls, router_id, subnet_id): |
| 250 | """Wrapper utility that returns a router interface.""" |
| 251 | resp, interface = cls.client.add_router_interface_with_subnet_id( |
| 252 | router_id, subnet_id) |
| 253 | |
| 254 | @classmethod |
| 255 | def create_vpnservice(cls, subnet_id, router_id): |
| 256 | """Wrapper utility that returns a test vpn service.""" |
Eugene Nikanorov | 909ded1 | 2013-12-15 17:45:37 +0400 | [diff] [blame] | 257 | resp, body = cls.client.create_vpnservice( |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 258 | subnet_id, router_id, admin_state_up=True, |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 259 | name=data_utils.rand_name("vpnservice-")) |
Anju Tiwari | 860097d | 2013-10-17 11:10:39 +0530 | [diff] [blame] | 260 | vpnservice = body['vpnservice'] |
| 261 | cls.vpnservices.append(vpnservice) |
| 262 | return vpnservice |
Salvatore Orlando | ce22b49 | 2013-09-20 04:04:11 -0700 | [diff] [blame] | 263 | |
raiesmh08 | bd6070d | 2013-12-06 15:13:38 +0530 | [diff] [blame] | 264 | @classmethod |
Eugene Nikanorov | 909ded1 | 2013-12-15 17:45:37 +0400 | [diff] [blame] | 265 | def create_ikepolicy(cls, name): |
raiesmh08 | bd6070d | 2013-12-06 15:13:38 +0530 | [diff] [blame] | 266 | """Wrapper utility that returns a test ike policy.""" |
Eugene Nikanorov | 909ded1 | 2013-12-15 17:45:37 +0400 | [diff] [blame] | 267 | resp, body = cls.client.create_ikepolicy(name) |
raiesmh08 | bd6070d | 2013-12-06 15:13:38 +0530 | [diff] [blame] | 268 | ikepolicy = body['ikepolicy'] |
| 269 | cls.ikepolicies.append(ikepolicy) |
| 270 | return ikepolicy |
| 271 | |
Salvatore Orlando | ce22b49 | 2013-09-20 04:04:11 -0700 | [diff] [blame] | 272 | |
| 273 | class BaseAdminNetworkTest(BaseNetworkTest): |
| 274 | |
| 275 | @classmethod |
| 276 | def setUpClass(cls): |
| 277 | super(BaseAdminNetworkTest, cls).setUpClass() |
Matthew Treinish | 03b48df | 2014-01-29 16:59:49 +0000 | [diff] [blame] | 278 | admin_username = CONF.compute_admin.username |
| 279 | admin_password = CONF.compute_admin.password |
| 280 | admin_tenant = CONF.compute_admin.tenant_name |
Salvatore Orlando | ce22b49 | 2013-09-20 04:04:11 -0700 | [diff] [blame] | 281 | if not (admin_username and admin_password and admin_tenant): |
| 282 | msg = ("Missing Administrative Network API credentials " |
| 283 | "in configuration.") |
| 284 | raise cls.skipException(msg) |
Matthew Treinish | 2f6628c | 2013-10-21 21:06:27 +0000 | [diff] [blame] | 285 | if (CONF.compute.allow_tenant_isolation or |
| 286 | cls.force_tenant_isolation is True): |
| 287 | creds = cls.isolated_creds.get_admin_creds() |
| 288 | admin_username, admin_tenant_name, admin_password = creds |
| 289 | cls.os_adm = clients.Manager(username=admin_username, |
| 290 | password=admin_password, |
| 291 | tenant_name=admin_tenant_name, |
| 292 | interface=cls._interface) |
| 293 | else: |
| 294 | cls.os_adm = clients.ComputeAdminManager(interface=cls._interface) |
| 295 | cls.admin_client = cls.os_adm.network_client |