From c39b3add4b3db1c027c32ea0f145c3d3ab3f4d1c Mon Sep 17 00:00:00 2001 From: "jaypipes@gmail.com" <> Date: Mon, 19 Jul 2010 09:50:22 -0500 Subject: 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. --- nova/tests/network_unittest.py | 16 ++++++++-------- 1 file 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 = {} -- cgit