CI: Add docker support for tst_qtextstream test

Currently test relies solely for external test server. This makes it
not possible to run test successfully with environment where docker is
used.

Pick-to: 6.2 6.3
Change-Id: If716921ce6ceea1ced2d0d7025c6e9768b4ed7a7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Pasi Petäjäjärvi 2022-02-24 22:43:11 +02:00
parent e25fc5a197
commit f00e332d39
2 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,7 @@ qt_internal_add_test(tst_qtextstream
Qt::Network
Qt::TestPrivate
TESTDATA ${test_data}
QT_TEST_SERVER_LIST "cyrus"
)
# Resources:

View File

@ -1211,11 +1211,16 @@ void tst_QTextStream::stillOpenWhenAtEnd()
while (!stream.readLine().isNull()) {}
QVERIFY(file.isOpen());
#ifdef QT_TEST_SERVER
if (!QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 143))
QSKIP("No network test server available");
#else
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
#endif
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 143);
socket.connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket.waitForReadyRead(5000));
QTextStream stream2(&socket);