From c8f5eb4b8093ac6acc947a4df5779e69005d16c4 Mon Sep 17 00:00:00 2001 From: Zhu Yanhai Date: Mon, 30 Sep 2013 16:12:10 +0800 Subject: 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 Acked-by: Ian Campbell --- tools/xm-test/lib/XmTestLib/NetConfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') 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 -- cgit v1.2.3