ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 1 | # Copyright 2013 OpenStack Foundation |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [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 | |
| 16 | from tempest.api.network import base |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 17 | from tempest.common.utils import data_utils |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 18 | from tempest import test |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 19 | |
| 20 | |
Ken'ichi Ohmichi | 91c675d | 2014-02-06 02:15:21 +0900 | [diff] [blame] | 21 | class LoadBalancerTestJSON(base.BaseNetworkTest): |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 22 | _interface = 'json' |
| 23 | |
| 24 | """ |
| 25 | Tests the following operations in the Neutron API using the REST client for |
| 26 | Neutron: |
| 27 | |
| 28 | create vIP, and Pool |
| 29 | show vIP |
| 30 | list vIP |
| 31 | update vIP |
| 32 | delete vIP |
| 33 | update pool |
| 34 | delete pool |
raiesmh08 | f5153f7 | 2013-09-16 13:38:37 +0530 | [diff] [blame] | 35 | show pool |
| 36 | list pool |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 37 | health monitoring operations |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 38 | """ |
| 39 | |
| 40 | @classmethod |
| 41 | def setUpClass(cls): |
Ken'ichi Ohmichi | 91c675d | 2014-02-06 02:15:21 +0900 | [diff] [blame] | 42 | super(LoadBalancerTestJSON, cls).setUpClass() |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 43 | if not test.is_extension_enabled('lbaas', 'network'): |
| 44 | msg = "lbaas extension not enabled." |
| 45 | raise cls.skipException(msg) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 46 | cls.network = cls.create_network() |
| 47 | cls.name = cls.network['name'] |
| 48 | cls.subnet = cls.create_subnet(cls.network) |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 49 | pool_name = data_utils.rand_name('pool-') |
| 50 | vip_name = data_utils.rand_name('vip-') |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 51 | cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN", |
| 52 | "HTTP", cls.subnet) |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 53 | cls.vip = cls.create_vip(name=vip_name, |
| 54 | protocol="HTTP", |
| 55 | protocol_port=80, |
| 56 | subnet=cls.subnet, |
| 57 | pool=cls.pool) |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 58 | cls.member = cls.create_member(80, cls.pool) |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 59 | cls.health_monitor = cls.create_health_monitor(delay=4, |
| 60 | max_retries=3, |
| 61 | Type="TCP", |
| 62 | timeout=1) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 63 | |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 64 | def _check_list_with_filter(self, obj_name, attr_exceptions, **kwargs): |
| 65 | create_obj = getattr(self.client, 'create_' + obj_name) |
| 66 | delete_obj = getattr(self.client, 'delete_' + obj_name) |
| 67 | list_objs = getattr(self.client, 'list_' + obj_name + 's') |
| 68 | |
| 69 | resp, body = create_obj(**kwargs) |
| 70 | self.assertEqual('201', resp['status']) |
| 71 | obj = body[obj_name] |
| 72 | self.addCleanup(delete_obj, obj['id']) |
| 73 | for key, value in obj.iteritems(): |
| 74 | # It is not relevant to filter by all arguments. That is why |
| 75 | # there is a list of attr to except |
| 76 | if key not in attr_exceptions: |
| 77 | resp, body = list_objs(**{key: value}) |
| 78 | self.assertEqual('200', resp['status']) |
| 79 | objs = [v[key] for v in body[obj_name + 's']] |
| 80 | self.assertIn(value, objs) |
| 81 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 82 | @test.attr(type='smoke') |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 83 | def test_list_vips(self): |
| 84 | # Verify the vIP exists in the list of all vIPs |
| 85 | resp, body = self.client.list_vips() |
| 86 | self.assertEqual('200', resp['status']) |
| 87 | vips = body['vips'] |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 88 | self.assertIn(self.vip['id'], [v['id'] for v in vips]) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 89 | |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 90 | @test.attr(type='smoke') |
| 91 | def test_list_vips_with_filter(self): |
| 92 | name = data_utils.rand_name('vip-') |
| 93 | resp, body = self.client.create_pool( |
| 94 | name=data_utils.rand_name("pool-"), lb_method="ROUND_ROBIN", |
| 95 | protocol="HTTPS", subnet_id=self.subnet['id']) |
| 96 | self.assertEqual('201', resp['status']) |
| 97 | pool = body['pool'] |
| 98 | self.addCleanup(self.client.delete_pool, pool['id']) |
| 99 | attr_exceptions = ['status', 'session_persistence', |
| 100 | 'status_description'] |
| 101 | self._check_list_with_filter( |
| 102 | 'vip', attr_exceptions, name=name, protocol="HTTPS", |
| 103 | protocol_port=81, subnet_id=self.subnet['id'], pool_id=pool['id'], |
| 104 | description=data_utils.rand_name('description-'), |
| 105 | admin_state_up=False) |
| 106 | |
| 107 | @test.attr(type='smoke') |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 108 | def test_create_update_delete_pool_vip(self): |
| 109 | # Creates a vip |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 110 | name = data_utils.rand_name('vip-') |
Eugene Nikanorov | 431e04a | 2013-12-17 15:44:27 +0400 | [diff] [blame] | 111 | resp, body = self.client.create_pool( |
| 112 | name=data_utils.rand_name("pool-"), |
| 113 | lb_method='ROUND_ROBIN', |
| 114 | protocol='HTTP', |
| 115 | subnet_id=self.subnet['id']) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 116 | pool = body['pool'] |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 117 | resp, body = self.client.create_vip(name=name, |
| 118 | protocol="HTTP", |
| 119 | protocol_port=80, |
| 120 | subnet_id=self.subnet['id'], |
| 121 | pool_id=pool['id']) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 122 | self.assertEqual('201', resp['status']) |
| 123 | vip = body['vip'] |
| 124 | vip_id = vip['id'] |
| 125 | # Verification of vip update |
| 126 | new_name = "New_vip" |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 127 | resp, body = self.client.update_vip(vip_id, name=new_name) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 128 | self.assertEqual('200', resp['status']) |
| 129 | updated_vip = body['vip'] |
| 130 | self.assertEqual(updated_vip['name'], new_name) |
| 131 | # Verification of vip delete |
| 132 | resp, body = self.client.delete_vip(vip['id']) |
| 133 | self.assertEqual('204', resp['status']) |
izikpenso | d9a01a6 | 2014-02-17 20:02:32 +0200 | [diff] [blame] | 134 | self.client.wait_for_resource_deletion('vip', vip['id']) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 135 | # Verification of pool update |
| 136 | new_name = "New_pool" |
Eugene Nikanorov | 431e04a | 2013-12-17 15:44:27 +0400 | [diff] [blame] | 137 | resp, body = self.client.update_pool(pool['id'], |
| 138 | name=new_name) |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 139 | self.assertEqual('200', resp['status']) |
| 140 | updated_pool = body['pool'] |
| 141 | self.assertEqual(updated_pool['name'], new_name) |
| 142 | # Verification of pool delete |
| 143 | resp, body = self.client.delete_pool(pool['id']) |
| 144 | self.assertEqual('204', resp['status']) |
| 145 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 146 | @test.attr(type='smoke') |
raiesmh08 | 0fe7685 | 2013-09-13 11:52:56 +0530 | [diff] [blame] | 147 | def test_show_vip(self): |
| 148 | # Verifies the details of a vip |
| 149 | resp, body = self.client.show_vip(self.vip['id']) |
| 150 | self.assertEqual('200', resp['status']) |
| 151 | vip = body['vip'] |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 152 | for key, value in vip.iteritems(): |
| 153 | # 'status' should not be confirmed in api tests |
| 154 | if key != 'status': |
| 155 | self.assertEqual(self.vip[key], value) |
raiesmh08 | 02d04b0 | 2013-09-16 12:10:10 +0530 | [diff] [blame] | 156 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 157 | @test.attr(type='smoke') |
raiesmh08 | f5153f7 | 2013-09-16 13:38:37 +0530 | [diff] [blame] | 158 | def test_show_pool(self): |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 159 | # Here we need to new pool without any dependence with vips |
| 160 | resp, body = self.client.create_pool( |
| 161 | name=data_utils.rand_name("pool-"), |
| 162 | lb_method='ROUND_ROBIN', |
| 163 | protocol='HTTP', |
| 164 | subnet_id=self.subnet['id']) |
| 165 | self.assertEqual('201', resp['status']) |
raiesmh08 | f5153f7 | 2013-09-16 13:38:37 +0530 | [diff] [blame] | 166 | pool = body['pool'] |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 167 | self.addCleanup(self.client.delete_pool, pool['id']) |
| 168 | # Verifies the details of a pool |
| 169 | resp, body = self.client.show_pool(pool['id']) |
| 170 | self.assertEqual('200', resp['status']) |
| 171 | shown_pool = body['pool'] |
| 172 | for key, value in pool.iteritems(): |
| 173 | # 'status' should not be confirmed in api tests |
| 174 | if key != 'status': |
| 175 | self.assertEqual(value, shown_pool[key]) |
raiesmh08 | f5153f7 | 2013-09-16 13:38:37 +0530 | [diff] [blame] | 176 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 177 | @test.attr(type='smoke') |
raiesmh08 | f5153f7 | 2013-09-16 13:38:37 +0530 | [diff] [blame] | 178 | def test_list_pools(self): |
| 179 | # Verify the pool exists in the list of all pools |
| 180 | resp, body = self.client.list_pools() |
| 181 | self.assertEqual('200', resp['status']) |
| 182 | pools = body['pools'] |
| 183 | self.assertIn(self.pool['id'], [p['id'] for p in pools]) |
| 184 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 185 | @test.attr(type='smoke') |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 186 | def test_list_pools_with_filters(self): |
| 187 | attr_exceptions = ['status', 'vip_id', 'members', 'provider', |
| 188 | 'status_description'] |
| 189 | self._check_list_with_filter( |
| 190 | 'pool', attr_exceptions, name=data_utils.rand_name("pool-"), |
| 191 | lb_method="ROUND_ROBIN", protocol="HTTPS", |
| 192 | subnet_id=self.subnet['id'], |
| 193 | description=data_utils.rand_name('description-'), |
| 194 | admin_state_up=False) |
| 195 | |
| 196 | @test.attr(type='smoke') |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 197 | def test_list_members(self): |
| 198 | # Verify the member exists in the list of all members |
| 199 | resp, body = self.client.list_members() |
| 200 | self.assertEqual('200', resp['status']) |
| 201 | members = body['members'] |
| 202 | self.assertIn(self.member['id'], [m['id'] for m in members]) |
| 203 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 204 | @test.attr(type='smoke') |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 205 | def test_list_members_with_filters(self): |
| 206 | attr_exceptions = ['status', 'status_description'] |
| 207 | self._check_list_with_filter('member', attr_exceptions, |
| 208 | address="10.0.9.47", protocol_port=80, |
| 209 | pool_id=self.pool['id']) |
| 210 | |
| 211 | @test.attr(type='smoke') |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 212 | def test_create_update_delete_member(self): |
| 213 | # Creates a member |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 214 | resp, body = self.client.create_member(address="10.0.9.47", |
| 215 | protocol_port=80, |
| 216 | pool_id=self.pool['id']) |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 217 | self.assertEqual('201', resp['status']) |
| 218 | member = body['member'] |
| 219 | # Verification of member update |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 220 | resp, body = self.client.update_member(member['id'], |
| 221 | admin_state_up=False) |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 222 | self.assertEqual('200', resp['status']) |
| 223 | updated_member = body['member'] |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 224 | self.assertFalse(updated_member['admin_state_up']) |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 225 | # Verification of member delete |
| 226 | resp, body = self.client.delete_member(member['id']) |
| 227 | self.assertEqual('204', resp['status']) |
| 228 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 229 | @test.attr(type='smoke') |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 230 | def test_show_member(self): |
| 231 | # Verifies the details of a member |
| 232 | resp, body = self.client.show_member(self.member['id']) |
| 233 | self.assertEqual('200', resp['status']) |
| 234 | member = body['member'] |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 235 | for key, value in member.iteritems(): |
| 236 | # 'status' should not be confirmed in api tests |
| 237 | if key != 'status': |
| 238 | self.assertEqual(self.member[key], value) |
raiesmh08 | f8437ed | 2013-09-17 10:59:38 +0530 | [diff] [blame] | 239 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 240 | @test.attr(type='smoke') |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 241 | def test_list_health_monitors(self): |
| 242 | # Verify the health monitor exists in the list of all health monitors |
| 243 | resp, body = self.client.list_health_monitors() |
| 244 | self.assertEqual('200', resp['status']) |
| 245 | health_monitors = body['health_monitors'] |
| 246 | self.assertIn(self.health_monitor['id'], |
| 247 | [h['id'] for h in health_monitors]) |
| 248 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 249 | @test.attr(type='smoke') |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 250 | def test_list_health_monitors_with_filters(self): |
| 251 | attr_exceptions = ['status', 'status_description', 'pools'] |
| 252 | self._check_list_with_filter('health_monitor', attr_exceptions, |
| 253 | delay=5, max_retries=4, type="TCP", |
| 254 | timeout=2) |
| 255 | |
| 256 | @test.attr(type='smoke') |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 257 | def test_create_update_delete_health_monitor(self): |
| 258 | # Creates a health_monitor |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 259 | resp, body = self.client.create_health_monitor(delay=4, |
| 260 | max_retries=3, |
| 261 | type="TCP", |
| 262 | timeout=1) |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 263 | self.assertEqual('201', resp['status']) |
| 264 | health_monitor = body['health_monitor'] |
| 265 | # Verification of health_monitor update |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 266 | resp, body = (self.client.update_health_monitor |
| 267 | (health_monitor['id'], |
| 268 | admin_state_up=False)) |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 269 | self.assertEqual('200', resp['status']) |
| 270 | updated_health_monitor = body['health_monitor'] |
Elena Ezhova | 43c70a2 | 2014-01-14 12:42:51 +0400 | [diff] [blame] | 271 | self.assertFalse(updated_health_monitor['admin_state_up']) |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 272 | # Verification of health_monitor delete |
| 273 | resp, body = self.client.delete_health_monitor(health_monitor['id']) |
| 274 | self.assertEqual('204', resp['status']) |
| 275 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 276 | @test.attr(type='smoke') |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 277 | def test_show_health_monitor(self): |
| 278 | # Verifies the details of a health_monitor |
| 279 | resp, body = self.client.show_health_monitor(self.health_monitor['id']) |
| 280 | self.assertEqual('200', resp['status']) |
| 281 | health_monitor = body['health_monitor'] |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 282 | for key, value in health_monitor.iteritems(): |
| 283 | # 'status' should not be confirmed in api tests |
| 284 | if key != 'status': |
| 285 | self.assertEqual(self.health_monitor[key], value) |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 286 | |
mouad benchchaoui | ea2440d | 2013-12-22 00:38:06 +0100 | [diff] [blame] | 287 | @test.attr(type='smoke') |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 288 | def test_associate_disassociate_health_monitor_with_pool(self): |
| 289 | # Verify that a health monitor can be associated with a pool |
| 290 | resp, body = (self.client.associate_health_monitor_with_pool |
| 291 | (self.health_monitor['id'], self.pool['id'])) |
| 292 | self.assertEqual('201', resp['status']) |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 293 | resp, body = self.client.show_health_monitor( |
| 294 | self.health_monitor['id']) |
| 295 | health_monitor = body['health_monitor'] |
| 296 | resp, body = self.client.show_pool(self.pool['id']) |
| 297 | pool = body['pool'] |
| 298 | self.assertIn(pool['id'], |
| 299 | [p['pool_id'] for p in health_monitor['pools']]) |
| 300 | self.assertIn(health_monitor['id'], pool['health_monitors']) |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 301 | # Verify that a health monitor can be disassociated from a pool |
| 302 | resp, body = (self.client.disassociate_health_monitor_with_pool |
| 303 | (self.health_monitor['id'], self.pool['id'])) |
| 304 | self.assertEqual('204', resp['status']) |
Ann Kamyshnikova | 2bc1c43 | 2013-12-10 17:31:50 +0400 | [diff] [blame] | 305 | resp, body = self.client.show_pool(self.pool['id']) |
| 306 | pool = body['pool'] |
| 307 | resp, body = self.client.show_health_monitor( |
| 308 | self.health_monitor['id']) |
| 309 | health_monitor = body['health_monitor'] |
| 310 | self.assertNotIn(health_monitor['id'], pool['health_monitors']) |
| 311 | self.assertNotIn(pool['id'], |
| 312 | [p['pool_id'] for p in health_monitor['pools']]) |
raiesmh08 | 32580d0 | 2013-09-17 13:11:34 +0530 | [diff] [blame] | 313 | |
nayna-patel | 87b4ef2 | 2014-02-07 10:24:59 +0000 | [diff] [blame] | 314 | @test.attr(type='smoke') |
| 315 | def test_get_lb_pool_stats(self): |
| 316 | # Verify the details of pool stats |
| 317 | resp, body = self.client.list_lb_pool_stats(self.pool['id']) |
| 318 | self.assertEqual('200', resp['status']) |
| 319 | stats = body['stats'] |
| 320 | self.assertIn("bytes_in", stats) |
| 321 | self.assertIn("total_connections", stats) |
| 322 | self.assertIn("active_connections", stats) |
| 323 | self.assertIn("bytes_out", stats) |
| 324 | |
raiesmh08 | 02d04b0 | 2013-09-16 12:10:10 +0530 | [diff] [blame] | 325 | |
Ken'ichi Ohmichi | 91c675d | 2014-02-06 02:15:21 +0900 | [diff] [blame] | 326 | class LoadBalancerTestXML(LoadBalancerTestJSON): |
raiesmh08 | 02d04b0 | 2013-09-16 12:10:10 +0530 | [diff] [blame] | 327 | _interface = 'xml' |