summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaypipes@gmail.com <>2010-07-19 09:50:22 -0500
committerjaypipes@gmail.com <>2010-07-19 09:50:22 -0500
commitc39b3add4b3db1c027c32ea0f145c3d3ab3f4d1c (patch)
tree53b85b5b5655ec71ad61e85a714ae8e82e0a957e
parenta5668a0e8ebc96d01ec7a26229079ccda6032e75 (diff)
downloadnova-c39b3add4b3db1c027c32ea0f145c3d3ab3f4d1c.tar.gz
nova-c39b3add4b3db1c027c32ea0f145c3d3ab3f4d1c.tar.xz
nova-c39b3add4b3db1c027c32ea0f145c3d3ab3f4d1c.zip
Hmm, serves me right for not understanding the request, eh? :) Now too_many_addresses test case is idempotent in regards to running in isolation and uses self.flags.network_size instead of the magic number 32.
-rw-r--r--nova/tests/network_unittest.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/nova/tests/network_unittest.py b/nova/tests/network_unittest.py
index 3cfba2cf9..4a9f9b8ab 100644
--- a/nova/tests/network_unittest.py
+++ b/nova/tests/network_unittest.py
@@ -155,16 +155,16 @@ class NetworkTestCase(test.TrialTestCase):
However, the number of available IP addresses depends on the test
environment's setup.
- Network size is 32.
+ Network size is set in test fixture's setUp method.
- There are FLAGS.cnt_vpn_clients addresses reserved for VPN (NUM_RESERVED_VPN_IPS)
+ There are FLAGS.cnt_vpn_clients addresses reserved for VPN (NUM_RESERVED_VPN_IPS)
- And there are NUM_STATIC_IPS that are always reserved by Nova for the necessary
- services (gateway, CloudPipe, etc)
+ And there are NUM_STATIC_IPS that are always reserved by Nova for the necessary
+ services (gateway, CloudPipe, etc)
- So we should get 32 - (NUM_STATIC_IPS +
- NUM_PREALLOCATED_IPS +
- NUM_RESERVED_VPN_IPS)
+ So we should get flags.network_size - (NUM_STATIC_IPS +
+ NUM_PREALLOCATED_IPS +
+ NUM_RESERVED_VPN_IPS)
usable addresses
"""
net = network.get_project_network("project0", "default")
@@ -173,7 +173,7 @@ class NetworkTestCase(test.TrialTestCase):
num_static_ips = net.num_static_ips
num_preallocated_ips = len(net.hosts.keys())
num_reserved_vpn_ips = flags.FLAGS.cnt_vpn_clients
- num_available_ips = 32 - (num_static_ips + num_preallocated_ips + num_reserved_vpn_ips)
+ num_available_ips = flags.FLAGS.network_size - (num_static_ips + num_preallocated_ips + num_reserved_vpn_ips)
hostname = "toomany-hosts"
macs = {}