comparison tests/test_push_command.py @ 1451:945700dac237

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.
author Durham Goode <durham@fb.com>
date Tue, 07 Jun 2016 14:35:30 -0700
parents a36e87ae2380
children 6e3f48d8002f
comparison
equal deleted inserted replaced
1450:3c4fbf59e503 1451:945700dac237
136 def internal_push_over_svnserve(self, subdir='', commit=True): 136 def internal_push_over_svnserve(self, subdir='', commit=True):
137 repo_path = self.load_svndump('simple_branch.svndump') 137 repo_path = self.load_svndump('simple_branch.svndump')
138 open(os.path.join(repo_path, 'conf', 'svnserve.conf'), 138 open(os.path.join(repo_path, 'conf', 'svnserve.conf'),
139 'w').write('[general]\nanon-access=write\n[sasl]\n') 139 'w').write('[general]\nanon-access=write\n[sasl]\n')
140 self.port = random.randint(socket.IPPORT_USERRESERVED, 65535) 140 self.port = random.randint(socket.IPPORT_USERRESERVED, 65535)
141 self.host = 'localhost' 141 self.host = socket.gethostname()
142 args = ['svnserve', '--daemon', '--foreground', 142 args = ['svnserve', '--daemon', '--foreground',
143 '--listen-port=%d' % self.port, 143 '--listen-port=%d' % self.port,
144 '--listen-host=%s' % self.host, 144 '--listen-host=%s' % self.host,
145 '--root=%s' % repo_path] 145 '--root=%s' % repo_path]
146 146