Skip to content

Commit

Permalink
test: make host more portable
Browse files Browse the repository at this point in the history
Docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
  • Loading branch information
DifferentialOrange committed Nov 8, 2022
1 parent 3f95ebb commit 34db72b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/suites/lib/tarantool_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def check_port(port, rais=True):
try:
sock = socket.create_connection(("localhost", port))
sock = socket.create_connection(("0.0.0.0", port))
except socket.error:
return True
sock.close()
Expand Down Expand Up @@ -103,7 +103,7 @@ def _admin(self, port):
raise ValueError("Bad port number: '%s'" % port)
if hasattr(self, 'admin'):
del self.admin
self.admin = TarantoolAdmin('localhost', port)
self.admin = TarantoolAdmin('0.0.0.0', port)

@property
def log_des(self):
Expand Down Expand Up @@ -147,7 +147,7 @@ def __init__(self,
self.args['primary'] = self._socket.name
self.args['admin'] = find_port()
else:
self.host = 'localhost'
self.host = '0.0.0.0'
self.args = {}
self._socket = None
self.args['primary'] = find_port()
Expand Down Expand Up @@ -208,7 +208,7 @@ def wait_until_started(self):

while True:
try:
temp = TarantoolAdmin('localhost', self.args['admin'])
temp = TarantoolAdmin('0.0.0.0', self.args['admin'])
while True:
ans = temp('box.info.status')[0]
if ans in ('running', 'hot_standby', 'orphan') or ans.startswith('replica'):
Expand Down

0 comments on commit 34db72b

Please sign in to comment.