From 1171144f480d1eee59f090db0ec535756cb5d3ff Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 7 Nov 2024 10:09:41 +0100 Subject: [PATCH] tst_QSslServer: check if SecureTransport will block the test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit which happens when we build with SDK 14 (where there is not property for importing PKCS12 in memory only) and then run on macOS 15 (where our trick with a temporary keychain is not working anymore). Task-number: QTBUG-130500 Change-Id: I05845fa23dec70d48251f5e4d93084a574d67d92 Reviewed-by: Tor Arne Vestbø (cherry picked from commit c9d1f18d0b88f3a4c60bf9a1342459fd67f42dbe) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp b/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp index 26d3a50a5b5..e97d164f4a0 100644 --- a/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp +++ b/tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp @@ -10,6 +10,8 @@ #include #include "private/qtlsbackend_p.h" +#include "../../../network-helpers.h" + class tst_QSslServer : public QObject { Q_OBJECT @@ -125,6 +127,8 @@ QSslConfiguration tst_QSslServer::createQSslConfiguration(QString keyFileName, void tst_QSslServer::testOneSuccessfulConnection() { + if (QtNetworkTestHelpers::isSecureTransportBlockingTest()) + QSKIP("SecureTransport will block this test while requesting keychain access"); // Setup server QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration(); SslServerSpy server(serverConfiguration); @@ -204,6 +208,8 @@ void tst_QSslServer::testOneSuccessfulConnection() void tst_QSslServer::testSelfSignedCertificateRejectedByServer() { + if (QtNetworkTestHelpers::isSecureTransportBlockingTest()) + QSKIP("SecureTransport will block this test while requesting keychain access"); // Set up server that verifies client QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration(); serverConfiguration.setPeerVerifyMode(QSslSocket::VerifyPeer); @@ -257,6 +263,8 @@ void tst_QSslServer::testSelfSignedCertificateRejectedByServer() void tst_QSslServer::testSelfSignedCertificateRejectedByClient() { + if (QtNetworkTestHelpers::isSecureTransportBlockingTest()) + QSKIP("SecureTransport will block this test while requesting keychain access"); // Set up server without verification of client QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration(); SslServerSpy server(serverConfiguration); @@ -490,6 +498,9 @@ void tst_QSslServer::quietClient() void tst_QSslServer::twoGoodAndManyBadClients() { + if (QtNetworkTestHelpers::isSecureTransportBlockingTest()) + QSKIP("SecureTransport will block this test while requesting keychain access"); + QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration(); SslServerSpy server(serverConfiguration); server.server.setHandshakeTimeout(750);