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

parent 4ff1fc1d
...@@ -146,12 +146,19 @@ class KVMTestSuite(ResiliencyTestSuite): ...@@ -146,12 +146,19 @@ 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):
connection = urllib.urlopen('http://%s:10080/set?key=%s' % (self.ip, self.key)) failure = False
if connection.getcode() is 200: try:
break connection = urllib.urlopen('http://%s:10080/set?key=%s' % (self.ip, self.key))
else: if connection.getcode() is 200:
logger.info('Impossible to connect to virtual machine to set key. sleeping...') break
time.sleep(60) else:
failure = True
except IOError:
failure = True
finally:
if failure:
logger.info('Impossible to connect to virtual machine to set key. sleeping...')
time.sleep(60)
if i is 59: if i is 59:
raise Exception('Bad return code when setting key in main instance, after trying for 60 minutes.') raise Exception('Bad return code when setting key in main instance, after trying for 60 minutes.')
......
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