tst_QSslServer: check if SecureTransport will block the test

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
Pick-to: 6.8
Change-Id: I05845fa23dec70d48251f5e4d93084a574d67d92
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Timur Pocheptsov 2024-11-07 10:09:41 +01:00
parent feb39b2d03
commit c9d1f18d0b

View File

@ -10,6 +10,8 @@
#include <QtNetwork/QSslKey>
#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);