Commit d32deb34 authored by zhifan huang's avatar zhifan huang

test: print error message when not start registry

parent 11bb5b72
...@@ -84,13 +84,17 @@ class Re6stRegistry(object): ...@@ -84,13 +84,17 @@ class Re6stRegistry(object):
""".format(self.port)]) """.format(self.port)])
now = time.time() now = time.time()
while time.time() - now < 10: while time.time() - now < 20:
if p.poll() != None: if p.poll() is not None:
break break
time.sleep(0.1) time.sleep(0.1)
else: else:
logging.error("registry failed to start, %s", self.name) logging.error("registry failed to start, %s", self.name)
p.destroy() p.destroy()
self.proc.destroy()
proc = self.node.Popen(['cat', str(self.log)])
proc.wait()
shutil.rmtree(str(self.path))
raise Exception("registry failed to start") raise Exception("registry failed to start")
logging.info("re6st service started") logging.info("re6st service started")
...@@ -109,6 +113,7 @@ class Re6stRegistry(object): ...@@ -109,6 +113,7 @@ class Re6stRegistry(object):
serial=ip_to_serial(self.ip6)) serial=ip_to_serial(self.ip6))
def run(self): def run(self):
assert self.path.exists()
cmd = ['--ca', self.ca_crt, '--key', self.ca_key, '--dh', DH_FILE, cmd = ['--ca', self.ca_crt, '--key', self.ca_key, '--dh', DH_FILE,
'--ipv4', '10.42.0.0/16', '8', '--logfile', self.log, '--db', self.db, '--ipv4', '10.42.0.0/16', '8', '--logfile', self.log, '--db', self.db,
'--run', self.run_path, '--hello', '4', '--mailhost', 's', '-v4', '--run', self.run_path, '--hello', '4', '--mailhost', 's', '-v4',
......
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