Merge "Fix testcase 'TestPortsV2.test_range_allocation' failed randomly" into stable/grizzly
This commit is contained in:
commit
111a6af487
|
@ -1409,10 +1409,12 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s
|
||||||
self.assertEqual(len(ips), 5)
|
self.assertEqual(len(ips), 5)
|
||||||
alloc = ['10.0.0.1', '10.0.0.2', '10.0.0.4', '10.0.0.5',
|
alloc = ['10.0.0.1', '10.0.0.2', '10.0.0.4', '10.0.0.5',
|
||||||
'10.0.0.6']
|
'10.0.0.6']
|
||||||
for i in range(len(alloc)):
|
for ip in ips:
|
||||||
self.assertEqual(ips[i]['ip_address'], alloc[i])
|
self.assertIn(ip['ip_address'], alloc)
|
||||||
self.assertEqual(ips[i]['subnet_id'],
|
self.assertEqual(ip['subnet_id'],
|
||||||
subnet['subnet']['id'])
|
subnet['subnet']['id'])
|
||||||
|
alloc.remove(ip['ip_address'])
|
||||||
|
self.assertEqual(len(alloc), 0)
|
||||||
self._delete('ports', port['port']['id'])
|
self._delete('ports', port['port']['id'])
|
||||||
|
|
||||||
with self.subnet(gateway_ip='11.0.0.6',
|
with self.subnet(gateway_ip='11.0.0.6',
|
||||||
|
@ -1430,10 +1432,12 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s
|
||||||
self.assertEqual(len(ips), 5)
|
self.assertEqual(len(ips), 5)
|
||||||
alloc = ['11.0.0.1', '11.0.0.2', '11.0.0.3', '11.0.0.4',
|
alloc = ['11.0.0.1', '11.0.0.2', '11.0.0.3', '11.0.0.4',
|
||||||
'11.0.0.5']
|
'11.0.0.5']
|
||||||
for i in range(len(alloc)):
|
for ip in ips:
|
||||||
self.assertEqual(ips[i]['ip_address'], alloc[i])
|
self.assertIn(ip['ip_address'], alloc)
|
||||||
self.assertEqual(ips[i]['subnet_id'],
|
self.assertEqual(ip['subnet_id'],
|
||||||
subnet['subnet']['id'])
|
subnet['subnet']['id'])
|
||||||
|
alloc.remove(ip['ip_address'])
|
||||||
|
self.assertEqual(len(alloc), 0)
|
||||||
self._delete('ports', port['port']['id'])
|
self._delete('ports', port['port']['id'])
|
||||||
|
|
||||||
def test_requested_invalid_fixed_ips(self):
|
def test_requested_invalid_fixed_ips(self):
|
||||||
|
|
Loading…
Reference in New Issue