From 84c69c32297a1f79e8630102497e1e7e0041a324 Mon Sep 17 00:00:00 2001 From: Joshua McKenty Date: Wed, 7 Jul 2010 12:24:17 -0700 Subject: Off by one error in the allocation test (can someone check my subnet math?) --- nova/tests/network_unittest.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'nova') diff --git a/nova/tests/network_unittest.py b/nova/tests/network_unittest.py index 67ae7ad2d..4d79758fb 100644 --- a/nova/tests/network_unittest.py +++ b/nova/tests/network_unittest.py @@ -21,7 +21,6 @@ import os import logging import unittest -import time from nova import vendor import IPy @@ -154,20 +153,20 @@ class NetworkTestCase(test.TrialTestCase): def test_too_many_addresses(self): """ Network size is 32, there are 5 addresses reserved for VPN. - So we should get 24 usable addresses + So we should get 23 usable addresses """ net = network.get_project_network("project0", "default") hostname = "toomany-hosts" macs = {} addresses = {} - for i in range(0, 23): + for i in range(0, 22): macs[i] = utils.generate_mac() addresses[i] = network.allocate_ip("netuser", "project0", macs[i]) self.dnsmasq.issue_ip(macs[i], addresses[i], hostname, net.bridge_name) self.assertRaises(NoMoreAddresses, network.allocate_ip, "netuser", "project0", utils.generate_mac()) - for i in range(0, 23): + for i in range(0, 22): rv = network.deallocate_ip(addresses[i]) self.dnsmasq.release_ip(macs[i], addresses[i], hostname, net.bridge_name) -- cgit