comparison Tests/Toolbox.py @ 137:412d5f70447e

testing asynchronous c-move
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 May 2018 21:43:40 +0200
parents 50cd127e5330
children 0682740fcfcb
comparison
equal deleted inserted replaced
136:5634ef96fcc5 137:412d5f70447e
210 while True: 210 while True:
211 if len(DoGet(orthanc, '/instances')) == 0: 211 if len(DoGet(orthanc, '/instances')) == 0:
212 return 212 return
213 time.sleep(0.1) 213 time.sleep(0.1)
214 214
215 def WaitJobDone(orthanc, job):
216 while True:
217 s = DoGet(orthanc, '/jobs/%s' % job) ['State']
218
219 if s == 'Success':
220 return True
221 elif s == 'Failure':
222 return False
223
224 time.sleep(0.1)
225
215 def GetDockerHostAddress(): 226 def GetDockerHostAddress():
216 route = subprocess.check_output([ '/sbin/ip', 'route' ]) 227 route = subprocess.check_output([ '/sbin/ip', 'route' ])
217 m = re.search(r'default via ([0-9.]+)', route) 228 m = re.search(r'default via ([0-9.]+)', route)
218 if m == None: 229 if m == None:
219 return 'localhost' 230 return 'localhost'