Hardcode `127.0.0.1` in test setup instead of relying on DNS resolution of `localhost`

This should not be necessary but apparently helps with test failures
reported in https://github.com/Martchus/syncthingtray/issues/105.
This commit is contained in:
Martchus 2021-08-07 16:09:11 +02:00
parent 09e8955c06
commit 7e7eab9eb8
3 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@
<maxRecvKbps>0</maxRecvKbps>
</device>
<gui enabled="true" tls="false" debugging="false">
<address>localhost:4001</address>
<address>127.0.0.1:4001</address>
<user>nobody</user>
<password>$2a$12$35MnbsQgQNn1hzPYK/lWXOaP.U5D2TO0nuuQy2M4gsqJB4ff4q2RK</password>
<apikey>syncthingconnectortest</apikey>
@ -63,7 +63,7 @@
</gui>
<ldap></ldap>
<options>
<listenAddress>tcp://localhost:32452</listenAddress>
<listenAddress>tcp://127.0.0.1:32452</listenAddress>
<globalAnnounceServer>default</globalAnnounceServer>
<globalAnnounceEnabled>true</globalAnnounceEnabled>
<localAnnounceEnabled>true</localAnnounceEnabled>

View File

@ -118,7 +118,7 @@ void ConnectionTests::setUp()
SyncthingTestInstance::start();
cerr << "\n - Preparing connection ..." << endl;
m_connection.setSyncthingUrl(QStringLiteral("http://localhost:") + syncthingPort());
m_connection.setSyncthingUrl(QStringLiteral("http://127.0.0.1:") + syncthingPort());
// keep track of status changes
QObject::connect(&m_connection, &SyncthingConnection::statusChanged,

View File

@ -76,7 +76,7 @@ void SyncthingTestInstance::start()
// start st
// clang-format off
const QStringList args{
QStringLiteral("-gui-address=http://localhost:") + m_syncthingPort,
QStringLiteral("-gui-address=http://127.0.0.1:") + m_syncthingPort,
QStringLiteral("-gui-apikey=") + m_apiKey,
QStringLiteral("-home=") + configFile.absolutePath(),
QStringLiteral("-no-browser"),