aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhu Yanhai <zhu.yanhai@gmail.com>2013-09-30 16:12:10 +0800
committerIan Campbell <ian.campbell@citrix.com>2013-10-03 13:43:23 +0100
commitc8f5eb4b8093ac6acc947a4df5779e69005d16c4 (patch)
tree91d995be857ab9c56f333d879af32c3c6e571450
parentb685c64be7a8d870313c9a652a15eadf9f25f195 (diff)
downloadxen-c8f5eb4b8093ac6acc947a4df5779e69005d16c4.tar.gz
xen-c8f5eb4b8093ac6acc947a4df5779e69005d16c4.tar.bz2
xen-c8f5eb4b8093ac6acc947a4df5779e69005d16c4.zip
xm-test: fix the ip allocation function
__findFirstOctetIP() is expecting min and max available octets according to its code, however the caller getFreeIP() gives it the min octet and (max - min + 1), which is the length instead. Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r--tools/xm-test/lib/XmTestLib/NetConfig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py b/tools/xm-test/lib/XmTestLib/NetConfig.py
index 1f834cc95a..5013befdfd 100644
--- a/tools/xm-test/lib/XmTestLib/NetConfig.py
+++ b/tools/xm-test/lib/XmTestLib/NetConfig.py
@@ -159,7 +159,8 @@ class NetConfig:
def setUsedIP(self, domname, interface, ip):
self.used_ips['%s:%s' % (domname, interface)] = ip
- def __findFirstOctetIP(self, prefix, min, max):
+ def __findFirstOctetIP(self, prefix, min, len):
+ max = min + len
for i in range(min, max):
ip = '%s%s' % (prefix, str(i))
found = False