kvm resiliency test: be more tolerant when KVM is not ready yet at start of test.

parent 4ff1fc1d
...@@ -146,10 +146,17 @@ class KVMTestSuite(ResiliencyTestSuite): ...@@ -146,10 +146,17 @@ class KVMTestSuite(ResiliencyTestSuite):
logger.info('KVM IP is %s.' % self.ip) logger.info('KVM IP is %s.' % self.ip)
for i in range(0, 60): for i in range(0, 60):
failure = False
try:
connection = urllib.urlopen('http://%s:10080/set?key=%s' % (self.ip, self.key)) connection = urllib.urlopen('http://%s:10080/set?key=%s' % (self.ip, self.key))
if connection.getcode() is 200: if connection.getcode() is 200:
break break
else: else:
failure = True
except IOError:
failure = True
finally:
if failure:
logger.info('Impossible to connect to virtual machine to set key. sleeping...') logger.info('Impossible to connect to virtual machine to set key. sleeping...')
time.sleep(60) time.sleep(60)
if i is 59: if i is 59:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment