X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/53647be00773d583a6087f8c91e35df0f4f42bc8..93db16f42ed2f7f9a4e74ff24d9792655cf39923:/sdk/python/tests/run_test_server.py diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py index 6687ca491a..c845e78f0f 100644 --- a/sdk/python/tests/run_test_server.py +++ b/sdk/python/tests/run_test_server.py @@ -181,22 +181,18 @@ def _wait_until_port_listens(port, timeout=10, warn=True): in seconds), print a warning on stderr before returning. """ try: - subprocess.check_output(['which', 'lsof']) + subprocess.check_output(['which', 'netstat']) except subprocess.CalledProcessError: - print("WARNING: No `lsof` -- cannot wait for port to listen. "+ + print("WARNING: No `netstat` -- cannot wait for port to listen. "+ "Sleeping 0.5 and hoping for the best.", file=sys.stderr) time.sleep(0.5) return deadline = time.time() + timeout while time.time() < deadline: - try: - subprocess.check_output( - ['lsof', '-t', '-i', 'tcp:'+str(port)]) - except subprocess.CalledProcessError: - time.sleep(0.1) - continue - return True + if re.search(r'\ntcp.*:'+str(port)+' .* LISTEN *\n', subprocess.check_output(['netstat', '-an'])): + return True + time.sleep(0.1) if warn: print( "WARNING: Nothing is listening on port {} (waited {} seconds).". @@ -413,29 +409,32 @@ def run_controller(): f.write(""" Clusters: zzzzz: - HTTPRequestTimeout: 30s + ManagementToken: e687950a23c3a9bceec28c6223a06c79 + API: + RequestTimeout: 30s PostgreSQL: ConnectionPool: 32 Connection: - host: {} - dbname: {} - user: {} - password: {} - NodeProfiles: - "*": - "arvados-controller": - Listen: ":{}" - "arvados-api-server": - Listen: ":{}" - TLS: true - Insecure: true + host: {dbhost} + dbname: {dbname} + user: {dbuser} + password: {dbpass} + TLS: + Insecure: true + Services: + Controller: + InternalURLs: + "http://localhost:{controllerport}": {{}} + RailsAPI: + InternalURLs: + "https://localhost:{railsport}": {{}} """.format( - _dbconfig('host'), - _dbconfig('database'), - _dbconfig('username'), - _dbconfig('password'), - port, - rails_api_port, + dbhost=_dbconfig('host'), + dbname=_dbconfig('database'), + dbuser=_dbconfig('username'), + dbpass=_dbconfig('password'), + controllerport=port, + railsport=rails_api_port, )) logf = open(_logfilename('controller'), 'a') controller = subprocess.Popen( @@ -632,6 +631,7 @@ def run_arv_git_httpd(): agh = subprocess.Popen( ['arv-git-httpd', '-repo-root='+gitdir+'/test', + '-management-token=e687950a23c3a9bceec28c6223a06c79', '-address=:'+str(gitport)], env=env, stdin=open('/dev/null'), stdout=logf, stderr=logf) with open(_pidfile('arv-git-httpd'), 'w') as f: @@ -657,6 +657,7 @@ def run_keep_web(): ['keep-web', '-allow-anonymous', '-attachment-only-host=download', + '-management-token=e687950a23c3a9bceec28c6223a06c79', '-listen=:'+str(keepwebport)], env=env, stdin=open('/dev/null'), stdout=logf, stderr=logf) with open(_pidfile('keep-web'), 'w') as f: