Commit ef300f15 by Richard Ding Committed by Sarath Subramanian

ATLAS-2087: Fix Unit test failures introduced by previous commit

parent 68f66e92
...@@ -71,6 +71,8 @@ ATLAS_HTTPS_PORT="atlas.server.https.port" ...@@ -71,6 +71,8 @@ ATLAS_HTTPS_PORT="atlas.server.https.port"
DEFAULT_ATLAS_HTTP_PORT="21000" DEFAULT_ATLAS_HTTP_PORT="21000"
DEFAULT_ATLAS_HTTPS_PORT="21443" DEFAULT_ATLAS_HTTPS_PORT="21443"
ATLAS_ENABLE_TLS="atlas.enableTLS" ATLAS_ENABLE_TLS="atlas.enableTLS"
ATLAS_SERVER_BIND_ADDRESS="atlas.server.bind.address"
DEFAULT_ATLAS_SERVER_HOST="localhost"
DEBUG = False DEBUG = False
...@@ -464,14 +466,23 @@ def get_atlas_url_port(confdir): ...@@ -464,14 +466,23 @@ def get_atlas_url_port(confdir):
print "starting atlas on port %s" % port print "starting atlas on port %s" % port
return port return port
def get_atlas_url_host(confdir):
confdir = os.path.join(confdir, CONF_FILE)
host = getConfigWithDefault(confdir, ATLAS_SERVER_BIND_ADDRESS, DEFAULT_ATLAS_SERVER_HOST)
if (host == '0.0.0.0'):
host = DEFAULT_ATLAS_SERVER_HOST
print "starting atlas on host %s" % host
return host
def wait_for_startup(confdir, wait): def wait_for_startup(confdir, wait):
count = 0 count = 0
host = get_atlas_url_host(confdir)
port = get_atlas_url_port(confdir) port = get_atlas_url_port(confdir)
while True: while True:
try: try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1) s.settimeout(1)
s.connect(('localhost', int(port))) s.connect((host, int(port)))
s.close() s.close()
break break
except Exception as e: except Exception as e:
......
...@@ -64,7 +64,8 @@ public class SecureEmbeddedServer extends EmbeddedServer { ...@@ -64,7 +64,8 @@ public class SecureEmbeddedServer extends EmbeddedServer {
super(host, port, path); super(host, port, path);
} }
protected Connector getConnector(int port) throws IOException { @Override
protected Connector getConnector(String host, int port) throws IOException {
org.apache.commons.configuration.Configuration config = getConfiguration(); org.apache.commons.configuration.Configuration config = getConfiguration();
SslContextFactory sslContextFactory = new SslContextFactory(); SslContextFactory sslContextFactory = new SslContextFactory();
......
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