tests: use hostname instead of localhost

The test_push_command test was failing on our machines because the machines are
ipv6 but expose ipv4 on the 127.0.0.1 loopback interface. This caused the
svnserve process to listen via ipv4, but the connecting process would attempt to
connect on ipv6 and fail. Using the hostname causes it to listen using the
primary network interface, which matches the interface that is used when the
connecting client resolves the hostname. So the test now passes.
This commit is contained in:
Durham Goode 2016-06-07 14:35:30 -07:00
parent b74f10ba72
commit 6099956ed8

View File

@ -138,7 +138,7 @@ class PushTests(test_util.TestBase):
open(os.path.join(repo_path, 'conf', 'svnserve.conf'),
'w').write('[general]\nanon-access=write\n[sasl]\n')
self.port = random.randint(socket.IPPORT_USERRESERVED, 65535)
self.host = 'localhost'
self.host = socket.gethostname()
args = ['svnserve', '--daemon', '--foreground',
'--listen-port=%d' % self.port,
'--listen-host=%s' % self.host,